Validation and execution
On successful validation and execution of the macro, a planning engine is created based on the specified planning engine definition.
These are the validation rules:
- The Planning Engine name & Planning Engine Display may use parameter variables to
create Planning Engine name and optionally to determine the display name. Typically these
are the parameter variables. See Parameter variable help section for
additional variables:
- %date% = UTC date at run-time (format in yyyymmdd)
- %time% = UTC time at run-time (format in hhmiss)
- %datetime% = UTC date & time at run-time (format in yyyymmdd hhmiss)Note: yyyymmdd (yyyy= Year, mm = month, dd = day), hhmiss (hh = 24 hour. mi = minute, ss = seconds).
- %PlanningEngineCycle% =Name of the Planning Engine cycle within the current context.
- Application variables are substituted at run time.
- If the Cycle parameter is populated, the Planning Engine requires a calendar created by
defining the parameters Calendar, StartPeriod, Horizon and Level (optional). This determines
the SCP Calendar to use, the start bucket and the length of the horizon. If Cycle parameter
is not populated, the Calendar, StartPeriod, Horizon and Level are all optional.
- The StartPeriod must exist at the level specified.Note: Base level of the specified Calendar is used when level is not specified.
- The StartPeriod must exist at the level specified.
- Planning engine Name parameter is optional when Cycle Parameter is populated.Note: If Planning engine Name parameter is not populated, planning engine is created with the Name Cycle.StartPeriod.
- Planning Engine Category is derived from the Category parameter if defined.Note: Planning Engine Category is set to Null when Category parameter is not defined.
- Planning Engine Tags are derived from the Tags Parameter if defined. If not defined the
Tags from the Planning Engine Definition are used.
- Note that if both the Tag Parameter and the Planning Engine Definitions Tags are both null, the macro will fail.
- On creation the Planning Engine is set as the “Master” Planning engine.
- The macro fails when a Master Planning Engine already exists against the Cycle (if specified).
- The Planning engine is added to the Main Menu under the specific category, when category is not specified the Planning Engine is added under the Planning Engine's display name.
Examples
Requirement | Parameters |
---|---|
Create a new planning engine "Weekly Supply Plan FY19 W29" based on a planning engine definition "SP_SCO". The role and Tags given to new Planning engine is from Planning Engine Definition. The Planning engine does not have a calendar created as part of the macro. |
CreatePlanningEngine("Weekly Supply Plan FY19 W29","","SP_SCO","","","","","","","","","") |
Create a new planning engine "Weekly Supply Plan FY19 W29" based on a planning engine definition "SP_SCO" and a calendar based on "Weekly Calendar" with a start Period of "FY19 W29" (which must exist at the base level of the Calendar) and horizon of 52. The Planning Engine is assigned the Category "Weekly Supply Plan". The role and Tags given to new Planning engine is from the Planning Engine Definition. |
CreatePlanningEngine("Weekly Supply Plan FY19 W29","","SP_SCO","Weekly Supply Plan","","","","Weekly Calendar","FY19 W29","52","","") |
Create a new planning engine called Week_20200407 (where Week_20200407 is the UTC date at run-time) %date% based on Planning Engine definition "SP_SCO" with a display name of "Weekly Supply Plan_Week_20200407" and a calendar based on "Weekly Calendar" with a start Period of "FY19 W29" (which must exist at the base level of the Calendar) and horizon of 52. The Planning Engine is assigned the category "Weekly Plans" and given the role "Planning Engine Normal" and Tag "Advanced Planning". |
CreatePlanningEngine("Week_%date%", "Weekly Supply Plan_%date%, "SP_SCO", "Weekly Plans, "Planning Engine Normal","","Advanced Planning","Weekly Calendar","FY19 W29","52","","") |
Create a new planning engine called Monthly SCO.FY19 M07 based on Planning Engine definition "SP_SCO" and cycle "Monthly SCO" with a calendar based on "Weekly Calendar" with a start Period of "FY19 M07" at the Calendar Level "Months" and horizon of 12. The Planning Engine is assigned the category "Monthly Plans" and given the role "Planning Engine Normal" and Tag "Advanced Planning". |
CreatePlanningEngine("", "", "SP_SCO", "Monthly Plans, "Planning Engine Normal","","Advanced Planning","Weekly Calendar","FY19 M07","12","Monthly SCO","Months") |