Composite Workflow States: To Update a Composite State
This activity will walk you through the process of adding a nested workflow state to a composite state of a predefined workflow.
Story
Suppose that you need to implement the following behavior on the Invoices (SO303000) form:
- If a user specifies a discount for an invoice, you want this invoice to be reviewed and the discount to be approved before the user can proceed with processing the invoice. The invoice with the discount on review should have the Postponed status. After the discount is approved, the system specifies the business date in the Cash Discount Date box.
- If the user does not specify any discount, the invoice does not obtain the Postponed status.
On the Invoices (SO303000) form, the default
workflow includes a composite workflow state with multiple nested workflow states.
To implement the described behavior, you need to add a new workflow state,
Postponed
, to the composite state after the workflow state that
corresponds to the Credit Hold status of an invoice.
You also need to specify a skip condition for the new workflow state and add a transition from this workflow state to the next state in the workflow. The skip condition will check for no cash discount being applied to the invoice.
Process Overview
In the extension of the predefined workflow for the Invoices (SO303000) form, you will implement an action (and the corresponding button on the form toolbar and command on the More menu) that will trigger a transition from the new state. You will also add a nested workflow state, specify a condition that the system will use to skip this state, and then add a transition from this state to the next nested workflow state.
System Preparation
Make sure that you have done the following:
- Prepared an instance with the PhoneRepairShop customization project and enabled the workflow validation by performing the following activities:
- Prepared the screen configuration and defined the set of workflow states by performing the Screen Configuration: To Prepare a Screen Configuration for a Form Without a Predefined Workflow activity.
- Created an extension of the predefined workflow for the Invoices (SO303000) form, as described in the Workflow Customization: To Add an Action to an Existing Workflow prerequisite activity.