Describes the overall process logic of the ItemDispatcher collaboration
template.
Logic flow for the Create verb
- The ItemDispatcher collaboration object is triggered by the receipt of
a Retail_Item business object on its From port.
- The ItemDispatcher collaboration object examines the business object to
see if it contains cascaded GLNs and then directs processing, as follows:
- If no cascaded GLNs exist, the business object is sent through the To
port to the WebSphere® MQ Workflow process, and processing by the ItemDispatcher
collaboration object ends.
- If cascaded GLNs do exist, the collaboration object continues processing
the item.
Assume for this example workflow that cascaded GLNs do exist.
- The ItemDispatcher collaboration object checks if a filename exists in
its GLN_CASCADE_GROUPING_FILE property and directs processing, as follows:
- If this property is empty, the collaboration object uses the value of
the GLN_CASCADE_GROUPING_DEFAULT configuration property to guide on-going
processing.
- If a filename exists, the collaboration object verifies that the file
exists and parses correctly. Based on the results of this check, it guides
processing, as follows:
- If the file exists and parses correctly, the collaboration object continues
processing the item.
- If the file does not exist or does not parse correctly, the collaboration
object raises an exception, sends the business object to the Notify port with
appropriate error attributes filled in, and processing ends.
Assume for this example workflow that a filename and file exist and that
the file parses correctly.
- The ItemDispatcher collaboration object checks if the RetailUtility class
file specified in its UTILITY_CLASS property exists. It then directs processing,
as follows:
- If a file exists, the collaboration object continues processing.
- If a file does not exist, then the collaboration object raises an exception,
sends the business object to the Notify port with appropriate error attributes
filled in, and processing ends.
Assume for this example workflow that a file exists.
- The ItemDispatcher collaboration object uses the information in the file
specified in its GLN_CASCADE_GROUPING_FILE property to determine the appropriate
grouping of the cascaded GLNs.
- For each cascaded GLN that was determined in Step 5, which will be sent
to the WebSphere MQ
Workflow process, the ItemDispatcher collaboration object creates one copy
of the Retail_Item business object. It removes the extra cascaded GLNs from
each copy and sends each through its LocalItemStore port with a Create verb
to an ItemStore collaboration object to be stored in the item store. The key
used for each new item is the concatenation of the internals.correlationID
attribute value of the original triggering business object and the internals.cascadedGlns.gln
attribute value of the newly created business object.
- The collaboration object creates a new copy of the triggering Retail_Item
business object for each group, removing extra cascaded GLNs that do not belong
in the group from each Retail_Item.
- The Retail_Item business objects are sent through the To port to the WebSphere MQ
Workflow process for approval.
- The original Retail_Item business object is updated with the number of
cascaded items sent to the WebSphere MQ Workflow process and is then
sent to the LocalItemStore port with an Update verb to an ItemStore collaboration
object so that the item is updated in the item store.
- Whether cascaded GLNs are present or not, if configured to do so by the
collaboration properties, the collaboration builds a Retail_Audit business
object from any optional audit information included in the triggering business
object and other audit information specific to the collaboration instance
and the Retail_Item being processed and sends the Retail_Audit object to the
Audit port. The audit data, including any changes made by the external audit
process, is appended to the Retail_Item and sent to the To port.
An ItemDispatcher collaboration object can be configured to initiate
notification if errors are detected during processing. It connects through
its Notify port to a Role_Email collaboration object, which actually controls
the email. An ItemDispatcher collaboration object can also log when errors
occur.