A state model can include up to five types of states, which are described below. This section also provides detailed information about state timeouts.
Most of the state types described below only allow exclusive-or (XOR) transitions, which go to one state only. To allow a state to go from one state to multiple states, use a concurrent state.Within each state machine is a start state and an end state. Each start state has an exit action, but no entry action. Each end state includes an entry action but no exit action.
Composite states are like nested folders: they contain other states. For example, consider a state model for an order instance: the order instance may need to travel through complex credit check and fulfillment processes. You can group the complex credit-check process in one composite state and the order-fulfillment process in another composite state.
Use a composite state if you want to ensure that all states within a particular group of states process successfully before continuing. If one member state within a composite state fails, the composite state also fails.Composite states can contain simple states, other composite states, and concurrent states.A concurrent state allows multiple state flows to operate at one time. A concurrent state has multiple processing lanes, called regions. A state machine instance cannot exit a concurrent state until all its regions have finished processing, unless a timeout occurs. A region of a concurrent state can contain a composite state.
1. Select the Start state icon in the design panel.
2. Select the Actions tab.
3. Click the rules editor icon () to the right of the Exit Action field.
4. Create an exit action in the Actions panel.
5. Click Apply to save your work.Except start and end states, each state within a state machine has its own timeout setting and timeout action. Use the Timeout tab to specify the wait time, the timeout action, and the timeout state.When a timeout occurs, in addition to the timeout action, BusinessEvents can do one of three things:
− Go to all of the possible next states and wait until a simple event arrives that establishes the next state.To configure the timeout behavior, select one of the following options for the timeout State field:
● Specified: — To specify a timeout state, select this option and browse for the desired state. You can specify any top-level end state and any state that has the same parent as the state you are configuring.
● Current — Select this option to remain at the current state.
● All — Select this option to have BusinessEvents prepare to go to any possible next state. When a simple event arrives that clarifies the correct next state, BusinessEvents goes to that state.
For regions within a concurrent state, select the Current state option.If a state does not receive the expected event within the time period specified, the state times out and BusinessEvents executes the timeout rule.The state machine as a whole has a time out that limits the time that BusinessEvents spends in a state machine instance. The state machine timeout takes precedence over the timeout of the current state.Similarly, the timeout of composite states takes precedence over the timeouts of their member states.
Explicitly Delete Concept Instances when a State Machine Ends Unlike events, concept instances are not automatically deleted from working memory when a state machine ends. You must explicitly delete concept instances in your rules, using Instance.deleteInstance().
Copyright © TIBCO Software Inc. All Rights Reserved.