Author: Cheng Wangrong, vivo Internet Server Team This article analyzes the background of introducing workflow technology into marketing automation business and the introduction of workflow engines. It also introduces the characteristics of several popular open source workflow engines in the industry, as well as the design ideas and summary thoughts during the project's self-developed development process. 1. Business BackgroundThe marketing automation platform can support the configuration of activity journey strategies for different user life cycles, and carry out differentiated marketing reach plans based on different activity behaviors triggered by users. At the same time, there are different business processing procedures (such as approval procedures and business flows) in the specific execution of various types of activities. The business processes are complex and diverse, and the requirements change frequently. There will be the following pain points during project development:
How to separate business logic from control flow and let production and research personnel focus more on business realization is a key issue that needs to be solved. The traditional OA field uses the time-tested business process management solution - Workflow. Workflow is an industrial-grade solution, and a series of standards have been formulated by the Workflow Management Consortium (WfMC). 2. Workflow Introduction2.1 Workflow DefinitionWorkflow - abstracts the business rules between the workflow and its various operation steps, models the work organization logic and rules in the process, and lets the computer perform automatic processing. The essential idea of workflow is to instantiate real activities through predefined workflow templates. In simple terms, it is to configure a process template (such as a running process template for sharing activities) through a preset format or visualization, and then construct a process instance object through the template when using it, and complete the activity operation tracking and backtracking through the instance object. 2.2 Workflow Reference ModelThe WfMC Workflow Management Alliance has developed a reference model for workflows, the core of which is the workflow engine in the middle. The workflow engine provides process definition tools (interface 1), provides users with information query (interface 2), calls external applications (interface 3), integrates other workflows (interface 4) and monitors and manages (interface 5). For most workflow products, the focus is on the implementation of interface 1 and interface 2. 2.3 Key Features of Workflow Engine
2.4 Types of Workflow EnginesThere is no specific standard for the types of workflows. According to the characteristics of the process task nodes, they can be divided into:
It can be seen that different types of workflows are not completely separated. The state machine workflow can also combine conditions and rules to perform the process of operating node conversion. In software development, it is generally considered to combine state machines and rule-driven workflows. 2.5 Differences between Workflow Engines and State MachinesIn the previous article, we made a simple comparison between state machines and workflow engines. In fact, the two are not completely equivalent concepts:
After understanding the basic characteristics and usage scenarios of workflow, let's take a look at the more popular open source workflow engines. 3. Open Source Workflow Engine 4. Self-developed design of workflow engine4.1 Problems with using open source workflow engines
4.2 Core Design Ideas of Self-developed Engine4.2.1 Engine core moduleReturning to the essence of workflow, workflow is the process of instantiating real activities through predefined process templates. A basic workflow engine mainly consists of three core parts:
4.2.2 Engine Core Design① When the application container starts, the process engine environment configuration is loaded, including the parser structure, process engine context, process definition file path, etc. ② Read the specified process definition file, parse the process nodes, build the execution context, and put the process nodes into the memory cache. ③ The business side creates a process, starts a new process instance, and binds the business process and the process instance. ④ Run each node of the process instance and save each process node persistently. 4.3 Specific Practice① Engine core services. The main external interface for engine operations includes starting process instances and obtaining services for related process definition templates, process instances, and process nodes. public interface FlowEngine { ② Process definition service. It is mainly aimed at the creation and publishing of process definition templates, and can support different creation methods according to the specific implementation class. public interface ProcessService { ③ Process instance service. Provides an entry point for process instance creation, persistence, and process instance execution. public interface InstanceService { ④ Process task node service. Provides creation and query of each specific task of the process node. public interface TaskService { The core method is
4.4 Thinking and Extension
V. ConclusionThis article analyzes the background of introducing a workflow engine, driving the business logic out of the control flow, allowing the R&D team to focus more on the business and solving the problem of low R&D efficiency. The essential idea of workflow is to instantiate real activities through predefined workflow templates. Generally, it is necessary to have the basic capabilities of process visualization, business orchestration and reuse, and separation of business and control. Common workflows are divided into sequential workflows, state machine workflows, and rule-driven workflows. The most common open source workflow framework is the state machine workflow, which uses event-driven methods to drive the process operation. At the same time, we briefly introduced the characteristics of several popular open source workflow engines in the industry. Combining the characteristics of open source workflow engines, and targeting diversified and frequently iterated business processes, we took the essential idea of workflow as the starting point and developed a lightweight workflow engine. We also shared the design ideas and summary thoughts in the practice process. |
<<: vivo official website APP full model UI adaptation solution
>>: Kotlin memory optimization from a compilation perspective
Who is the leader in the smart wristband market? ...
A complete analysis of the Kuaishou information f...
My name is Pai Gu. Many people have heard of me. ...
This article contains some useful information , b...
[[161294]] This article mainly talks about indust...
An unreasonable operation plan and poorly impleme...
Lang Shuai's A-share Devil's Dictionary - ...
The main product model of Internet finance is rel...
Bandwidth is the most important and critical link...
Preface Beiliao currently develops two apps, Beil...
NO.1 Corporate self-media is job self-media, not ...
What should I do if the live broadcast room has i...
I often see this question on Souwai Q&A, Zhih...
Adjusting keywords every day is a necessary task ...
This time we will talk about how to increase dail...