Composite States: General Information
This topic provides information about composite states in workflows in MYOB Acumatica.
Learning Objectives
In this chapter, you will learn what a composite state is and how to modify it in an inherited workflow.
Applicable Scenarios
You use composite states if you want to specify common settings for a group of states in your workflow.
Composite States in Workflows
A composite state, which can also be referred to as a parent state, is a state that contains an ordered sequence of nested states and the transitions to and from these states. With composite states, you can specify common settings (actions, fields to be updated, and transitions) for a group of states only once—in the composite state that includes these states.
For each of the states inside the composite state, you can do the following:
- Specify whether this state should be skipped by using a skip condition
- Specify a transition to the next state inside the composite state instead of a transition to a specific state
- Specify a transition to the state that is the next one after the composite state if this composite state is itself a nested state in another composite state
- Override the settings inherited from the composite state, if needed
These capabilities make workflow customization much easier. You do not need to explicitly specify target states for transitions. Thus, if you add or remove states in the workflow or change the order of states, you do not need to modify all the affected transitions.
A record created on a form cannot be in a composite state; it can only be in one of its nested states. When a record enters any nested state in a composite state, the system checks the skip condition specified for this state, if one has been defined. If the condition is fulfilled, the system does the following for the current state:
- Assigns the default values for the fields as specified on the State Properties tab of the Workflow (Tree View) page for the form if the current state is the initial state of the workflow
- Does not check the fields that should be updated when the record enters the state and leaves it
- Does not check any of the workflow settings, and moves the record to the next state inside the composite state
If no skip condition is specified, the system uses the typical workflow for this state. This means that the transitions are triggered only by actions or event handlers, and the system does not check the skip condition again while the record remains in this state.
Creation of a Composite State
To add a composite state, you first add a new or a predefined state, and then specify a parent state for it in the Change Parent State dialog box, which is available on the Workflow (Tree View) page of the Customization Project Editor.
Example of a Composite State
The screenshot below shows the default workflow of the Invoices (SO303000) form on the Workflow (Tree View) page of the Customization Project Editor. The
composite state (see Item 1 in the screenshot) contains nested states (Item 2) that are part
of a typical invoice workflow, as well as transitions (Item 3) to and from the composite
state and the nested states. Notice that the Balanced
nested state also
contains transitions (Item 4).