uCosminexus Service Platform, Basic Development Guide
A correlation set is a character string that is used to uniquely identify a request message sent from a service requester.
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
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.
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.
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. |
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 |
|
|
no | Optional | 1 |
|
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.
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.
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.
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.
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:
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
The contents of the variables, correlation sets, and receive activities for defining the business processes shown in the above figure are described below.
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 |
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 |
All Rights Reserved. Copyright (C) 2015, Hitachi, Ltd.