Detailed workflow: completing the WebSphere MQ Workflow process and merging updated information into a complete business object

The following outlines the solution workflow as a business object passes through the WebSphere® MQ Workflow business review/approval process and is delivered to an ItemCollector collaboration object, where the new information is merged into a complete business object.

Related information

For more detailed process logic behind the steps in this high-level flow, see the following collaboration templates: Also, refer to the Installation guide for detailed information on creating port connections between collaboration objects and between collaboration objects and connectors.

Workflow

  1. The WebSphere MQ Workflow business review/approval process begins when an ItemDispatcher collaboration object passes a Retail_Item to the WebSphereMQWorkflowConnector over its To port through the Retail_Item_to_MQWF_Retail_Item map. At this point, the flow becomes asynchronous. A Retail_Item can contain multiple GLNs.
  2. The WebSphereMQWorkflowConnector builds a WebSphere MQ Workflow container and invokes a specific WebSphere MQ Workflow process. Mapping an item to the business review/approval process and Using WebSphere MQ Workflow containers describe how business objects are mapped into WebSphere MQ Workflow and how process definitions and containers are used in the context of the Product Information Management for Retailers solution.
  3. The approver(s) responsible for approving the item set the item status to Approved, Rejected, Accepted, or Review through a customized user interface with WebSphere MQ Workflow. If an item contains multiple GLNs, the approver must set the status for each GLN in the item.
  4. The WebSphere MQ Workflow process sends the container with the updated status to the WebSphereMQWorkflowConnector. At this point, the WebSphere MQ Workflow business review/approval process is complete and the flow becomes synchronous again.
  5. The WebSphereMQWorkflowConnector maps the container back into a partial Retail_Item business object by passing it through the MQWF_Retail_Item_to_Retail_Item map and invokes an ItemCollector collaboration object. The section Returning data from the business review/approval process to an ItemCollector collaboration object describes how updated information in this partial object is returned to the ItemCollector collaboration object.
  6. The ItemCollector collaboration object accepts the partial Retail_Item business object on its From port and retrieves the complete copy of the Retail_Item that was stored by the ItemValidation collaboration object in the item store database before the review/approval process was started. It retrieves the item by sending the business object and a Retrieve verb to its local_store port to be passed to an ItemStore collaboration object. The ItemCollector collaboration object saves the Retail_Item internals.correlationID value, from the complete copy retrieved from the item store, for use in later processing.
  7. The ItemStore collaboration object receives the business object on its From port and, through a series of interactions with the IBM WebSphere Business Integration Data Handler for XML, retrieves the item from the item store database and returns it to the ItemCollector collaboration object. The section Persisting, retrieving, updating, or deleting an item to or from a local item store describes in detail how a business object is retrieved from the item store.
  8. The collaboration object checks if the original Retail_Item retrieved from the item store database contained cascaded GLNs. Assume for the purposes of this example flow that cascaded GLNs are present. See Merging data into a complete item.
  9. The ItemCollector collaboration object loops through the GLNs, processing each one, as follows:
    1. It retrieves the copy of the Retail_Item that was stored by the ItemDispatcher collaboration object from the item store database by sending the business object and a Retrieve verb to its local_store port to be passed to an ItemStore collaboration object. The key used to access the item is the concatenation of the internals.correlationID attribute value of the original triggering business object and the internals.cascadedGlns.gln attribute value for the GLN being processed.
    2. The ItemStore collaboration object receives the business object on its From port and, through a series of interactions with the IBM WebSphere Business Integration Data Handler for XML, retrieves the item from the item store database and returns it to the ItemCollector collaboration object.
    3. The ItemCollector collaboration object merges the new data received from the WebSphere MQ Workflow process into the Retail_Item business object retrieved from the item store. The section Merging data into a complete item describes in detail how the ItemCollector collaboration object merges the data into a complete item.
    4. The ItemCollector collaboration object then handles the business object according to its status value. Assume for the purposes of this example flow that the status value of the internals.cascadedGlns.item_status attribute is Approved. In this case, the ItemCollector collaboration object routes the merged Retail_Item business object to a Process_Reviewed_Item collaboration object via its To port.
  10. The ItemCollector collaboration object calculates how many total cascaded GLNs have completed processing (i.e., they have Approved, Rejected, or Error status). If all of the cascaded GLNs from the original message that was sent to the ItemDispatcher collaboration object have completed processing, it does the following:
    1. Sets the Retail_Item internals.lastCascadedGLN attribute to true indicating to the UCCnetMessageSend collaboration object that this is the last of the group of cascaded GLNs contained in the original Retail_Item.
    2. Deletes the copy of the Retail_Item that was stored by the ItemValidation collaboration object from the item store database by sending the business object and a Delete verb to its local_store port to be passed to an ItemStore collaboration object. The key used to access the item is the internals.correlationID attribute value of the original triggering business object.
    3. The ItemStore collaboration object receives the business object on its From port and, through a series of interactions with the IBM WebSphere Business Integration Data Handler for XML, deletes the item from the item store database.
This workflow is continued in Detailed workflow: synchronizing a business object to a back-end system.

An ItemCollector collaboration object can be configured to initiate notification if errors are detected during processing. It connects through its email port to a Role_Email collaboration object, which actually controls the e-mail. See Controlling e-mail.

An ItemCollector collaboration object can also log the business object being processed when an error occurs (in addition to the error). A Role_Email collaboration object can log when errors occur and each time an e-mail message is sent. See Logging.

Parent topic: Processing a business object: an example NEW_ITEM workflow