Getting Started with the Workflow Engine Kernel

1.
Introduction The groups represented by the three major organizations, WfMC, OASIS, and OMG, continue to debate around BPM-related specifications.
It is really a first-class enterprise selling standards, and a second-class enterprise selling technology. When a new round of technological waves revolves around BPM, relevant international manufacturers first focus on "norms". This specification was first represented by "business process developers" represented by WfMC, who mainly advocated using XPDL as a description language to describe business processes; later, it was represented by OASIS organization and supported by IBM, MicroSoft, BEA. BPEL/BPEL4WS Specifications; later, the OMG organization, which has always been known for its specifications, was not to be outdone. In conjunction with the BPMI organization, it took a unique approach to use the Notation Specification as the entrance, first introduced the BPMN specification, and then introduced BPDM, and also wanted to share a business process description specification.

In the "BPM Think Tank Day" seminar initiated by OMG, BPTrend and BPMI, the representatives and supporters of the three camps are different from each other. Of course, as the organizer, they also take this opportunity to promote their unified vision of BPDM.

Since this Think Tank Day, discussions around BPMN, BPDM, BPEL, and XPDL have continued to heat up on major BPM-related sites. After all, these specifications are supported by the corresponding heavyweight organizations, and there are also corresponding manufacturers supporting and implementing them.

It is a pity that this "normative" battle seems to be far away and has no impact on the country.


Domestic developers are still accustomed to taking it with equanimity, and it doesn't matter which standard is right. In the early years, everyone accepted XPDL; later, when big manufacturers such as IBM and BEA were hyping BPEL, some manufacturers were just around the corner.
2. What is a Workflow Management System (WFMS)
2.1. Overview
When an enterprise conducts business processing, the government conducts the approval of official documents in the form of a process. In the process of informatization, enterprises and governments also informatize the process of these business processing and official document approval. The circulation of these businesses and official documents is handled by hard-coded programs. With the continuous emergence of complex processing situations of business and official documents and the continuous changes in requirements, this hard-coded method is obviously unable to cope. At this time, the workflow management system Came into being, setting off a wave of workflow management system.

So what are the benefits of a workflow management system? The workflow management system divides the constant and changing parts by analyzing and abstracting the business and official document circulation. Users can easily use the visual tools to analyze the process of the matter, the personnel (roles) involved in the process, and the process of the process. The operations of forms and process links are modified, so as to achieve the purpose of responding to changing needs, and the process monitoring and query statistics modules usually provided by the workflow management system provide support for users to optimize the process to a great extent. the efficiency of government work.

This paper mainly describes the usual structure, reference model and scheduling algorithm of workflow management system.
2.2.
Composition Workflow management system, referred to as WFMS, after the analysis and abstraction of the business and document circulation process, the workflow management system solves the three problems of business interaction logic, business processing logic and participants. The business interaction logic corresponds to In the business flow process, the workflow engine, workflow designer, and process operation are correspondingly proposed in the workflow management system to solve the problem of business interaction logic. The business processing logic corresponds to the processing of forms, documents, etc. in the business flow process. In the workflow management system, a form designer and integration with forms are proposed to solve the problem of business processing logic. The participants correspond to the people or programs corresponding to the links in the circulation process. Application integration to solve participant problems.

In order to facilitate the modification of business interaction logic, business processing logic and participants, workflow management systems are mostly implemented by providing visual process designers and form designers. In order to realize the scalability of workflow management systems, most of them provide a series of API.

A complete workflow management system usually consists of eight parts: workflow engine, workflow designer, process operation, workflow client program, process monitoring, form designer, integration with form and integration with application.
2.2.1

. Workflow Engine As the core part of the workflow management system, the workflow engine mainly provides support for the resolution of workflow definitions and process flow. The workflow definition file describes the interaction logic of the business. The workflow engine performs the flow of business according to the interaction logic of the business by parsing the workflow definition file. The workflow engine is usually designed by referring to a certain model, and the process is carried out by scheduling algorithms. The flow of the link (start, termination, suspension, recovery, etc. of the process), through various link scheduling algorithms (SPLIT, AND, OR, etc.) to achieve the flow of links (merging, bifurcation, selection, conditional selection of links) Wait).
2.2.2. Workflow Designer
The workflow designer is a visual process design tool. Users can draw the process by dragging and dropping, and configure the link operations, link forms, and link participants through the configuration of links.

The workflow designer provides users and developers with a way to quickly draw and modify the process. The quality of the workflow designer depends on the ease of use of the workflow management system.
2.2.3. Process operation
Process operation refers to the operations on the process links that are supported, such as starting the process, terminating the process, suspending the process, direct current, shunting (single person handling), parallel flow (multiple people handling at the same time), joint review, etc. , as these process operations can be directly supported based on the link scheduling algorithm provided by the engine, but in actual requirements, it is usually necessary to freely interfere with the process, such as retrieval, rollback, jump, append, Circulation, circulation handling, etc. These process operations are unreasonable for the workflow engine, so they must be implemented separately.

The quality of process operation support directly determines the practicability of a workflow management system.
2.2.4. Workflow Client Program
The workflow client program is the representation of the workflow system, which is usually displayed in the Web mode. It displays the functions of the workflow system by providing to-do lists, completed lists, performing process operations, and viewing process history information.
2.2.5. Process monitoring
Process monitoring provides a graphical way to monitor the process execution process, including the process operation status, the time spent in each link, etc., and through these, the process can be optimized accordingly to improve the performance of the process. work efficiency.
2.2.6. Form Designer The
Form Designer is a visual form design tool. Users can draw the forms required by the business by dragging and dropping, and can bind the form data accordingly.

The form designer provides customers and developers with a way to quickly modify the form. Whether the form designer is easy to use or not and whether the function is perfect or not affects the ease of use of the workflow management system.
2.2.7. Integration with forms

Usually business flow requires forms to express the actual business, so it needs to be integrated with forms to realize business meaning. The integration with forms usually includes automatic acquisition, storage, modification of form data, and permissions of form fields. Control, maintenance of process-related data, and binding of process link forms.

The quality of the integration with the form affects whether the workflow management system can improve the development efficiency.
2.2.8.

Integration with applications The business significance of the workflow management system is improved through integration with applications, which mainly involves the integration with authority systems and organizations. Process links need to be bound to different execution roles accordingly, and process operations usually need to be associated with permission systems and organizations.
2.3. Reference
model Workflow system is usually designed by referring to some standard models, mainly WFMC and OMG, here we mainly introduce WFMC.
2.3.1. WFMC
WFMC is the International Workflow Management Alliance, which was established in 1993 and has released a series of workflow definitions and draft texts of software interfaces. Support and Applications.

On October 25, 2002, WFMC released the final text of XML-based Process Definition Language Version 1.0 (Workflow Process Definition Interface----XML Process Definition Language Document Number: WFMC-TC-1025), as well as the previously released workflow Application software interface specification WFMC-TC-1009, WFMC-TC-1013 and other series of documents constitute the workflow definition and system design standards.

In order to realize the interoperability between different workflow products, WfMC has formulated a series of standards in terms of workflow management system related terminology, architecture and application programming interface. The definition of workflow given by the Workflow Management Alliance is: Workflow refers to the automatic or semi-automation of the whole or part of the business process under the support of computers. In the actual situation, any process whose execution is controlled by a computer software system (workflow management system) can be called workflow more broadly.

A workflow includes a set of activities and their mutual sequence relationship, as well as the start and termination conditions of processes and activities, and a description of each activity. Workflow management system refers to a software system that runs on one or more workflow engines to define, implement and manage workflow operations. It interacts with workflow executors (humans, applications) to promote the execution of workflow instances. , and monitor the running status of the workflow.

WFMC mainly proposes five interfaces together with the workflow execution service to form the workflow system:
*Interface 1 (workflow definition exchange) is used to exchange workflow definitions between modeling and definition tools and execution services. Mainly data exchange formats and APIs. The data exchange is through XPDL, and the API is through WAPI.
*Interface 2 (workflow client application interface) is used for the workflow client application to access the workflow engine and work list through WAPI.
*Interface 3 (the called application interface), used to call different application systems.
*Interface 4 (workflow system interoperability interface), used for interoperation between different workflow systems.
Interface 5 (system management and monitoring) is used for system management applications to access workflow execution services.
2.4. Core Scheduling Algorithms
Generally , the core scheduling algorithms used by the process engine mainly include FSM and PetriNet, which complete the flow of processes based on the scheduling algorithms.
2.4.1. FSM (Finite State Machine)

FSM is defined as including a set of states (states), a start state (start state), a set of input symbols (alphabet), a mapping input symbols and the current state to the next A computational model of the transition function of a state. When a string of symbols is entered, the model enters the starting state. To change to the new state, it depends on the transition function. In a finite state machine, there will be many variables, for example, a state machine with many actions associated with actions transitions (Mealy machines) or states (Moore machines), multiple starting states, transitions based on no input symbols, Or specify multiple transitions of symbols and states (indeterminate finite state machines), one or more states assigned to receiving states (identifiers), and so on.

Follow the FSM process engine to complete the flow of the process through state switching.
2.4.2.

An abstract, formal model of PetriNet information flow. Indicate the static and dynamic properties of a system. petrinet is usually represented as a graph. Follow the PetriNet process engine to decide the flow of the process through the token.

Note 1:
At present, the modeling tools of some large-scale and distributed workflow systems in foreign countries adopt the graphical modeling method based on Petri nets.
Note 2:
Petri Net Tool
3. Explain what workflow description language and basic elements are through XPDL
3.1. Introduction to basic elements of XPDL
Package element
DataField element
WorkflowProcess element
Activity element
Implementation element
Tool element
TransitionRestricti
4. jPdl specification
5. bpel specification 5.1.1
.
Business Process Execution Language for Web Services (BPEL or BPEL4WS) is a language for defining and executing business processes using Web services. BPEL enables you to implement Service-Oriented Architecture (SOA) top-down by composing, orchestrating, and coordinating Web services. BPEL provides a relatively simple and understandable way to combine multiple Web services into a new composite service called a business process.

This article shows how to create a sample business process that combines a series of virtual, travel-related web services and deploy it to the Oracle BPEL Process Manager runtime environment.

First, some background knowledge. BPEL is built on XML and Web services; it uses a Web-based language that supports a family of web services technologies including SOAP, WSDL, UDDI, Web Services Reliability Messaging, Web Services Addressing, Web Services Orchestration, and Web Services Transactions .


A BPEL process specifies the exact order of invocation of participating Web services - either sequentially or in parallel. Using BPEL, you can express conditional behavior. For example, the invocation of a web service can depend on the value of the last invocation. You can also construct loops, declare variables, copy and assign values, define fault handlers, and more. By combining all these constructs, you can define complex business processes in the form of algorithms. In fact, since business processes are essentially activity diagrams, it may be useful to represent them using Unified Modeling Language (UML) activity diagrams.

Typically, a BPEL business process receives a request. To satisfy the request, the process invokes the relevant web service and then responds to the original caller. Since a BPEL process communicates with other web services, it relies heavily on the WSDL of the web service invoked by the composite web service
5.1.2. How to build a business process
BPEL process specifies the exact order of invocation of participating web services - sequentially or in parallel. Using BPEL, you can express conditional behavior. For example, the invocation of a web service can depend on the value of the last invocation. You can also construct loops, declare variables, copy and assign values, define fault handlers, and more. By combining all these constructs, you can define complex business processes in the form of algorithms. In fact, since business processes are essentially activity diagrams, it may be useful to represent them using Unified Modeling Language (UML) activity diagrams.

Typically, a BPEL business process receives a request. To satisfy the request, the process invokes the relevant web service and then responds to the original caller. Because the BPEL process communicates with other Web services, it relies heavily on the WSDL description of the Web service invoked by the composite Web service.

Let's look at an example. A BPEL process consists of multiple steps, each called an "activity". BPEL supports primitive and structural activities. Primitive activities represent basic constructs for common tasks such as:
* Calling other web services using
* Use (receive request) to wait for the client to invoke the business process by sending a message
* Use to generate a response for a synchronous operation
* Use to manipulate data variables
* Use to indicate failures and exceptions
* Use to wait for a period of time
* Use to terminate the entire process.

We can then combine these primitive activities, along with other primitive activities, to define complex algorithms that specify exactly the steps of the business process. For combining primitive activities, BPEL supports several structural activities. The most important of these are:


* sequence(), which allows to define a set of activities that will be invoked in sequence.
* Stream(), used to define a set of activities that will be called in parallel
* Case-switch construct(), used to implement branches
* While(), used to define loops
* Use one of multiple alternative paths to be selected.

Each BPEL business will also use Define Partner Links, using Declaration Variables.

To understand how BPEL describes a business process, we'll define a simplified business process for employee travel scheduling: the client invokes this business process, specifying the employee's name, destination, departure date, and return date. This BPEL business process first checks the employee travel status. We will assume that there is a web service that can be used to perform such checks. This BPEL process will then check ticket prices for two airlines: American Airlines and Delta Air Lines. Again, we'll assume that both airlines offer web services that can be used to perform such checks. Finally, this BPEL process will select the lower price and return the travel plan to the client.

Then, we'll build an asynchronous BPEL process. We'll assume that the Web service used to check employee travel status is synchronous. Since this data can be obtained immediately and returned to the caller, this is a reasonable approach. To get airfare prices, we use an asynchronous call. This is also a reasonable approach since it may take a little longer to confirm the flight schedule of the aircraft. To simplify the example, let's assume that both of the above airlines provide web services and that both web services are identical (ie, provide the same port types and operations).

In practice, you often have no choice but to use the services provided by your partners. If you are fortunate enough to be able to design both Web services and BPEL processes, you should consider which interface is better. Typically, you will use an asynchronous service for operations that are long in duration, and a synchronous service for operations that return results in a relatively short period of time. If asynchronous web services are used, the BPEL process is usually asynchronous as well.

When you define a business process in BPEL, you are actually defining a new Web service composed of existing services. The interface of this new BPEL composite web service uses a set of port types to provide operations like any other web service. To invoke a business process described in BPEL, the resulting composite Web service must be invoked.


Technical Analysis and Market Forecast of Three Mainstream Workflow Engines
1 . Speaking of "Kung Fu", when the new and new people see me, they will definitely think that I am a complete antique. No, I won't watch movies like "Kung Fu" until the end of February this year. But after watching "Kung Fu", I must have thought more than the average person: Zhou Xingxing

wandered , and when he went out to knock bamboo poles with his fat big brother, why did he want his big brother to draw two axes on his chest? Find a fake backer! People who pretend to be the Axe Gang will not be bullied.


This reminds me of a news from years ago: jbpm joins jboss and becomes jboss-jbpm. That is to say, jbpm has found a backer jboss, so you don't have to wander outside by yourself in the future.


Well, let's turn to the topic and talk about the three mainstream open source workflow engines mentioned here: Shark, osworkflow, and jbpm.


Shark's backer is Enhydra. What does Enhydra do? too much! From the j2ee application server, to the o/r mapping tool, to this workflow engine and more. Why is Shark's persistence layer implemented with DODS? Just because they are family.


The backer of Jbpm is jboss. The persistence layer of Jbpm3 is implemented by hibernate3, which is also for this reason. The graphical process definition of Jbpm3 has been decided to be embedded in the jboss eclipse IDE. Let's take a look at the jboss eclipse IDE preview version 1.5. We can already edit a jbpm3 process definition file by means of a plug-in.


The backer of Osworkflow is opensymphony. I really like this organization, it does a lot of good stuff. When developing a workflow management system, I recommend another thing: webwork2. The open source workflow engine AgileFlow hosted by the author is based on the ww2+spring+hibernate architecture.


When completing this paragraph, I will say a digression: Now basically all J2EE application servers have their own workflow engines, such as Enhydra, jboss mentioned above, and websphere and weblogic that are not mentioned. It can be seen that learning the workflow engine Technology is indeed very important.


2.
Tathagata 's Palm, it's not enough to have a backer. Zhou Xingxing joined the Axe Gang, and he was beaten by the evil god? To save yourself, you still have to rely on the Tathagata's palm.


Shark's process definition language is XPDL. We know that the two most important concepts of XPDL are Process and Activity. Activity in XPDL is based on the concept of activity diagram in UML1.x. Activity diagram is naturally suitable for workflow modeling. One of its biggest advantages over state diagram is that it is easy to fork control of concurrent threads. These concurrent threads can be executed simultaneously or sequentially; it also has the advantage of swimming lanes The concept that can control the generation of tasks in the workflow engine. Shark's Tathagata Palm is an activity map.


What is the Tathagata Palm of Osworkflow? We know that it has an important concept of State... Oh, we know, its Tathagata Palm is FSM. Don't know what FSM is? ? Then you are definitely not a good student when you are in college; of course, it doesn't matter if you don't know, you can understand it as a state diagram. State in Osworkflow is jointly expressed by step and status. A State is a status in a step; and state transitions are driven by actions, similar to events in state diagrams, because an event corresponds to an action.


Jbpm's Tathagata Palm is not as simple as the above. It combines the knowledge of state diagram + activity diagram + PetriNet, and the activity diagram here is still UML2.0 version. In the activity diagram of UML2.0, the node is not called an activity (Activity) but an action (action), and an activity has become a high-level concept, which includes an action sequence. An activity diagram shows a series of actions that make up an activity. Jbpm also renamed action, called state. The concept of state diagram used by Jbpm includes transition/event, etc. Let's see it yourself. Jbpm also uses the concept of PetriNet in its internal implementation, such as token, signal, etc. What? Don't know what PetriNet is? Did you study computer science in college? no? Then you may be a liberal arts major, and majors such as mechanical/electrical/civil engineering/transportation have contacted PetriNet courses. If you haven't studied it, you should take a look at jbpm. Anyway, we don't do theory, just know the general concept.


3. Forecasting the market is a thankless task. Many foreign masters have also been criticized for their predictions... Fortunately, the predictions I made in "The Great Situation of Workflow" in the middle of last year were basically correct. My prediction at the time was: Shark...will be number one. It should be said that before the article was published, osworkflow was the most widely used workflow engine in China; by the end of last year, Shark had an obvious dominant position. I analyzed the reasons for the following:


1) Domestic enterprises are interested in XPDL , because it means that in the product specification, you can boast that "We follow WFMC..."


2) Because I consider myself "the main promoter of Shark workflow engine in China", most of them give me feedback on the development and selection of workflow management system All technical friends use Shark


3) Shark is indeed a good workflow engine. Even if you just want to learn XPDL, you can start by learning Shark.


Now it's time to start from feudalism as mentioned in "The Great Situation of Workflow" The era of social transformation to capitalism, and it is none other than the above-mentioned jbpm that drives this transformation. Jbpm3 will release the alpha version in March, and the final version of jbpm3 will support the core parts of bpel4ws. Therefore, I estimate that Shark will be kicked out of the first throne by jbpm3 after leading the show for hundreds of days. The author's open source agile workflow development framework, AgileFlow, will integrate jbpm3 and provide support for agile engine and jbpm3 engine.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326987381&siteId=291194637