This concept is aimed at developers and describes the organization of tasks in process chains. In Intershop Commerce Management, process chains help to automate the sequential execution of interdependent scheduled jobs or pipelines.
As a developer or administrator, you can easily configure process chains using XML files.
By using process chains, you can:
An umbrella element defines how the tasks inside the element will be executed. An umbrella element is logged as a process. This allows the administrator to easily see the impact of the group.
concurrent=true
declares if the execution is sequential or parallel.The error sequence is executed if "Step 2.2.1 Job" or "Step 2.2.2 Pipeline" fails. For more details on fine-tuning error handling, refer to the description of the <ignore>
element in the next section.
Administrators can define process chains using XML files to be located in$IS_SITES.
Info
The default installation includes an example file, processchain.xml.example.
The main configurable elements include:
<chain>
The root element of the process chain XML file. Important attributes include name
(used in Intershop System Management | Monitoring | Locking | Processes), defaultChainElementTimeout
(default 60
), which defines the default timeout in minutes for all child elements (concurrent
, sequence
, job
, pipeline
), and keepAliveTime
, which defines the time that threads exceeding the core pool size may remain idle before being terminated.
<concurrent>
Child element of <chain>
or <sequence>
. Includes jobs or pipelines to be executed in parallel. The attribute name is used in Intershop System Management | Monitoring | Locking | Processes. Can define a timeout
in minutes, falling back to the defaultChainElementTimeout
if it is undefined or set to zero.
<sequence>
Child element of <chain>
or <concurrent>
. Includes jobs or pipelines to be executed sequentially in the given order. The attribute name is used in Intershop System Management | Monitoring | Locking | Processes. Can define a timeout
in minutes, falling back to the defaultChainElementTimeout
if it is undefined or set to zero.
<job>
Child element of <sequence>
or <concurrent>
. Specifies a job to be executed within the chain. The next table lists the attributes for<job>.
The following attributes can be assigned to the <job>
element:
Attribute | Description |
---|---|
job | Specifies the name of the job as defined in the System Management Schedules module (mandatory). |
name | Specifies a display name for this job to be used in the Intershop System Management | Monitoring | Locking | Processes module. |
domain | Can define a specific domain for the job execution (optional). By default, the chain element job is executed in the domain of the process chain. |
allsites | Can specify whether the job executes in all domains (true|false ), default is false . |
concurrent | With allsites=true , can specify whether the job executes in parallel in all domains (true|false ), default is false . |
timeout | Can define a timeout in minutes, falling back to the defaultChainElementTimeout if it is undefined or set to zero. |
<pipeline>
Child element of<sequence>
or<concurrent>. Specifies a pipeline to be executed within the chain. The next table lists the attributes for<pipeline>
.
The following attributes can be assigned to the <pipeline> element:
Attribute | Description |
---|---|
pipeline | Specifies the name of the pipeline to be executed. |
name | Specifies a display name for this pipeline to be used in the Monitoring | Locking | Processes module. |
domain | Can define a specific domain for the pipeline execution (optional). By default, the chain element pipeline is executed in the domain of the process chain. |
startnode | Can define a specific pipeline start node (optional), default is Start. |
login | Can define the login name that the pipeline to be executed may require. |
password | Can define the password if the pipeline to be executed requires a specific login. |
timeout | Can define a timeout in minutes, falling back to the defaultChainElementTimeout if it is undefined or set to zero. |
<error>
Optional child element of <sequence>
. Specifies a dedicated <job>
or <pipeline>
that is to be executed in case the preceding jobs or pipelines within the <sequence>
have failed.
Note
<parameter>
Optional child element of <pipeline>
. Can specify the parameter that the pipeline to be executed may require.
<description>
Optional child element of <sequence>
, <concurrent>
, <job>
, or <pipeline>
. Specifies a description to be displayed in the Intershop System Management Monitoring | Locking | Processes module.
<ignore>
Optional child element of <sequence>
, <concurrent>
, <job>
, or <pipeline>
. Can specify status codes (SUCCESS | WARNING | FAILURE | ERROR | NOTFOUND | INTERRUPTED | STUCK) returned by the corresponding chain element on execution that should be ignored for the rest of the process chain execution. This allows the process chain execution to continue even if an error occurs in one of its sub-tasks.
<?xml version="1.0" encoding="UTF-8"?> <p:chain name="Chain Example"> <p:sequence name="Chain is a sequence"> <p:job job="CheckOrders" name="Step 1 - Job" /> <p:concurrent name="Step 2 - Concurrent"> <p:pipeline pipeline="ExecuteProcessChain" name="Step 2.1 - Pipeline"> <p:parameter name="XmlFileName">*.xml</p:parameter> </p:pipeline> <p:sequence name="Step 2.2 - Sequence" timeout="30"> <p:description>Sequence example which runs into timeout after 30 minutes if not completed</p:description> <p:job allsites="true" concurrent="true" job="ArchiveOrders" name="Step 2.2.1 - Job" /> <p:pipeline pipeline="..." name="Step 2.2.2 - Pipeline" /> <p:error name="Step 2.2 Error Sequence"> <p:pipeline pipeline="SendNotification" name="Error - Pipeline" /> </p:error> </p:sequence> </p:concurrent> </p:sequence> </p:chain>
<p:concurrent name="Step 2 - Concurrent"> <p:sequence name="Step 2.2 - Sequence"> <p:ignore>NOTFOUND</p:ignore> <p:job allsites="true" concurrent="true" job="ArchiveOrders" name="Step 2.2.1 - Job" /> <p:pipeline pipeline="..." name="Step 2.2.2 - Pipeline" /> <p:error name="Step 2.2 Error Sequence"> <p:pipeline pipeline="SendNotification" name="Error - Pipeline" /> </p:error> </p:sequence> </p:concurrent>
Each task execution has a result that is indicated by a status. This status is represented by a "bit"-status by a enum (ProcessChainStatus
) value for each status. Parent processes can do a bitwise or to combine the status of their children.
Status | Bit | Description |
---|---|---|
STATUS_SUCCESS | 0 | No issues. |
STATUS_WARNING | 1 | The process collected some warnings (e.g. imports are partly incorrect), but it continues. |
STATUS_FAILURE | 2 | The process collected irreparable warnings (e.g. imports failed completely), so it is canceled |
STATUS_ERROR | 4 | The process had some internal processing errors/exceptions. |
STATUS_NOTFOUND | 8 | The process could not be found (e.g. for missing pipelines - could happen if the application does not support the process). |
STATUS_INTERRUPTED | 16 | The process was interrupted by the OS or JVM, the process observer had time to store the interrupted state. |
STATUS_STUCK | 32 | The process has been identified as stuck by another application server. The application server running the process periodically updates an attribute of the process to indicate that the working process is alive. |
To get an overview of the execution of a process chain:
In Intershop System Management, switch to Monitoring | Locking | Processes | <your subprocess>.
Here you can find information on acquired resources, the chain elements, the execution time, the status of your process chain, a GANT diagram showing the execution sequence and more.
You may access an alternative view via Scheduling | Schedules | Last Run date of your process chain.