Workflow Programming Step-by-Step (5: State machine Workflow)

Source: Internet
Author: User
Tags final

Introduction to the workflow of a state machine

A state machine workflow consists of a set of states. A state is indicated as the initial state. Each state can receive a specific set of events. Depending on the event, you can switch to another state. The state machine workflow can have a final state. When transitioning to the final state, the workflow completes.

[One] State machine designer view

The state machine Designer is a free-form designer, which means you can move activities freely on the design surface.

The state machine designer has two views:
(1) "Status" view

(2) "Event-driven" view

The Status view displays the status activity and event-driven activities that can be contained within the State activity. In this view, transitions from one state to another are represented by lines, which extend from event-driven activity in one state to another state.

You can also create a transition from a State activity to another State activity by drawing the line yourself. To draw a transformation, select the event-driven activity, and then select a handle on the activity and drag the handle. This action draws a line. This line is then connected to the target state, indicating transitions between states. As shown in the following illustration:

Drag the handle of the event-driven activity inside the diagram's state activity and drag it to the following state activity to get the result as shown in the following figure:

To access the event-driven view, double-click the event-driven activity. The designer that appears is similar to the sequential Workflow designer. At the top of the designer, the navigation bar displays the active hierarchy until the event-driven activity is displayed. You can navigate back to the Status view by clicking any element in the displayed hierarchy. If a transition from one state to another is drawn in the status view, and the event-driven view of the activity is displayed, a set state activity is added to the event-driven activity for you. If you change the properties of a set state activity, it is reflected in the status View.

[Two] state machine workflow Activity

The following table describes the key activities that are used in the state machine Workflow Designer.

Toolbox name activity description
state stateactivity
setstate setstatea Ctivity
stateinitializationactivity
statefinalizationactivity
eventdriven eventd The rivenactivity

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.