
1. download the jar package(cms_epgmgmt_custom_rule_overlapping_schedule-1.0.0.28.jar) in bootstrap node.

2. create the custom rule folder 
	kubectl exec -it -n <namespace> cms-config-0 -- mkdir -p /opt/tandbergtv/cms/plugins/epgmgmt/rules	
	
3. copy the rules to plugin pv
	kubectl cp -n <namespace>  cms_epgmgmt_custom_rule_overlapping_schedule-1.0.0.28.jar cms-config-0:/opt/tandbergtv/cms/plugins/epgmgmt/rules/
	
4. restart cms epg
	cmscli service restart -s cms-epg
	
5. after epg pod start successfully , go to EPG -> Rule -> Normalization page in cms ui and click "Create" button

6. select "Ingest" or "Export" in "When to Run" tab 
	if select Ingest, the rule will fix the conflict schedules when ingest the epg data , so there will be no conflict in cms.
	if select Export, the rule will fix the conflict schedules when publish epg data to mediafirst,but the cms data will still have conflict.
	
7. In the "Data Modification" tab,click "Create Custom Rule" button , select the "Resolve overlapping schedule" in dropdown list and config the parameters
	Resolve Strategy: CROP_THE_EARLIER will crop the earlier schedule's duration if 2 scheduls are overlapped, CROP_THE_LATER will update the later schedule's start time and duration if 2 schedules are overlapped, for NBA this field need configured as CROP_THE_EARLIER.
	Time Period - Start Date (days before now): start time of schedule's time range, seems NBA's data not contains previous day's schedule, input 0 in this field is enough.
	Time Period - End Date (days after now): end time of schedule's time range , for NBA I think their data contains future 7 days schedules at most, so this field we can set 7.

8. Remove the empty default normalization rule , input the ruleset name in Properties tab and click the "Save" button

9. After the ruleset saved ,it will fix the overlapping when the next ingest or export happens