Chain Processes
A chain process in a chain definition is a call to a process definition. It may also have an optional
The attributes of the chain process itself are:
- Process Definition - The name of the process definition or chain definition to be called.
- Precondition - A condition that must be evaluated to
true
for the chain process to start, if it evaluates tofalse
, then it is skipped. See precondition function for more information. - Parameter Mappings - Process definition parameters, can be filled or inherit parameters from the chain or chain processes from previous steps.
- Scheduling Parameters - Parameters that specify if, how (on hold or not), when, and in which queue a process should be started.
- Process Monitor Updates - Used to update one or more process monitor tasks.
If a process definition requires that parameters be specified, or has parameter values that must come from other chain processes, then parameter mappings must also be supplied under Input Parameters.
Parameter values can refer to other parameters in the chain definition, be set manually, or via an expression.
- Reference - allows you to choose which chain definition or chain process parameter value to use for this parameter. The naming works in the following way: {chain definition name| step name:job number}:Parameter, for example,
- ORA_DATALOAD:SID - the value of the chain definition level parameter SID of the current chain definition named ORA_DATALOAD.
- DATALOAD:Job 3:SID - the value of the parameter SID of the 3rd job in the DATALOAD step.
- Expression - the value of the parameter, can be a string, number, character, date time zone, or an expression in Redwood Expression Language.
note
When a job reaches status Error, Unknown, or Killed then Out values of parameters might not get set properly; this depends on the job, if it had time to set the Out parameters before it reached a final status then the parameter should be set.
Preconditions
Chain Processes have a single, optional precondition function. A chain process with no precondition always executes. A chain process with a precondition only executes if the precondition returns true. If the precondition returns false, then the chain process is skipped.
The default input format for expressions is a string, in preconditions are usually made of functions, function expressions must start with an equals sign (=).
The precondition is an expression in Redwood Expression Language.
note
Preconditions may be executed before the chain process is persisted, or, saved to the database. This can occur in chains when the step reaches status Console and is restarted; it has the effect that it is not possible to access itself or any other chain process in the same chain.
Raise and Wait Events
All conditions must be met for the process to raise or wait on the event.
Raise Event
Field | Description |
---|---|
Event Definition | Event to raise. |
Status To Raise On | Process status at which to raise the event. |
Error Code | Error code that causes the event to be raised. |
Raise Comment | Comment to leave on the event as it is raised. |
When time window | Time window to use for raising the event. |
is | Status of the time window for the event to be raised. |
in time zone | Time zone to use for the time window. |
When expression | Expression to use which, when evaluated to true , will raise the event if the process reached the given status the process. |
Wait Event
Field | Description |
---|---|
Event Definition | Event to attach to process. |
Clears Event | When this is checked, the process clears the event, optionally with clearer comment if specified. Default: will not clear the event. |
Clearer Comment | Comment to leave on the event, as it is cleared by the process. |
When time window | Time window to use for attaching the event to the process. |
is | Status of the time window for the event to be attached to the process. |
in time zone | Time zone to use for the time window. |
When expression | Expression to use which, when evaluated to true , will attach the event to the process. |
Scheduling Parameters
If a chain process in a chain definition requires scheduling parameters to be specified then these parameters must also be set. This window allows for setting chain process scheduling parameters.
The following scheduling parameters can be set:
- HoldOnSubmit - expression for hold on submit. Can be true, false (the default), or boolean REL expression (
=<expression>
). - Submit Disabled - disable the submit of the chain process. Can be true, false (the default), or boolean REL expression.
- Priority - number from
1
to100
, the higher the number, the higher the priority. Can hold a numeric REL expression which must return a number between1
and100
. - Queue - name of the default queue. Can hold a String REL expression which returns the name (
<partition>.<queue>
) of a queue; the<partition>
is options defaults to GLOBAL. - Time Window - time window for the start time of the chain process. Can hold a String REL expression which returns the name (
<partition>.<timewindow>
) of a queue; the<partition>
is optional and defaults to GLOBAL. - Start time - start time of the chain process, if the time is in the past when the parent step is started, the chain process will run immediately, otherwise it will wait until the start time has been reached. Can hold a String REL expression which returns the time expression or the start time as a string. Can also hold a DateTimeZone REL expression which returns the start time of the process. See below for more information on time expressions.
- Ignore Status - the final status of this chain process is ignored when evaluating the status of the step. For example, when a chain process with Ignore Status enabled reaches status Error and all other chain processes in this step reach status Completed, the step will be set to Completed.
- Wait For Completion - wait for this chain process to reach a final status. If this is set to
false
, the step step will both ignore the status and not wait for this chain process to reach a final status.
note
For SAP chain processes, the queue defines which SAP instance it will run against; SAP chain processes require the Queue scheduling parameter or the SAP System parameter be set as there is no default queue for SAP chain processes.
Start Time Syntax
Chain process scheduling parameter Start time controls when the step starts.
The syntax is as follows:
HH:mm[:ss]
- fixed start time (24 hour), date relative to the start time of the step, seconds optional; when seconds are not specified, the seconds at submit time are used.+HH:mm[:ss]
- innermost chain run start plus the specified amount of time, seconds optional.<time_expression>
- time expression applied to the start time of the step.+<time_expression>
- time expression applied to innermost chain run start.yyyy/MM/dd HH:mm:ss,SSS i
-<year>/<month>/<date> <hour>:<minute>:<second>,<millis> <Olsen name for time zone>
(example2021/12/24 15:45:59,123 Europe/Paris
).=<expression>
- REL expression with all of the usual variables available in call scheduling parameters.- String REL expressions can return either the start time in the format
[+]HH:mm:ss
,+<time_expression>
, andyyyy/MM/dd HH:mm:ss,SSS i
. - DateTimeZone REL expressions should return an date, time, and time zone in the DateTimeZone format.
- String REL expressions can return either the start time in the format
The step is the parent of the chain process on which the scheduling parameter is specified.
Time Expressions
The following time expressions are supported.
set <specifier> <value>
- set<specifier>
to<value>
add <value> <specifier>
- add<value>
to<specifier>
(This may propagate)subtract <value> <specifier>
- subtract<value>
from<specifier>
(This may propagate)truncate <specifier>
- truncate at<specifier>
(This will zero everything below<specifier>
).- The days of the week start at 1 for Sunday.
- The days of the year start at 1 for January 1st.
Supported Specifiers
- add/subtract: second, minute, hour, day, week, month, year
- truncate: second, minute, hour, day, month
- set: second, minute, hour, day, day_of_week, day_of_year, week_of_month, month
Plurals with an additional 's' are accepted (eg. days, weeks, ...). The day is always the day of the month. English names are accepted for day of week (`day_of_week`) and month; for example set day_of_week Monday or set month January, three letter abbreviations are accepted as well.
Examples
- add 1 minute
- add 3 seconds
- set hour 1
- set day_of_week Mon
- truncate day
- subtract 2 days
Event Expression Example
- Attach an event to be raised by process 1 of the first step for status Error only if any of two events is raised.
- Choose "Definitions > Chains".
- Choose process 1 of the first step.
- Choose Raise Events, choose and select an event definition.
- Fill
=Event.isEventRaised('Mypartition.MyEvent1') || Event.isEventRaised('Mypartition.MyEvent2')
in the When expression field. - Choose Save and Close to save the chain definition close the dialog.
See Also
JobChain