Process Developer > Part III: Functions, Events, Errors, and Correlation > Correlation > What is a Correlation Set
  

What is a Correlation Set

Select properties defined in a WSDL to use in a correlation set.
A correlation set is a set of properties shared by messages. A correlated message data that is the same as that in all other messages in the set. Since the element names of each message can be different, you need a mechanism to match up the same piece of data among the messages.
How does the mechanism work? For each correlation set, you create a data property, such as customerID. For each message being correlated, you create a property alias for a message part, such as a Receive's message part named custID, an invoke's input message part named CustomerNumber, and so on.

Properties

A message property to be used for message correlation must be a schema simple type like an xsd:int or an xsd:string.

Property Aliases

Properties can exist in WSDL messages, schema elements, and schema types. The property alias specifies the message part or query.
For example, a purchase ordering process might have an OrderId. property. Messages can store the value of OrderId in different parts with different names. A property alias identifies the part. A specific process instance is identified by a unique OrderId such that no two processes will ever have the same value for OrderId. This ensures that when a message arrives, it is dispatched to the correct process instance.
The following illustration shows how a message property alias is mapped to a property name. The property name is mapped to a correlation set. You can create as many correlation sets as you need.
For more information, see:

WSDL Syntax and Example for Property Names and Aliases

Use a Process Developer wizard to automatically create variable properties and property aliases. (This is described in Adding Variable Properties and Property Aliases). The wizard generates WSDL code, as the following examples show.
The WSDL syntax for a property name is:
<wsdl:definitions name="NCName"
xmlns:vprop="http://docs.oasis-open.org/wsbpel/2.0/varprop">
<vprop:property name="NCName"
type="QName"?
element="QName"?/>
...
</wsdl:definitions>
The WSDL syntax for a property alias is:
<wsdl:definitions name="NCName"
xmlns:vprop="http://docs.oasis-open.org/wsbpel/2.0/varprop">
<vprop:propertyAlias propertyName="QName"
messageType="QName"?
part="NCName"?
type="QName"?
element="QName"?>
<vprop:query queryLanguage="anyURI"?>?
queryContent
</vprop:query>
</vprop:propertyAlias>
...
</wsdl:definitions>
Property and Property Alias Example
Consider the following message definition:
<wsdl:definitions name="messages"
targetNamespace="http://example.com/taxMessages.wsdl"
xmlns:txtyp="http://example.com/taxTypes.xsd"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<!-- define a WSDL application message -->
<wsdl:message name="taxpayerInfoMsg">
<wsdl:part name="identification"
element="txtyp:taxPayerInfoElem" />
</wsdl:message>
...
</wsdl:definitions>
The following WSDL fragment shows the definition of a property and its location in a particular field of the message:
<wsdl:definitions name="properties"
targetNamespace="http://example.com/properties.wsdl"
xmlns:tns="http://example.com/properties.wsdl"
xmlns:txtyp="http://example.com/taxTypes.xsd"
xmlns:txmsg="http://example.com/taxMessages.wsdl" ...>
<!-- define a correlation property -->
<vprop:property name="taxpayerNumber" type="txtyp:SSN" />
...
<vprop:propertyAlias propertyName="tns:taxpayerNumber"
messageType="txmsg:taxpayerInfoMsg"
part="identification">
<vprop:query>txtyp:socialsecnumber</vprop:query>
</vprop:propertyAlias>
<vprop:propertyAlias propertyName="tns:taxpayerNumber"
element="txtyp:taxPayerInfoElem">
<vprop:query>txtyp:socialsecnumber</vprop:query>
</vprop:propertyAlias>
</wsdl:definitions>
The first <vprop:propertyAlias> defines a named property tns:taxpayerNumber as an alias for a location in the identification part of the message type txmsg:taxpayerInfoMsg.
The second <vprop:propertyAlias> provides a second definition for the same named property tns:taxpayerNumber but this time as an alias for a location inside of the element txtyp:taxPayerInfoElem.
The presence of both aliases means that it is possible to retrieve the social security number from both a variable holding a message of messageType txmsg:taxpayerInfo as well as an element defined using txtyp:taxPayerInfoElem.

Global and Local Correlation Sets

You can declare a correlation set for the process as a whole or for a scope. If you declare the correlation set locally for a scope, it is applicable only to the activities in the scope. You can hide a global correlation set by declaring a correlation set of the identical name in a scope.