This macro command supports easy rescheduling of orders based on one or more configurable sorting fields.
Starting from ROB-EX Scheduler 7.2.4, this macro will utilize the Selection context feature.

In more detail the SortAndSchedule macro command will carry out the following steps.

  1. Find all selected operations and possibly limit the list to only include operations assigned to a specified list of resources. Prior to calling this macro command typically either the user has manually selected what to reschedule or a prior macro command would be SelectComponents.
  2. Optionally group operations according to matching sort values and update values on grouped operations. This step is for advanced usage (parameters involved in this step: adjustFields, adjustValues, defaultValues, horizon, resetToDefaultBeforeAdjust)
  3. Optionally unlock operations that are going to be scheduled (parameter unlockSelectedOperations)
  4. Sort the list of operations found according to one or more specified parameters – e.g. first sort by the order priority and secondarily sort by the existing operation start time.
  5. Finally re-schedule the orders in the sort order, according to a specified rule (e.g. “Forward from NOW with limited capacity”).
  6. Optionally lock all operations having been rescheduled (parameter lockSelectedOperations)

This macro has advantages compared to the Schedule macro command since it provides more flexibility around in what sequence the orders are scheduled.

Note that after completion of this macro, the list of selected operations are the same as when this macro command was called. I.e. the number of selected operations and the sequence in which they were selected are not changed by this command in any way.

Example with simple parameter configuration

The following example shows a simple usage of the SortAndSchedule macro command where selected operations on the “Grinder 1” resource are sorted first according to order delivery date ({order_delivery_calendar}) and secondarily according to the current operation start time ({opr_start_time}). The strategy used for rescheduling is “Forward from now with limited capacity”.

Example with advanced parameter configuration

The following example shows an advanced usage of the SortAndSchedule macro command.

  1. Selected operations on the “Grinder 1” resource are used (parameter resources={grinder 1})
  2. All operations are initially assigned an operation efficiency value of 1 (parameters adjustFields={opr_efficiency}, defaultValues=1 and resetToDefaultBeforeAdjust=true)
  3. Whenever two operations (parameter operationGroupSizeForAdjustment=2) on “Grinder 1” with a current planned start within 7 days from each other (horizon=7d) are having a matching product name (sortFields_={order_product_id}) will now be assigned with an operation efficiency of 2 (parameters adjustFields={opr_efficiency}, adjustValues=2). Also these two operations will be planned right after each other. This to say that whenever we can schedule two similar products after each other then we produce two products at the same time. Two operations not produced in product name pair will be give operation efficiency=1.
  4. Finally orders are sorted by the order product name (sortFields={order_delivery_calendar}) and rescheduled. The strategy used for rescheduling is “Forward from now with limited capacity”.

Parameter descriptions

(* = configuration required)

adjustFields
List of fields (e.g. operation efficiency) that will be changed before the sort and before the rescheduling step. The static value to assign to each field is specified using the adjustValues and optionally the defaultValues parameters as described below. See the example above for usage of this field.
Each field specified is entered as a comma separated list of variable names (no spaces after the comma). Each variable name must be enclosed in curly brackets.

To better explain this parameter see the “Advanced parameter configuration example” described above.

This is the list of valid variables to provide: Variable list

adjustValues
List of values used by the adjustFields parameter described above. There must be a value for each “adjust field”. The list is comma separated and there should not be any spaces between commas.
It is important that the value specified matches the field type the value is assigned to. As an example if assigning a value to a boolean field on the route (operation_sequence_custom_boolean_1) specfiy true or false as the value.

To better explain this parameter see the “Advanced parameter configuration example” described above.

defaultValues
List of default values for the adjust fields. There must be a value for each “adjust field”. The list is comma separated and there should not be any spaces between commas.
It is important that the value specified matches the field type the value is assigned to. As an example if assigning a value to a boolean field on the route (operation_sequence_custom_boolean_1) specfiy true or false as the value.

This parameter is only used if parameter *resetToDefaultBeforeAdjust*=true

To better explain this parameter see the “Advanced parameter configuration example” described above.

horizon
Search horizon during grouping of operations. Used to restrict how far operations must be from each other if they should be considered as a group.
This parameter is only used if parameter operationGroupSizeForAdjustment > 1

lockSelectedOperations
true = Lock re-scheduled operations after scheduling is complete. Only operations meeting the criteria’s of the resources parameter will be unlocked.
false = Do nothing (the default).

operationGroupSizeForAdjustment
For values > 1 then before sorting is carried out operations will be placed into groups based on whenever they have equal sort field criteria’s. Once the groups have been formed the adjustValue function will be called on the grouped operations.
To better explain this parameter see the “Advanced parameter configuration example” described above.

resetToDefaultBeforeAdjust
true = Reset the specified “adjust fields” for all operations meeting the criteria’s of the resources parameter, before adjusting the values. This requires a default value for each “adjust field”. (see above in defaultValues).
false = Do nothing (the default).

planStratName *
Specify the schedule strategy in this parameter. If no strategy is specified the scheduling dialog will be shown during execution of the macro (provided that parameter *showPlanStratDlg*=true), allowing the user to select a strategy. Lookup the available strategies here.

resources
A comma separated list of resource names (case insensitive). Each resource name must enclosed in curly brackets and there should be no spaces after/before the comma. Only selected operations on specified resources will be used in the later group, sort and rescheduling steps.
If the resources list is empty (the default) all selected operations will be used in the sorting and rescheduling steps.

showPlanStratDlg
Show the schedule dialog before scheduling. Default value is false.

sortFields
The sort field parameter’s is entered as a comma separated list (no spaces before/after the comma). Each parameter must be enclosed in curly brackets.
This is the list of valid variables to provide: Variable list

sortType
The sort direction: Ascending (the default) or Descending

unlockSelectedOperations
true= Unlock operations before scheduling start. Only operations meeting the criteria’s of the resources parameter will be unlocked.
false = Do nothing (the default).

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment