Document Tree
Document Properties
Kbid
31A211
Last Modified
24-Oct-2024
Added to KB
18-Jun-2024
Public Access
Everyone
Status
Online
Doc Type
Concepts
Product
ICM 12
Concept - Process Chains

Introduction

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:

  • Avoid conflicts with overlapping jobs
  • Shorten waiting periods between jobs
  • Minimize the scheduling effort
  • Restart a set of schedules if a task or schedule fails
  • Send notifications when a schedule or a set of schedules fails or finishes successfully

References

Technical Overview

  • The XSD can be found as processchain.xsd in our XML schema definition at GitHub.
  • For an overview of all important elements and attributes, refer to example-processchain.xml at GitHub.
  • Build medium sized process chains – incl. dependencies, to restart a group
  • Build chains in chains to reduce scheduling overhead – call a process chain schedule

Types of Elements

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.

  • Task List: For executing multiple tasks
    • Sequence - Executes all tasks one after another
    • Concurrent - Executes all tasks in parallel
  • Task Types:
    • Job - Executes a configuration, concurrent=true declares if the execution is sequential or parallel.
    • Pipeline - Executes a pipeline
  • Error: All tasks are executed in sequence if an error occurs in the outer task list.

Example of a Process Chain

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.

Process Chain Elements

Administrators can define process chains using XML files to be located in $IS_SITES.

The main configurable elements include:

  • <chain>
    The root element of the process chain XML file. Important attributes are 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:

    AttributeDescription
    jobSpecifies the name of the job as defined in the Intershop System Management Schedules module (mandatory).
    nameSpecifies a display name for this job to be used in the Intershop System Management | Monitoring | Locking | Processes module.
    domainCan define a specific domain for the job execution (optional). By default, the chain element job is executed in the domain of the process chain.
    allsitesCan specify whether the job executes in all domains (true|false), default is false.
    concurrentWith allsites=true, can specify whether the job executes in parallel in all domains (true|false), default is false.
    timeoutCan 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:

    AttributeDescription
    pipelineSpecifies the name of the pipeline to be executed.
    nameSpecifies a display name for this pipeline to be used in the Intershop System Management Monitoring | Locking | Processes module.
    domainCan define a specific domain for the pipeline execution (optional). By default, the chain element pipeline is executed in the domain of the process chain.
    startnodeCan define a specific pipeline start node (optional), default is Start.
    loginCan define the login name that the pipeline to be executed may require.
    passwordCan define the password if the pipeline to be executed requires a specific login.
    timeoutCan 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

    Make sure that <error> is the last element within the corresponding <sequence>.
  • <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 Example

Execution Plan Example
<?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>

Ignore - Sub Element of Each Task

The ignore element can suppress errors of a task or an umbrella element. The error element will ignore the declared states, in case they occur in the tasks of the same level.

<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>

Status Mapping

Each task execution has a result that is indicated by a status. This status is represented by a "bit"-status as an enum value (ProcessChainStatus) for each status. Parent processes can do a bitwise OR to combine the status of their children.

StatusBitDescription
STATUS_SUCCESS0No issues.
STATUS_WARNING1The process collected some warnings (e.g. imports are partly incorrect), but it continues.
STATUS_FAILURE2The process collected irreparable warnings (e.g. imports failed completely), so it is canceled
STATUS_ERROR4The process had some internal processing errors/exceptions.
STATUS_NOTFOUND8The process could not be found (e.g. for missing pipelines - could happen if the application does not support the process).
STATUS_INTERRUPTED16The process was interrupted by the OS or JVM, the process observer had time to store the interrupted state.
STATUS_STUCK32

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.

Process Chain View

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 GANTT diagram showing the execution sequence and more.

You may access an alternative view via Scheduling | Schedules | Last Run date of your process chain.

Disclaimer
The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.
Home
Knowledge Base
Product Releases
Log on to continue
This Knowledge Base document is reserved for registered customers.
Log on with your Intershop Entra ID to continue.
Write an email to supportadmin@intershop.de if you experience login issues,
or if you want to register as customer.