Creating Chain Definitions with Sequential Processes
Chain processes allow you to easily create dependencies between different processes; reducing the time between two processes that are to run sequentially to mere seconds.
Status Handlers
Chain processes have two levels of status handlers, on the step level and on the chain level. Additionally, each process of a step can be restarted automatically a number of times until it reaches a satisfying status.
- When no status handler is found on the process or step level, the status handler on the chain level is used.
- When there is none on the chain level either, then the default behavior is used.
The default behavior for chains is the following:
- When a step has reached status Completed the following step is started or, when this is the final step the chain status is set to Completed.
- When a step has reached status Error the chain status is set to Error.
- When a step has been canceled the chain status is set to Error.
- In chains created with 9.0.16.0 or later standard chain editor (Easy Restart enabled, default):
- When a chain process has reached status Killed, Error, Unknown, or Canceled the step is set to Console, the chain remains in status Waiting.
- In chains created in versions prior to 9.0.16.0 or in version 9.0.16.0 and later with either the basic chain editor or RedwoodScript ( Easy Restart disabled, default):
- When a chain process has reached status Killed, Error, Unknown, or Canceled the step and chain are set to status Error.
For more information on Status Handlers and Restart Behavior, see the Step topic and the Restart Behavior on the Status Tab topic, respectively.
tip
It is better to keep the amount of steps in a chain to a minimum for performance reasons.
Procedure
Creating a Chain Definition with Sequential Processes
- Choose "Definitions > Chains" in the Navigation bar.
- Choose New Chain Definition from the context-menu.
- On the Diagram tab choose the Name field and fill in a name for the chain in the property pane (right-hand side). Note that the property pain can be resized, collapsed, and expanded using the vertical divider.
- Choose the box under the caption Step 1.
- Choose the Process Definition field in the right-hand side property pane.
- Enter the part of the process definition name into the Process Definition field.
- Choose the desired process definition out of the list of available process definitions.
- Under Scheduling, select a value for Queue, ensure a process server that can handle the definition type is serving the queue. For example, if the process definition is of type CMD (Windows Batch).
- With your pointing device, hover over the dot on the line to the right of the box (far right box with multiple steps), notice how the dot becomes a plus sign (
[+]
), choose[+]
, a new step has been added. Choose the box under this new step. - Perform actions 6 to 9 of this procedure for each required step. Note that step names can be changed in the property pane for the step which is displayed when you choose the step name.
- Choose Save and Close.
Changing the Order
- If you do not already have the chain definition open, choose "Definitions > Chains" in the Navigation bar, locate the chain definition and choose Edit from the context-menu.
- Drag the step name horizontally until a green arrow points at the point where you want to move the step.
- Choose Save & Close.
Example
Create a chain with two steps, each step containing one process, the second having a parameter default value overruled.
- Choose "Definitions > Chains" in the Navigation bar.
- Choose New Chain Definition from the context-menu.
- Choose the field Name on the property pane (right-hand side) and fill in
MSLN_AP_INV_IN
. - Choose the box under Step 1.
- Choose the Process Definition field on the property pane.
- Enter sleep into the Process Definition field.
- Choose System_Sleep from the list of available process definitions.
- Fill 10 into the Priority field.
- With your pointing device, hover over the dot on the line to the right of the box under Step 1, notice how the dot becomes a plus sign (
[+]
), choose[+]
, a new step has been added. Choose the box under this new step. - Fill sleep into the Process Definition field of the property pane, select System_Sleep, once more.
- Enter the value System into the Queue; note that in this case, this task is optional. Since we did not define a default queue for the chain, the submit wizard will require you to fill the Queue field, this also means that you cannot submit this chain automatically, from an event for example. You define a default queue for the chain on the Control tab, see the Creating Chains with Parameter Handling topic for an example.
- Fill
2000
into the MilliSeconds or Time to sleep (in field under In Parameter Mappings. Depending on the slider named show to the right of the heading In Parameter Mappings, the name ( MilliSeconds ) or the potentially truncated description ( Time to sleep (in ) will be displayed as a field name. - Choose Save & Close to save the chain.
Submit the chain
- Navigate to "Definitions > Chains" in the Navigation bar.
- Choose Submit from the context-menu of the chain definition MSLN_AP_INV_IN.
- Choose Next.
- Fill System into the Queue field, and choose Submit.
See Also
JobChain