Correlation Service
Service description (taken from the Sterling Commerce documentation):
Adds a record to the correlation table to enable you to track a document or business process.
Collects the information for a specific name and value pair from either documents that pass through a business process, or from the business process itself. The correlation name and value pairs are saved in the correlation table.
Configuration parameters description (taken from the Sterling Commerce documentation):
Field |
Description |
Config |
Name of the service configuration. Required. |
NAME |
Name associated with this correlation. For example, PONUMBER. |
Object_ID |
ID of the document or business process that correlates with a specific name/value pair. Generally, this field is left blank. |
Type |
The information this correlation will track. Valid values are Document and Business Process. |
Value |
Value of the correlation. For example, a purchase order number such as 12345. |
BP used for test:
<process name="default">
<sequence name="Sequence Start">
<assign to="PurchaseOrderNumber">32</assign>
<operation name="Correlation Service">
<participant name="CorrelationService"/>
<output message="CorrelationServiceTypeInputMessage">
<assign to="." from="*"/>
<assign to="TYPE">DOCUMENT</assign>
<assign to="FOR_UPDATE">true</assign>
<assign to="OBJECT_ID" from="string(substring-before(PrimaryDocument/@SCIObjectID,':')"/>
<assign to="VALUE" from="PurchaseOrderNumber/text()"/>
<assign to="NAME">PurchaseOrderNumber</assign>
</output>
<input message="inmsg">
<assign to="." from="*"/>
</input>
</operation>
</sequence>
</process>
Test results (different combinations of options for TYPE, OBJECT_ID parameter and PrimaryDocument):
I tested it and seems object_id can be taken from SCIObjectID attribute when you have a PrimaryDocument in the process, but without Primary Document you will get „Mandatory parameters for the service are invalid or missing.“
The result of my test is:
1.
TYPE -> DOCUMENT
OBJECT_ID -> N/A (empty)
PrimaryDocument -> N/A
Correlation service will throw the error „Mandatory parameters for the service are invalid or missing.“, and correlation will not be written.
2.
TYPE -> DOCUMENT
OBJECT_ID -> N/A (empty)
PrimaryDocument -> Available
Correlation is written, search of correlation will show Document Name that is null (with link), Business Process also with link.
3.
TYPE -> DOCUMENT
OBJECT_ID -> constant (e.g. objectId)
PrimaryDocument -> N/A
Correlation is written, search of correlation will show DocumentName that is objectId (Archived/Purged) (with link), but Business Process field is EMPTY!!!
4.
TYPE -> DOCUMENT
OBJECT_ID -> constant (e.g. objectId)
PrimaryDocument -> Available
Correlation service finishes without error, but I cannot find that new correlation in result of search of Correlations.
******************************************************************
5.
TYPE -> BUSINESS PROCESS
OBJECT_ID -> N/A (empty)
PrimaryDocument -> N/A
Correlation can be found when clicking on link of correlation (BP Monitor for all the processes containing correlations will be shown)
6.
TYPE -> BUSINESS PROCESS
OBJECT_ID -> N/A (empty)
PrimaryDocument -> Available
Correlation can be found when clicking on link of correlation (BP Monitor for all the processes containing correlations will be shown)
7.
TYPE -> BUSINESS PROCESS
OBJECT_ID -> constant (e.g. objectId)
PrimaryDocument -> N/A
Correlation will not be written!!!! Although there is no error in the service. Seems OBJECT_ID should not be defined when TYPE is BUSINESS PROCESS.
8.
TYPE -> BUSINESS PROCESS
OBJECT_ID -> constant (e.g. objectId)
PrimaryDocument -> Available
Correlation will not be written!!!! Although there is no error in the service. Seems OBJECT_ID should not be defined when TYPE is BUSINESS PROCESS.
9.
TYPE -> BUSINESS PROCESS
OBJECT_ID -> constant (e.g. Xpath ... string(PrimaryDocument/@SCIObjectID))
PrimaryDocument -> N/A
Correlation is written and found by search.
10.
TYPE -> BUSINESS PROCESS
OBJECT_ID -> constant (e.g. Xpath ... string(PrimaryDocument/@SCIObjectID))
PrimaryDocument -> Available
Correlation will not be written!!!! Although there is no error in the service.
My conclusion:
NAME and VALUE parameters in all the options are always the same.
Seems options 2, 5, 6 and 9 really write the correlation and returns result of search by all the values populated.