Sync (SYNC)

Sync objects help coordinate the processing of multiple executable objects. They are synchronization mechanisms that let you assign logical resources to certain processes based on how much they consume. Then they regulate the process flow by consuming and releasing these resources.

You use Sync objects to define states and status transitions that you link to actions and (optionally) to values. These definitions control when and how executable objects will be processed. You then assign the Sync object to the executable objects you want to control this way. You can assign a Sync object to as many other objects as you need. As soon as the executable objects are activated, the system checks what is the current state of the Sync object and, depending on the action (and value, if set) assigned to that state, the executable object is processed or not.

Example

Sync objects help you deal with cases like these:

  • Two processes in your organization are completely independent from each other; you have created two Workflows to automate them, which also run independently. However, these processes share a Job, which is therefore included in both Workflows. You want the Job in one of the Workflows to be started only if it has already finished in the other one.
  • You want to prevent too many concurrent processes against the database while preserving just-in-time execution.

After defining and assigning Sync objects, you can check the executable objects that will be affected by them. Right-click the Sync object on the Explorer list in the Process Assembly perspective and select Monitoring > Open Sync Monitor.

Defining a Sync Object

First, you define the start state of a Sync object and determine what should be its subsequent state in case the first one is reached. Then, you associate states first to values and then to actions, thus establishing the dependencies you need:

  1. In the State Definition section define the states that can be assumed by the Sync object.
    1. Enter a state in the first input field.
    2. Optionally, enter a short description that helps you recognize the purpose of this state when you later on assign this object.
    3. Click the Add button to insert the state in the list below.
    4. If you want to edit this entry, click it to expand it in edit mode, for example:

      Make your changes and click the icons on the right hand side to either confirm or cancel your changes, or to remove the entry from the list.

  2. Optionally, assign values to the states in the Default/Current Settings section. The execution of the actions you define below depend on the values assigned to the states.

    1. Select an entry from the State dropdown list. It contains all the states you added in the previous section.
    2. Use the spin button or type to enter the Value you want to assign to the selected state.
    3. Click the Refresh button to display the current state and value of the Sync object.
  3. In the Action Definition section you define the actions that can be called by an executable object and establish dependencies that determine when they can be called.
    1. Click on the first row of the Action Name column and type the name of the action. Make sure that you use short, descriptive names that you can easily recognize when assigning the Sync object to other objects.
    2. In the State column choose the state that the Sync object must have for this action to be executed.
    3. In the Value column you can (but must not) assign a value to this combination of action and state.

      Open the dropdown list to select a comparison operator and specify the value.

    4. In Change State to specify what should happen if the action reaches the state and value you have just entered. To do so, select a status from the dropdown list.
    5. Assign a value to this combination of action and state.
    6. Save the object.

      You can now assign it to other executable objects on their General > Sync page.

Example

Two processes in your organization are completely independent from each other. You have created two Workflows to automate them, which also run independently. They are WORKFLOW_A and WORKFLOW_B.

Workflow A has two Jobs, JOB_A1 and JOB_A2. Workflow B has two Jobs, JOB_B1 and JOB_B2.

The Jobs cannot run simultaneously. They must be executed one after the other, each in its respective Workflow.

WORKFLOW_A must finish before WORKFLOW_B can start, which means that JOB_B2 cannot start before JOB_A1 has ended.

  1. Create the SYNC object.

    The EXAMPLE_STATE SYNC object maps the state of JOB_A1 and contains two states:

    • DONE, which means that processing is completed
    • READY, which allows processing

    XXX

    Executable objects to which you assign this object can trigger its predefined actions. In our example, we do not use values but we define the following actions:

    • SET_READY

      When the SYNC object has state DONE, this action is triggered. As a result of this action, the READY status is set.

      Thus, this action can only be executed when a process has been completed.

    • SET_DONE

      When the SYNC object has state READY, this action is triggered. As a result of this action, the DONE status is set.

      Thus this action can only be executed when it is ready for processing.

  2. Assign the SYNC object to JOB_A1.

    This Job is part of WORKFLOW_A. It has no START action. When it ends, it triggers the SET_DONE action in the Sync object. As a result, the state DONE (end of processing) is set. A necessary precondition is that the current state is READY (for processing).

  3. Assign the SYNC object to JOB_B2.

    This Job is part of WORKFLOW_B2. It starts with the SET_READY of the Sync object. This action can only be carried out when the current status is DONE. This can only be the case when JOB_A1 has been completed. At the same time, this action sets the status READY (for processing).

  4. Execute the workflows and watch the result.

    • WORKFLOW_A and WORKFLOW_B run simultaneously. Their status is ACTIVE.
    • JOB_A2 is waiting for JOB_A1 to complete. This is the normal processing order of the Workflow.
    • JOB_A1 is running. Its status is ACTIVE.
    • JOB_B2 is waiting for the state of the Sync object to change to DONE. As JOB_A1 is still running, the Sync object has the state READY. Only when JOB_A1 has ended will the Sync's state changes to DONE. This is when JOB_2 starts.

See also:

Sync Page