Flow
- 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 and approval process starts. 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 complete copy is returned
to the ItemCollector collaboration object on the local_store port.
- The ItemCollector collaboration object obtains the internals.correlationID value
from the original Retail_Item saved in the ItemStore and copies it to the
Retail_Item returned from the approval process. The value is copied into the internals.originalCorrelationID attribute
of the Retail_Item. This value can be used by the Message Manager collaborations
to access a corresponding MessageStore message.
- If configured to do so via collaboration properties, the collaboration
builds a Retail_Audit business object from any optional audit information
included in the Retail_Item retrieved from the item store, and other audit
information specific to the collaboration instance 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 passed along to
the next appropriate port for further processing.
- 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 obtained from the From port into a complete item for a description of how the solution handles business
objects without cascaded GLNs.)
- The ItemCollector collaboration object loops through the GLNs, processing
each one, as follows:
- 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. The copy is returned to the ItemCollector
collaboration object on the local_store port.
- 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. See Merging static data by using the x_COPY ATTRIBUTE configuration properties: and Merging missing data by using the MISSING_DATA_CHILD_ATTRIBUTE configuration property for more information
about merging.
- 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. See Merging data obtained from the From port into a complete item for information on how the collaboration object handles
items with status values of Accepted, Rejected,
and Review.
- The ItemCollector collaboration object calculates how many total cascaded
GLNs have completed processing (that is, 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:
- The ItemCollector collaboration object sets the Retail_Item attribute internals.lastCascadedGLN to true.
This attribute can be used by the Message Manager collaboration to determine
that all of the cascaded GLNs from the original Retail_Item have been processed
and therefore any MessageStore message can now be deleted. If all of the
cascaded GLNs have not completed processing, then ItemCollector sets internals.lastCascadedGLN to false.
- 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.
If error conditions are encountered during any stage of processing, the
ItemCollector collaboration object sets the Retail_Item business object’s
attribute value named in the collaboration object’s configuration property
ITEM_STATUS_ATTRIBUTE to
Error, logs the error, and returns
the object to the calling collaboration object through its From port. The
ItemCollector collaboration object can also log the Retail_Item business object
in the configured IBM
® WebSphere InterChange Server (ICS) log destination
based on the value of the configuration property
LOG_ERROR_ITEM.
Through use of configuration properties, an ItemCollector
collaboration object can be configured to initiate notifications of any error
conditions that are detected during processing. Business objects containing
messages that indicate errors were detected can be passed through the email
port. See Notifying of error conditions for
more information.