To accept or reject an item based on existing business policies, insert customized code into the ItemValidation collaboration template's Business Policy Processing subdiagram.
Enable the logic in this subdiagram to execute for specific commands attached to a Retail_Item by specifying those commands in an ItemValidation collaboration object's BUSINESS_POLICY_CMDS configuration property.
The pre-existing subdiagram logic examines the value for the Retail_Item business object's attribute named in the ItemValidation collaboration object's ITEM_COMMAND_ATTRIBUTE configuration property against the values specified in its BUSINESS_POLICY_CMDS configuration property. If the value for the attribute in the ITEM_COMMAND_ATTRIBUTE property is specified in the BUSINESS_POLICY_CMDS property, the ItemValidation collaboration object executes the customized code in the Business Policy Processing subdiagram.
The rules in the customized code must specify whether the Retail_Item is accepted or rejected for subsequent processing by changing the value of its attribute named in the ItemValidation collaboration object's ITEM_STATUS_ATTRIBUTE configuration property. If the item is accepted, the code must change the value of the business object attribute to Review; if the item is rejected, it must change the value to Rejected. The pre-existing subdiagram logic uses this attribute value to determine whether to return the item to the caller or to continue processing it. If the item is rejected, the business policy subdiagram raises an exception to abort the item processing and returns it to the main scenario, where the item rejection processing is handled.
Parent topic: Validating an item before business processing