uCosminexus Service Platform, Basic Development Guide

[Contents][Glossary][Index][Back][Next]

5.5.2 Defining Correlation Sets

A correlation set is a character string that is used to uniquely identify a request message sent from a service requester.

Organization of this subsection
(1) Identifying process instancesbased oncorrelation sets
(2) Activities to which correlation sets can be assigned
(3) Notes on using correlation sets
(4) Correlation set definition methods
(5) Definition example that uses correlation sets

(1) Identifying process instancesbased oncorrelation sets

The business process generates a process instance for each request to a receive activity for which yes is specified for Instance generation in the Receive Activity dialog box.

If the HCSC server contains multiple process instances that can receive request messages from service requesters, the HCSC server identifies each process instance by using the correlation set value contained in each request message.

For example, assume that two receive activities that receive requests from service requesters are defined in a business process. A request is sent to the first receive activity, and the second receive activity places the business process in a wait request status. In this case, the value of the correlation set included in a request message to the first receive activity must be included in a request message to the second receive activity. Specifying the same value for these correlation sets enables the system to identify that these two requests go to the same process instance. This enables subsequent processing to continue after the second receive activity.

The following figure shows an example of identifying process instances based on correlation sets.

Figure 5-8 Example of identifying process instances based on correlation sets

[Figure]

To implement a business process that has multiple receive activities, which of the values included in a request message is to be used for the correlation set must be defined in the business process. When designing a business process and service requester, a unique key value identifying each process instance must be set in a request message from the service requester.

A correlation set can be configured from a single part contained in a request message or by linking multiple parts contained in a request message.

When using correlation sets in a business process, you can search the execution history of process instances by using the value of the correlation set as a key. You can search the execution history to confirm the execution status of a particular request. For details about the execution history of process instances, see 6.1 Management of execution log of process instances in the uCosminexus Service Platform Setup and Operation Guide.

(2) Activities to which correlation sets can be assigned

In a business process, you can specify correlation sets for receive activities, reply activities, and invoke service activities. You can also specify multiple correlation sets for a single message.

Whether a correlation set must be specified and what role it plays differ depending on the activity type.

(a) Receive activities and reply activities

For receive activities and reply activities, the specification requirement and contents of correlation sets differ depending on the instance generation settings, and on whether the assigned correlation set is to be initialized.

You can specify instance generation in the Receive Activity dialog box. You can use the Allocating Correlation Set Group dialog box to specify whether to initialize correlation sets.

For details about the Receive Activity dialog box, see 1.4.7 Receive Activity Dialog in the manual uCosminexus Service Platform Reference Guide. For details about the Allocating Correlation Set Group dialog box, see 1.4.3 Allocating Correlation Set Group Dialog in the manual uCosminexus Service Platform Reference Guide.

Table 5-5 Specification requirement and contents of correlation sets (receive and reply)

Activity Instance generation Initialization specification Specification requirement Maximum number of specifications Contents of specified correlation set
Receive yes yes Optional 1 When a process instance is generated, a correlation set for identifying process instances is generated from a receive message defined as a variable.
no Cannot be specified -- --
no yes Optional 1 After a generated process instance is retrieved, a new correlation set corresponding to the retrieved process instance is generated from a receive message defined as a variable.
no Required 1 The specified correlation set is used as a correlation set within the receive message defined as a variable, to retrieve generated process instances.
Reply -- yes Optional 1 When returning a reply to a service requester, a new correlation set is generated from a reply message defined as a variable.
-- no Optional 1 When returning a reply to a service requester, the system checks whether the correlation set value within the reply message defined as a variable matches the correlation set value of the process instance.

Legend:
--: Not applicable

(b) Invoke service activities

For invoke service activities, the specification requirement and contents of a correlation set differ depending on the pattern settings for the assigned correlation set and whether the correlation set is to be initialized.

You can use the Allocating Correlation Set Group dialog box to specify pattern settings for the assigned correlation set and whether to initialize the correlation set.

For details about the Allocating Correlation Set Group dialog box, see 1.4.3 Allocating Correlation Set Group Dialog in the manual uCosminexus Service Platform Reference Guide.

Table 5-6 Invoke service activities to which correlation sets can be assigned

Activity Pattern specification Initialization specification Specification requirement Maximum number of specifications Contents of specified correlation set
Invoke service out yes Optional 1 When sending a message to a service component, a new correlation set is generated from a send message defined as a variable.
no Optional 1 When sending a message to a service component, the system checks whether the correlation set value within the send message defined as a variable matches the correlation set value of the process instance.
in yes Optional 1 When a reply is received from a service component, a new correlation set is generated from a reply message defined as a variable.
no Optional 1 When a reply is received from a service component, the system checks whether the correlation set value within the reply message defined as a variable matches the correlation set value of the process instance.
out-in yes Optional 1

During transmission:
When sending a message to a service component, a new correlation set is generated from a send message defined as a variable.

During reception:
When a reply is received from a service component, the system checks whether the correlation set value within the reply message defined as a variable matches the correlation set value of the process instance.
no Optional 1

During transmission:
When sending a message to a service component, the system checks whether the correlation set value within the send message defined as a variable matches the correlation set value of the process instance.

During reception:
When a reply is received from a service component, the system checks whether the correlation set value within the reply message defined as a variable matches the correlation set value of the process instance.

(3) Notes on using correlation sets

(a) Use of correlation sets when scope activities are used

You can add or edit the correlation sets to be used by activities within a business process or scope, in the same way you can add or edit variables. For details, see 5.5.1(5)(a) Use of variables when scope activities are used.

(b) Changing the definition information for correlation sets

If necessary, you can change or delete the definition information for correlation sets.

For notes on changing the variable definition information used in correlation set definitions, see 5.5.1(5)(d) Modifying the definition information of variables.

Care is required when changing the correlation set after upgrading the version of a business process. For details, see 5.9.4(3) Points to be noted when upgrading the version of business process.

Note
If you change the correlation set definition information, you might need to reallocate the correlation set to the sections where it was allocated.
For example, if correlation set A is allocated to a certain activity, and then the name of correlation set A is changed to correlation set B, perform one of the following operations:
  • Reallocate the correlation set to the activity.
  • Redefine correlation set A.
(c) Scope of correlation set

If a correlation set is declared by a global variable of a business process, the correlation set is valid until the processing of the applicable process instance finishes.

If a correlation set used by an activity in a scope is also declared, the correlation set is valid until the processing within the scope finishes.

The correlation set becomes invalid when the processing finishes.

(4) Correlation set definition methods

(a) Defining new correlation sets

Before defining a correlation set, you must define variables and specify some of these variables to be used as part of the correlation set. The procedure for defining new correlation sets is described below. Note that correlation sets cannot be defined on the canvas within a while activity.

  1. Use one of the following methods to open the List Of Variables And Correlation Sets dialog box:
    • In the Define Business Process window, double-click the Variable-Correlation icon on the canvas.
    • Click Edit in the dialog boxes for the following activities:
      - Receive activity
      - Reply activity
      - Invoke service activity
  2. In the list, select CorrelationSet List.
  3. Enter a correlation set name.
  4. Click Add Line and add a variable name and a part name in Acquisition Part to specify the part to be used as the correlation set.
    For correlation sets, you can specify a variable of the message type (XML) and a part name specifying a type other than the message type.
    If multiple message type variables are used, select the variables and part names to be used from the drop-down list.
    To link multiple parts and set the linked character string as the correlation set value, click Add Line again and add the variables and part names to be used.
  5. Click Add.
    The added correlation set is displayed in the Correlation Set List.
  6. Click OK.
(b) Specifying correlation sets from activities

The procedure for specifying correlation sets from the activities shown in Table 5-6 Invoke service activities to which correlation sets can be assigned is described as follows:

  1. Click Setting in the dialog box for each activity.
    The Allocating Correlation Set Group dialog box appears.
  2. Select the correlation set to be assigned to the activity from the Correlation set drop-down list.
  3. If you cannot find the desired correlation set in the Correlation set drop-down list, click Edit.
  4. The List Of Variables And Correlation Sets dialog box appears. Add a correlation set.
  5. In the Allocating Correlation Set Group dialog box, specify whether to initialize the correlation set.

(5) Definition example that uses correlation sets

The process of defining a business process that uses correlation sets is explained by using an example.

The example in the following figure uses a business process that asynchronously receives application requests and application result confirmation requests.

Figure 5-9 Example of the business process to be defined

[Figure]

The contents of the variables, correlation sets, and receive activities for defining the business processes shown in the above figure are described below.

Defining the variables and correlation sets
Define the variables and correlation sets to be used, as shown in the tables below. You can define variables and correlation sets in the List Of Variables And Correlation Sets dialog box. For details about the List Of Variables And Correlation Sets dialog box, see 1.4.1 List Of Variables And Correlation Sets Dialog in the manual uCosminexus Service Platform Reference Guide.

Table 5-7 Definition contents of variables for application request messages (example)

Setting items in the List Of Variables And Correlation Sets dialog box (for displaying variable information) Values specified
Variable name ApplicationMessage
Type XML
Message format application-message.xsd
Part specifications Part name ApplicationID
Expression /req1/id
Type string

Table 5-8 Definition contents of variables for application result confirmation request messages (example)

Setting items in the List Of Variables And Correlation Sets dialog box (for displaying variable information) Values specified
Variable name ApplicationConfirmationMessage
Type XML
Message format application-confirmation-message.xsd
Part specifications Part name ApplicationID
Expression /req2/id
Type string

Table 5-9 Definition contents of correlation sets (example)

Setting items in the List Of Variables And Correlation Sets dialog box (for displaying correlation set information) Values specified
Correlation set name ApplicationCorrelationID
Acquisition Part Variable name ApplicationMessage#
Part name ApplicationID

#
For Variable name, you can specify either the application message or application confirmation message.

Defining the receive activities
Define the receive activities as shown in the tables below. You can define receive activities in the Receive Activity dialog box. For details about the Receive Activity dialog box, see 1.4.7 Receive Activity Dialog in the manual uCosminexus Service Platform Reference Guide.

Table 5-10 Definition contents of the receive activities for receiving application requests (example)

Setting items in the Receive Activity dialog box Values specified
Activity name ApplicationReception
Operation name request
Allocated variable ApplicationMessage
Correlation set group Correlation set name ApplicationCorrelation ID
Initialization yes
Communication model Async
Instance generation yes

Table 5-11 Definition contents of the receive activities for receiving application result confirmation requests (example)

Setting items in the Receive Activity dialog box Values specified
Activity name ConfirmationReception
Operation name confirm
Allocated variable ApplicationConfirmationMessage
Correlation set group Correlation set name ApplicationCorrelation ID
Initialization no
Communication model Synch
Instance generation no