Correlating Objects
Use
A correlation enables you to identify objects that belong together, for example an invoice and the corresponding order. This involves correlating the objects by using one or more common elements, for example, the quotation number. When you define a Workflow, you can specify the object that the Workflow must wait for, without having to enter the ID of the object.
Process
You define a correlation with the correlation editor. To use the correlation in the Workflow you must first activate (instantiate) it. To do so, use a process control. A subsequent wait step can then use the correlation to determine the object that it must wait for. You can use a correlation when waiting for an event and when waiting for an event by using Workflow.
Defining a Correlation
-
To start the correlation editor, in the Workflow Builder choose (transaction SWF_CRL1) and enter a name for the correlation.
-
In the screen area on the left of the correlation editor, select the object types that are involved in the correlation.
-
In the screen area on the right, define the container elements that make up the correlation.
-
In the lower screen area on the right, define the assignment for each container element to the relevant object (binding between object and correlation container).
Activating a Correlation
-
Insert a Process Control step into the Workflow at the required location.
-
Choose the Control tab page and in the Function field, enter Activate Correlation.
-
Choose the event that the correlation is to be activated for, and the correlation to be activated.
-
Specify how the value of the correlation is to be determined:
-
Using Basis Element: If you have defined the binding in the correlation definition, you can specify a container element that references the corresponding basis element from the correlation definition.
-
Using Binding: Choose this option if you want to define a binding between the Workflow container and the correlation container.
-
-
In the field Correlation Instance, choose the container element for the correlation object.
The correlation object shows the value of the correlation. The container element for the correlation object must have the predefined data type CL_SWF_MOD_CORRELATION.
Defining a Wait Step: Wait for Event with Correlation
-
Navigate to the wait step and choose the Control tab page. In the Wait field, enter Wait for Event and select Correlation.
-
Choose the object type for which an event is to arrive and the required event.
-
Choose the correlation and specify how the value of the correlation is to be determined:
-
Using a Basis Element: Choose this option if you have defined the binding in the correlation definition.
-
Using Binding: Choose this option if you want to define a binding between the Workflow container and the correlation container.
-
Defining a Wait Step: Wait for Event by Using Workflow with Correlation
-
In the version-specific basic data of the Workflow, define the event that the Workflow is to wait for.
In the Wait Type field, select the entry Wait for Event By Using Correlation and in the Receiver Type field, select the entry Event for Wait Step.
-
On the Control tab page in the wait step, select the event that you defined earlier.
-
Under Correlation Instances, select the container element or container elements that contain the values of the correlations that the event must fulfill.

