Refined workflow Status Management

Source: Internet
Author: User
A workflow engine based on a finite state machine is a flow of processes by changing the workflow state. Therefore, the concept of various states in the workflow system is obviously very important. First, the workflow engine defines a place for business processing as a step node when modeling a business process, and then submits the business when processing the business.

A workflow engine based on a finite state machine is a flow of processes by changing the workflow state. Therefore, the concept of various states in the workflow system is obviously very important. First, the workflow engine defines a place for business processing as a step node when modeling a Business Process. Then, when processing the business, it submits the business

A workflow engine based on a finite state machine is a flow of processes by changing the workflow state. Therefore, the concept of various states in the workflow system is obviously very important.

First, the workflow engine defines a place for business processing as a step node when modeling a business process, "Submit the business processing result" to transfer the process. Which of the following is the next step, which is directed by the action result line.

When a flow occurs in the workflow system, the workflow state changes. That is, the State in the finite state machine is promoted, and the process instance is promoted from one State to another by executing the action.

We usually understand that A flow occurs from step A -- step X, but if A flow is A step A -- step A, it seems that the flow has not occurred, what happened? From the concept of the workflow state, it must have been a flow.

Workflow status = current step + current step status

When A flow occurs in A workflow, the Process status is promoted once. When step A -- "X" changes, the status is definitely promoted. When step A -- "step A, the status of Step A must be changed; otherwise, it will be meaningless. Step A -- "step A also needs to be completed by executing an action. If the status of Step A does not change after execution, no need to design this action, you can save only the business data of the business module.

There are usually one or more active states in the lifecycle of a workflow instance. If the workflow runs in a single line, the status of the current step + current step is displayed. When there is a parallel node, there will be multiple current steps + the status of the step.

The status of the step. We can preset several statuses. The step is in progress, waiting for processing, complete, and return for processing. These statuses have nothing to do with the business. They only describe the status of the step.
The status of Step A can be changed. For example, when step A is started, the process is in progress. when too many tasks need to be handled, the process is promoted to wait for processing. When step A is left, the status of the step is complete, the next step is in progress. Therefore, when defining a process, the status of the step is defined as in progress, and the exit is defined as complete, so that we can easily understand the flow of the process and make it irrelevant to actual business processing.


Process instance status: creation, activation, suspension, termination, and completion. This is another important concept in the workflow engine and describes the status of the process instance.
Create: when the process instance is created.
Activation: instance status when the flow is normal
Suspension: when the business needs to suspend the handling of this business, the suspension process is executed by the administrator or authorized management users. When other problems are solved and you need to continue to execute the flow, the process can be restored to activation or terminated directly.
Termination: When a business problem or exception occurs, an administrator or authorized user can directly terminate the process. The process after termination cannot be resumed to normal.
Finished: after the business process is completed, the process instance state is reached.


When the process instance status is suspended, the process instance can no longer flow, and the task cannot continue to be executed, and the task status is also suspended. After the process instance status is restored, the task can continue to be executed. You must know that the task in the workflow system is completed by the action of the execution process, that is, the business module attached to the submission action to complete the task. Therefore, the workflow instance is in the pending state, and the task is also suspended. After the workflow instance is restored, the task is resumed to the waiting state. After the workflow instance is terminated, the task is terminated abnormally, and the workflow instance is completed normally, all tasks associated with the instance are also completed normally.


Its nuances reflect success or failure. Its rigorous state management reflects the quality of workflow software products.

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.