Eighth ACIS International Conference on Software Engineering, Artificial Intelligence, Networking, and Parallel/Distributed Computing
The Design and Implementation of XML-based Workflow Engine JIN Xin, XU Jing and LI Xuemeng Institute of Machine Intelligence, Nankai University Nankai University, Tianjin 300071, China
[email protected] workflow logic[2,3].
Abstract – This paper brings up a design of XML-based workflow engine and gives an implementation of a web-based
How to control and manage a workflow? This is the main
workflow management system. Workflow is the automation of
content of the conception of Workflow Engine. Workflow
business procedures and workflow engine is the key part to carry
engine offers the environment that a workflow instance need
out the system. Workflow engine can supply the conditions needed
for execution. It can explain the process model, control the
for executing a workflow process. This paper focuses on the
process instances, explore the activities of a process, offer the
workflow
(XML-based
participants to join and exit, build a work to notify the users of
Workflow Process Definition Language) that we designed and the
handling operation, maintain the data of workflow controlling
implementation of the engine. All of the workflow processes that
or some other correlation, evoke other application and access
our engine operates are all described by X-WPDL. The engine
the workflow data[3,6]. Apparent, workflow engine is the only
translates the workflow process into an execution sequence that is
way to implement workflow management.
description
language[1,5]—X-WPDL
consist of events or activities, then loads it in and drives it to run.
Workflow engine should work with an associated
The engine also offers an interface for the manager and participants
workflow description language. This paper also presents a
for interaction. The application case will show that our
XML based description language—X-WPDL. It can describe a
implementation of this engine and the whole system is capable of
workflow very well. According to the grammar of this
processing workflow.
language, our design of the workflow engine has a key module that calls “Node handling Module” for processing that
Index Terms - Workflow; Workflow engine; Workflow
structure “node” that this language defined. Finally, we
management system;
implement the entire workflow management system that has good expandability with a B/S model. It’s already applied in an
1
enterprise that has a great deal of software testing work and
Introduction
implements their office automation of software testing. The or
following of this paper will give a detail description of the
automation of a business process, in whole or part[1]. It is
description method of this system, engine structure etc, and
concerned with the automation of procedures where documents,
analysis on specific examples of the application of this engine.
“Workflow”
is
the
computerized facilitation
information or tasks are passed between participants according
2
to a defined set of rules to achieve, or contribute to, an overall
X-WPDL Description
business goal[3]. In order to achieve this goal by using
The scope of functions that a workflow description
computer technologies, we import the conception “Workflow
language can described is based on the workflow engine. On
Description Language”. Workflow management system is a
the other hand, in order to describe the workflow process better,
system that completely defines, manages and executes
workflow engine has to be adjusted according to the feature of
“workflows” through the execution of software whose order of
description language. Figure 1 shows the effect of X-WPDL in the whole
execution is driven by a computer representation of the
0-7695-2909-7/07 $25.00 © 2007 IEEE DOI 10.1109/SNPD.2007.381
137
Authorized licensed use limited to: IEEE Xplore. Downloaded on December 12, 2008 at 01:48 from IEEE Xplore. Restrictions apply.
workflow management system:
to construct a workflow, and a workflow process is the result of the relationship between nodes—this relationship is not only trigger but also depends. After all these analysis have been done on various actual workflow, this paper proposes a workflow description language—X-WPDL. It refers the XPDL[1] of WfMC (Workflow Management Coalition), using XML language and based on the event node, its structure is exactly the same of the workflow process structure which shown in figure 2. So, figure 2 is also the tree of X-WPDL. We will give a detail discuss about node in the following part.
Fig 1 X-WPDL working with the engine
2.2
Definition of node and process
In figure 1, Defined Workflow Process Template (DWPT,
Workflow process definition is based on the conception
it is the definition of process) and Defined Workflow Process
“business process [4] ”and “process definition [4] ”,
Instance (DWPI, it is the application of DWPT) are all
consequently, it should also contain the information such as
described by X-WPDL. Template Definer translates a
“activity”, “connection”, “router”, “participants”, “role” and
workflow process into a DWPT through a special module
“data source” besides some general workflow information. In
interface. When a project starts, Instance Producer will
figure 2, we give a detail description of node structure and its
translate the DWPT into a DWPI according to the content of
effect.
specific work by the way of interacting with workflow engine.
2.2.1 Node Definition
After a project started, the very DWPI will be loaded into the
Node is the basic unit of workflow process; its foundation
engine. DWPI has the same architecture as DWPT because it is
is operation handling. It describes not only the handling way
just the application of DWPT. We separate the two conceptions
and handling content but also all the other information about
because this can improve system safety and give a better
the whole handling, so we can say it’s a “activity” or
understanding to users. 2.1
“event”[5].
Design of X-WPDL
We design the workflow node according to a down-top
How we describe a workflow is more focused on how we
approach: at the bottom is "handling" which is the most basic
describe workflow process. This paper describes the workflow
foundation that describes the specific action including its
process as a node sequence; figure 2 shows the structure of a
operation type, operation message etc; above that, “role” and
workflow process.
“participants” are needed to tell us who will do this handling and what is to be handled. After all this defined, nodes can work well. But, there are several nodes in a workflow; we have to distinguish them, so the nodes need to have their own attributes include “name”, “serial”, “description” and “power” etc. At last, to execute a workflow instance in a correct sequence, nodes must have their dependence or triggering relationship. Therefore, at the top we defined the actions “accept” and “submit” to describe the routing relation between nodes, the former records of all the nodes that this node depends on (the node that must be completed before this node) and the latter records of all the nodes that depend on this node
Fig 2 Workflow Structure
(the node that can only be held after the completion of the
From this chart, we can see that node is the basic structure
node). Apparently, we also define a “data” part in the two
138
Authorized licensed use limited to: IEEE Xplore. Downloaded on December 12, 2008 at 01:48 from IEEE Xplore. Restrictions apply.
<X-WPDL:Application>...
actions to record the dataflow between nodes. Following is the X-WPDL description of node: <X-WPDL:Step>
3
<X-WPDL:StepProperty> <X-WPDL: StepName>Notification <X-WPDL:StepDescription>...
The design of workflow engine
This paper designs a multilayer workflow engine. The most important module of the engine is Node Handling
……
Module. It also has a manage module (Workflow Engine
<X-WPDL:StepHandle> <X-WPDL:StepRole>Normal
Manage Module) scheduling among different layers and
<X-WPDL:StepParticipate>...
various groups.
<X-WPDL:HandleType>SENDMESSAGE ……
3.1
Engine structure
We design the engine with four layers: user interface, data
<X-WPDL:Receive>
pretreatment, engine group and system interface. Figure 3
<X-WPDL:RelationStep>
show the structure of this engine.
<X-WPDL:Relation>... <X-WPDL:RelationData>... <X-WPDL:Submit> <X-WPDL:RelationStep> <X-WPDL:Relation>... <X-WPDL:RelationData>...
2.2.2 Process definition
From figure 2, we can see clearly that “process definition” can be expressed as “a start node and a sequence of middle node and an end node”. As we mentioned above, the “depend” and “trigger” relation between nodes is the assurance
Fig 3 Workflow engine structure
to make a workflow works in the correct way. To make a
By using the hierarchical structure, it is more convenient to
integrated business process, the description of workflow
distinguish the core module from other parts and make the main
attributes and the resources it refers are needed in addition.
function of engine low coupling and high cohesion.
Following is the X-WPDL description of workflow process
3.1.1 User interface layer
definition:
This layer is the channel for users to check, manage and
<X-WPDL:Flow> <X-WPDL:Information> <X-WPDL:Name>... <X-WPDL:Serial>... ...... <X-WPDL:Process> <X-WPDL:Start>... <X-WPDL:Step> <X-WPDL:StepName>... ... ... <X-WPDL:End>... <X-WPDL:Resource> <X-WPDL:Form>... ...
use the engine. It includes data interface, management interface and log interface. z
Data interface is a channel for data flow between users and workflow management system. All of the data from the beginning of this project to the end should be transferred through this interface, even the controlling data that the project manager sends.
z
Management
interface
is
used
by
the
system
administrator for checking the state of the engine, controlling the engine to start、 pause、 go on or stop etc. It also does the work that import or export the
139
Authorized licensed use limited to: IEEE Xplore. Downloaded on December 12, 2008 at 01:48 from IEEE Xplore. Restrictions apply.
z
WPOR(workflow process of running[3]) data when
Scheduling Module works on the base of the priority of
exception happens.
WPOR. This module gets the most prior WPOR firstly
Log interface is used to record the information about the
and loads its correct node into Node Handling Module.
operation of the engine or the exceptions, bring us a
Node Handling Module is the key part of the whole
convenient way to check and maintain the engine.
engine, and node resource group is tightly corresponding with it. This module follows the controlling information
3.1.2 Data Pretreatment Layer
During the routine of a workflow, the data that user
that come from management module and deals the correct
interactive with the engine are various. In order to upgrade the
node which is Scheduling Module required. It analyses
compatibility of the whole system, we format the data into a
the information of a workflow, sends the users
XML format. This deal greatly enhance the ability of data
appropriate operation, listens the data and controlling that
expressing but increase the difficulty that workflow engine
users send and changes the state or data of a workflow
deal with, this is why we design this layer in the engine. The
followed by the rules.
work this layer does is to change the XML format data into a
3.1.4 System Interface Layer
XML tree object which could be understood by the engine, and
This layer is the interface of workflow engine and the
also transfer the data which the engine export into XML
bottom of the whole system. It is used for the corresponding
format.
database access and file access.
3.1.3 Engine Layer
3.2
Engine operation procedure
This layer is the most important part of the whole engine,
The engine keeps working in the server after its starting
includes: WEMM (Workflow Engine Management Module),
except there is a system exception or someone shut it down. Its
Resource Group, Pretreatment Group and Running Group.
operating is an endless recycling procedure. Node handling
WEMM controls the operation of the engine, monitors the state
process is the most important sub process. Figure 4 shows us
of every module and schedules data resource. It receives and
the engine operating procedure.
analyses data from upper layer interface, then, distributes the data to the other 3 groups according to the data content. z
Resource Group: mainly includes X-WPDL grammar
analysis module and node resource group. The former is used to analyze the XML tree object which we got from data pretreatment layer according to X-WPDL grammar rules, and prove the preciseness of X-WPDL. The latter contains all the resources needed in the process of node design; it offers all the node resources and tables information to construct a workflow instance. z
Pretreatment Group: includes Template-to-Instance Module
and
Instance-to-Object
Module.
The
former
is
Fig 4 Engine operation procedure
responsible for transforming DWPT into DWPI and the
z
z
Check controlling information:
latter is responsible to transform DWPI into WPOR
At the beginning of every loop, the engine should check
(Workflow Process Object for Running) and add it to the
the control information table first, if there were no control info
WPOR queue.
from users at that moment, the engine would get into the
Running Group: includes WPOR queue, Scheduling
instance table and load next instance. Otherwise, it’ll execute
Module and Node Handling Module. WPOR queue
the control order and then get into the instance table.
records all the active workflow instance objects right now
z
Check instance table, get current node:
The engine will load the first instance which is on the top
about their current state and other information.
140
Authorized licensed use limited to: IEEE Xplore. Downloaded on December 12, 2008 at 01:48 from IEEE Xplore. Restrictions apply.
of WPOR queue and get the correct node of this instance
4.2
The engine drives the instance to run
according to its status. If the state shows it is an end node, the
When the Instance Producer needs to construct a specific
engine will end this instance; otherwise, the engine should
DWPI of s testing project, first, they interactive with the engine
judge the operation type of this node.
management module through the management interface and
z
Node handling operation
the workflow management system loads the corresponding
First, the engine checks the conditions and the data that
DWPT; second, the system translates the DWPT into a XML
triggered this node; second, the engine executes the operation
tree object by using X-WPDL compiler to build a DWPI; third,
this node described, if the results were succeeded, the engine
they bind the roles with the specific person who should join
“submits” this node, triggers the following node and handles
this work and bind the documentation data with the actual
the correspond data; at last, records the operation above in a log
documents; at last, they starts the DWPI they got and turn it
file.
into a WPOR, add its info into the instance table and load it into
z
Write the operation result in the executive feedback table
the engine to run.
and change the state of this workflow instance. Go back to
After a WPOR was built, the engine works as figure 4
the beginning of this loop.
shown to schedule all the WPOR in the instance table. When
System implementation on the engine
the testing workflow instance is at the first place of this WPOR
Figure 5 shows a testing business workflow. It introduces
module for checking the instance table to get the current node
4
queue and its state is active, the system calls on the scheduling
what role should do what king of operation and what outcome
of this instance and loads it into the node handling module.
is expectant from the beginning to the end of a testing project.
Supposing the current node is “Make Test Plan” and the former is “Distribute Test Task”. The engine will receive the data transmitted from the former node according to the handling this node defined, and sends a message to the project manager telling that the former node has ended.. The manager will check the former node and start the “Making test plan” node and “Build Test Environment” node. At the same time, the engine contacts node resource group getting the specific document of writing test plan for the users to fill. The two nodes will be executed by the engine in turns and whichever has been done it will send a message to its next node. The condition for the node “Testing” to start is that both of the nodes it depends are all finished. This testing project workflow will continue running depend on the relationship between nodes. It deals the nodes one by one until “Handling report” is done, then, this workflow
Fig 5 Test Business Workflow 4.1
instance flow into the tail node “Ending”. When the engine
Workflow Process Definition
handling this WPOR the next time, the appropriate node of this
According to the analysis of this testing workflow,
instance is “End”, and the engine will terminate this instance,
Template Definer sets every step of this work into a node with
update instance table and delete this WPOR from WPOR
joining in the roles on the left and the documentation resource
queue. This is a completed procedure of a workflow
on the right. After all these work have been done, we have got a
processing.
corresponding DWPT which means we finished the process
5
definition.
Conclusion
141
Authorized licensed use limited to: IEEE Xplore. Downloaded on December 12, 2008 at 01:48 from IEEE Xplore. Restrictions apply.
In this paper we designed a XML carrier reconfigurable workflow description language, and completed the design of actual business process according to the process definition model. It set the workflow description info refer to the standards of WfMC. Based on these, we designed the correspond tools of language definition, compiler and translator. This paper also designed a workflow engine that separated from the whole workflow management system and operated in the server stably, securely and efficiently. This workflow management system has already applied in actual testing work and run well.
Acknowledgments The research work here is sponsored by Tianjin Science and Technology Committee under contract 043185111-15 and 06YFJMJC00300
Reference [1] WfMC. Wf-XML2.0 .2004 [2] WfMC. Workflow Reference Model. Document Number WFMC-TC00-1003 1995 [3] SHIMeiLin,YANGuangXin,XIANYong,WUShangGuang. WfMS: Workflow management system. Chinese Journal of Computers 1999 Vol.20 No.3 P.325-334 [4] WfMC. Terminology&Glossary. Document Number WFMC-TC-1011 1999 [5] WfMC. Process Defination Interface--XML Process Defination Language. Document Number WFMC-TC-1025 2005 [6] ZHANGHongShen,YINRenKun,ZHANGSuQin. Design of Workflow Engine Based on Web. Computer Engineering 2004 Vol 30 No 4 P83-85
142
Authorized licensed use limited to: IEEE Xplore. Downloaded on December 12, 2008 at 01:48 from IEEE Xplore. Restrictions apply.