# Modeling, Design, and Implementation of a Cloud Workflow Engine Based on Aneka

Authors: Jiantao Zhou; Chaoxin Sun; Weina Fu; Jing Liu; Lei Jia; Hongyan Tan
Journal: Journal of Applied Mathematics
 (2014)

---

## Abstract

This paper presents a Petri net-based model for cloud workflow which plays a key role in industry. Three kinds of parallelisms in cloud workflow are characterized and modeled. Based on the analysis of the modeling, a cloud workflow engine is designed and implemented in Aneka cloud environment. The experimental results validate the effectiveness of our approach of modeling, design, and implementation of cloud workflow.


---

## Body

## 1. Introduction

With the successful cases of the world’s leading companies, for example, Amazon and Google, cloud computing has become a hot topic in both industrial and academic areas. It embraces WEB 2.0, middleware, virtualization, and other technologies and also develops upon grid computing, distributed computing, parallel computing, and utility computing, and so forth [1]. Comparing with classic computing paradigms, cloud computing provides “a pool of abstracted, virtualized, dynamically scalable, managed computing power, storage, platforms, and services are delivered on demand to external customers over the Internet” [2]. It can provide scalable resources conveniently, on demand to different system requirements. According to features of services mainly delivered by the established cloud infrastructures, researchers separated the services into three levels, which are infrastructure as a service (IaaS), platform as a service (PaaS), and software as a service (SaaS). IaaS offers hardware resources and computing power, such as Amazon S3 for storage and EC2 for computing power. PaaS targets providing entire facilities including hardware and the application development environment, such as Microsoft Azure Services platform and Google App Engine. SaaS refers to those software applications offered as services in cloud environments.However, along with the development of cloud computing, corresponding issues are also arising in both theoretical and technical aspects. One of the most prominent problems is how to minimize running costs and maximize revenues on the premise of maintaining or even improving the quality of service (QoS) [3]. Workflow technology can be regarded as one of the solutions [2–4]. A workflow is defined as “the automation of a business process, in whole or part, during which documents, information, or tasks are passed from one participant to another for action, according to a set of procedural rules” by the workflow management coalition (WFMC) [5]. Workflow management system (WFMS) is a system for defining, implementing, and managing the workflows, in which workflow engine is the most significant component for task scheduling, data movement, and exception handling.Cloud workflow, also called cloud-based workflow [1] or cloud computing-oriented workflow [3], is a new application mode of workflow management system in the cloud environment, whose goal is to optimize the system performance, guarantee the QoS, and reduce running cost. It integrates workflow with cloud computing, which combined the advantages of both sides. Cloud workflow technology can be used in two levels [3]; from the cloud users’ view, it supports process definitions of cloud applications and enables flexible configuration and automated operation of the processes. This kind of cloud workflow is regarded as “above-the-cloud,” such as Microsoft Biztalk workflow service and IBM Lotuslive. From the cloud service providers' view, cloud workflow offers automatic task scheduling and resource management of cloud computing environment. This category is referred to as “in-the-cloud,” for example, Cordys Process Factory (for Google APPs).There is still much timely and worthwhile work to do in the field of cloud workflow, for example, scalability and load balance of above-the-cloud workflow, optimization and integration of in-the-cloud workflow, and so on. The goal of our work in this paper is to design an above-the-cloud workflow engine based on Aneka cloud platform [6], considering scalability and load balance. The remainder of the paper is organized as follows. Related work about workflow, grid workflow, and cloud workflow is given in Section 2. The core part is given in Section 3, including formal modeling of workflow processes and design of the Aneka-based cloud workflow engine. Then, the implementation and experiments are presented in Section 4. Effectiveness and correctness of the novel workflow engine are shown by analysis results. Finally, in Section 5, the main results of the paper are summarized.


## 2. Related Work

From the mid-1990s to around 2000, business process management and workflow technology were developed rapidly, and many valuable results and products were gained. The detailed surveys can be found in [7–9]. Besides, flexibility, adaptability, dynamic changes, and exception handling of workflow have also been focused on and taken progress in the next few years [10–13]. Thus, from the modeling and verification of workflow process, to the design and implementation of workflow engine, to the building and practice of workflow management system, a series of results have made workflow technology play a more and more important role in social life.In the next ten years or so, with the emergence of new computer technologies and computing paradigms, for example, web services, P2P, and grid computing, workflow can be developed in two aspects. On the one hand, the existing workflows can be transferred to new computing paradigms. On the other hand, adapting to new features of technologies and paradigms, workflow technology should make a progress. Grid workflow can be classed into two categories, above-the-grid and in-the-grid, as the discussion of cloud workflow in the above section. The goal of in-the-grid workflow is integration, composition, and orchestration of grid services in the grid environment, considering peer-to-peer service interaction and complicated lifecycle management of grid services [14]. In regard to above-the-grid workflow, transformation of traditional business workflow systems is the part of the work, and many researches and practices have been done concerning distributed and parallel features of grid [15, 16], covering modeling, verification, scheduling problems, and so on [17–21].Comparing cloud computing emerging in 2007 with grid computing [2], it can be seen that their visions are the same; meanwhile, there are both similarities and differences between them, from architecture, security model, business model, and computing model to provenance and applications. Based on the analysis of workflows running in these two kinds of infrastructure, similarities and differences are also found [3, 22]. There are many workflow studies on different levels of cloud services. Research of workflows building on IaaS focuses on dynamical deployment and monitoring in cloud nodes, which is used in large-scale data intensive computing [23, 24]. Some researchers use cloud workflows in community team working among multiple processes [25]. Otherwise, many workflow studies in PaaS pay attention to the integration of cloud and workflow. It is concerned with recognition and execution of workflow tasks in cloud environment [26, 27]. Today, there are also many studies on scientific and commercial cloud workflows. Yuan et al. studied data dependency and storage on scientific cloud workflows [28, 29]. Wu et al. carried out researches on hierarchical scheduling strategy in commercial cloud workflows [30].According to our analysis, three kinds of differences or improvements can be concluded. Firstly, cloud workflow technology research is always carried out joint with multiple technologies and computing paradigms, such as web services, P2P, and grid computing. Secondly, cloud workflow concentrates more on data and resources and not just the control flow. Thirdly, performance of cloud workflow is paid more attention than functionalities [31–33].


## 3. Modeling and Design of Aneka-Based Cloud Workflow Engine

Our Aneka-based cloud workflow engine will be given in this section. To improve scalability, the cloud workflow engine will be designed to support different parallelism levels of workflow processes. And to clarify these parallelisms, the formal modeling technique for processes is given firstly.


### 3.1. Preliminaries

Workflow management system completely or partly supports automation of workflow schema. And workflow schema models business processes; it is characterized by the decomposition into subflows and atomic activities, the control flow between activities (subflows), data flow and data, and the assignment of resources (including human resources and equipment resources) to each activity [5]. That is, workflow schema is a combination of three essential dimensions: control flow, data flow, and resource flow.Petri net is a simple, graphical, yet rigorous, mathematical formalism, which has been used to model workflow processes [34]. However, the usage of Petri net is always limited to model control flow, which is not enough for describing the above three dimensions of workflow. An advanced model founded on the basic Petri net has been developed in our previous paper [35], called 3DWFN. Its definition is given as follows, which is suitable for describing cloud workflow.Definition 1.
Three-Dimension WorkFlow Net, 3DWFN.
LetΣ, Γ, and Ψ be finite alphabet sets of activity names, data names, and resource names, respectively. A three-dimension workflow net over them is a system 3
D
W
F
N
=
〈
S
,
T
,
F
,
C
;
L
a
b
,
E
x
p
,
M
0
〉, where we have the following: (i)
finite setsS of places and T oftransitions: S
∩
T
=
∅, S
∪
T
≠
∅, and T
=
T
a
∪
T
p
∪
T
τ, where T
a is a set ofatomic transitions, T
p is a set ofsubnet transitions, and T
τ is a set ofinternal transitions;
(ii)
F
⊆
(
S
×
T
)
∪
(
T
×
S
) is a set of arcs, especially, including the set of inhibitor arcs: F
∘
⊆
F;
(iii)
C is a finite and nonemptycolor set including types of tokens and the default is denoted by a black dot, “•;”
(iv)
Lab: T
→
Σ
,
C
→
Γ
∪
Ψ
∪
Γ
∪
Ψ is alabeling function;
(v)
Exp: F
→
N
×
C
×
C
o
n is anarc expression function, where N denotes the set of natural numbers and C
o
n is a set of expressions of numeric computation or logic computation;
(vi)
M
0
:
S
→
{
∅
,
μ
C
} is the initial marking of the net, where μ
C is the multiset over C.In view of defining transition rule of 3DWFN, some notations are introduced beforehand.Definition 2.
(i)Projection. Suppose F
x
:
Q
→
P
1
×
P
2
×
P
3
×
⋯
,
∃
q
∈
Q
,
p
i
∈
P
i
(
i
=
1,2
,
3
,
…
)
:
F
x
(
q
)
=
(
p
1
,
p
2
,
p
3
,
…
)
,
F
x
(
q
)
↑
P
1
×
P
2 represents F
x
(
q
)’s projection on P
1
×
P
2, and F
x
(
q
)
↑
P
1
×
P
2
=
(
p
1
,
p
2
) or {
p
1
,
p
2
}.
(ii)Variables Replacement. Let “x
:
A” represent x is a variable of set A. Variable x may be replaced by any element in A.
Then the transition rule is given.Definition 3.
Transition Rule of 3DWFN.(i)
Preconditions about a transition t are denoted as for all s
∈
t
∙
,
(
s
,
t
)
∉
F
∘
:
Pre
(
s
,
t
)
=
Exp
(
s
,
t
), Pre
(
t
)
=
⋃
s
∈
t
∙
‍
Exp
(
s
,
t
), and for all s
∈
t
∙
,
(
s
,
t
)
∈
F
∘
:
Prev
(
s
,
t
)
=
Exp
(
s
,
t
).
(ii)
Postcondition about a transition t is denoted as for all s
∈
t
∙
,
:
Post
(
t
,
s
)
=
Exp
(
t
,
s
)
,
Post
(
t
)
=
⋃
s
∈
t
∙
‍
Exp
(
t
,
s
).
(iii)
A transitiont
∈
T isenabled under a marking M if and only if (
for
all
s
∈
t
∙
,
(
s
,
t
)
∉
F
∘
:
M
(
s
)
≥
(
Pre
(
s
,
t
)
↑
N
×
C
)
)
∧
(
for
all
s
∈
t
∙
,
(
s
,
t
)
∈
F
∘
:
M
(
s
)
≺
(
Prev
(
s
,
t
)
↑
N
×
C
)
).
(iv)
A newmarking
M
′ is produced after an enabled transition fires: M
′
=
M
-
(
Pre
(
t
)
↑
N
×
C
)
+
(
Post
(
t
)
↑
N
×
C
) denoting as M
[
t
>
M
′ or M
→
t
t
M
′.


### 3.2. Modeling and Analysis of Workflow Process

With detailed analysis of generalized cloud workflow systems, it is really indispensable to discriminate different parallelisms of workflow processes for adopting cloud technologies to promote its execution efficiency. Therefore, we divide the execution of multiple tasks in a cloud workflow system into three levels according to different parallelisms, that is, process level execution, task level execution, and application level execution.As shown in Figure1 by 3DWFN, there are two parallel processes, named S1 and S2. S1 shows a sequential process and S2 shows a process including parallel tasks. U and R are colored sets. U represents the set of users, while R represents the set of resources. As a result, execution of a 3DWFN looks like a user acting, as some role carries some kind of data or uses some kind of resources to “walk” through a certain path of the net.Figure 1
Parallel processes modeled by 3DWFN.These two processes could be performed in parallel at different computing node in cloud environment, which illustrates the parallelism of process level execution in the cloud workflow system.When the workflow system enter state S2.2, S2.3, and S2.4 after transition S2.t1 fired, three tasks that are represented by S2.t2, S2.t3, and S2.t4 are enabled to be carried out in parallel at different computing node in cloud environment controlled by a single user or multiple users. Then, the joint task S2.t5 could be triggered to be executed only if resources in S2.5, S2.6, S2.7, and S2.10 are all available. This scenario illustrates the parallelism of task level execution in the cloud workflow system.Finally, if a single task is intensive computing, such as the task execution between S1.2 and S1.3, it could be divided into more fine-grained subtasks and carried out in parallel at different computing node in cloud environment controlled by a single user. This scenario shows the parallelism in application level.


### 3.3. Architecture of Cloud Workflow

According to the above-mentioned analysis, the integrated framework of Aneka-based cloud workflow engine is presented. There are three parts, environment, applications, and control parts, which can solve the analyzed parallelisms problems in the three levels and achieve extensibility and reusability of workflow. Details are presented in Figure2.Figure 2
Integrated framework of Aneka-based cloud workflow engine.


#### 3.3.1. Cloud Workflow Environment

There are three executing models in the Aneka cloud environment, Task Model, MapReduce Model, and Thread Model. In the remainder of this paper, all experiments are run with Task Model.


#### 3.3.2. Cloud Workflow Applications

The cloud workflow applications contain all instances of workflow processes.


#### 3.3.3. Cloud Workflow Control

The cloud workflow control part contains the workflow engine and host application. The cloud workflow engine is in charge of running workflow instances, and the host application is in charge of defining workflow processes and monitoring workflow process executions.


### 3.4. Design of Cloud Workflow

#### 3.4.1. Design of Workflow Runtime Environment

A lightweight cloud workflow engine is designed, whose functions include starting process execution, scheduling processes, and tasks based on preestablished rules. The workflow runtime environment is shown in Figure3, which is composed of three parts, host application, workflow instances, and runtime engine.Figure 3
Workflow runtime environment.Then, Figure4 shows all service classes design of the workflow engine. The class “WorkflowRuntimeService” is the base class and the others are the derived classes.Figure 4
Class diagram WF service.


#### 3.4.2. Design of Cloud Workflow Execution Process

After a process is started, each task will be executed following the control flow when requirements of data flow and resource flow are met. When a task is enabled, the task executor will send its execution request to workflow engine. Then, the workflow engine will instantiate the ready task. If the task is not intensive computing, then it will be executed locally. Otherwise, if the task is intensive computing, it will be submitted to the cloud. The execution process of cloud workflow is depicted as in Figure5.Figure 5
Process of cloud workflow execution.


#### 3.4.3. Design of Task Model Submission Process

Next, the submission process of task is designed. As mentioned above, Task Model is chosen. In Aneka cloud environment, Task Model is used not only to solve the distributed applications which are composed of single tasks, but also to execute the correlating tasks of these applications. Once users submit their sequence of tasks with rules, the results will be returned by Aneka after a while.Aneka Task Model is composed of the class AnekaTask, the interface ITask, and the class AnekaApplication. The task submission process in Aneka Task Model is as follows: firstly, to define a class “UserTask,” which inherits class “AnekaTask” in Aneka Task Model; secondly, to create an instance of UserTask for the application program; and thirdly, to package class “UserTask” instance to class “AnekaTask” and submit it to Aneka cloud by class “AnekaApplication.” The sequence diagram of the above process is shown in Figure6.Figure 6
Process of submitting tasks.Then, the implementation of workflow tasks is presented in Figure6. Firstly, the implementation manager submits tasks to the workflow runtime engine. Then, the workflow runtime engine selects a custom made operation flow and creates its workflow instance and then runs it at the same time.


## 3.1. Preliminaries

Workflow management system completely or partly supports automation of workflow schema. And workflow schema models business processes; it is characterized by the decomposition into subflows and atomic activities, the control flow between activities (subflows), data flow and data, and the assignment of resources (including human resources and equipment resources) to each activity [5]. That is, workflow schema is a combination of three essential dimensions: control flow, data flow, and resource flow.Petri net is a simple, graphical, yet rigorous, mathematical formalism, which has been used to model workflow processes [34]. However, the usage of Petri net is always limited to model control flow, which is not enough for describing the above three dimensions of workflow. An advanced model founded on the basic Petri net has been developed in our previous paper [35], called 3DWFN. Its definition is given as follows, which is suitable for describing cloud workflow.Definition 1.
Three-Dimension WorkFlow Net, 3DWFN.
LetΣ, Γ, and Ψ be finite alphabet sets of activity names, data names, and resource names, respectively. A three-dimension workflow net over them is a system 3
D
W
F
N
=
〈
S
,
T
,
F
,
C
;
L
a
b
,
E
x
p
,
M
0
〉, where we have the following: (i)
finite setsS of places and T oftransitions: S
∩
T
=
∅, S
∪
T
≠
∅, and T
=
T
a
∪
T
p
∪
T
τ, where T
a is a set ofatomic transitions, T
p is a set ofsubnet transitions, and T
τ is a set ofinternal transitions;
(ii)
F
⊆
(
S
×
T
)
∪
(
T
×
S
) is a set of arcs, especially, including the set of inhibitor arcs: F
∘
⊆
F;
(iii)
C is a finite and nonemptycolor set including types of tokens and the default is denoted by a black dot, “•;”
(iv)
Lab: T
→
Σ
,
C
→
Γ
∪
Ψ
∪
Γ
∪
Ψ is alabeling function;
(v)
Exp: F
→
N
×
C
×
C
o
n is anarc expression function, where N denotes the set of natural numbers and C
o
n is a set of expressions of numeric computation or logic computation;
(vi)
M
0
:
S
→
{
∅
,
μ
C
} is the initial marking of the net, where μ
C is the multiset over C.In view of defining transition rule of 3DWFN, some notations are introduced beforehand.Definition 2.
(i)Projection. Suppose F
x
:
Q
→
P
1
×
P
2
×
P
3
×
⋯
,
∃
q
∈
Q
,
p
i
∈
P
i
(
i
=
1,2
,
3
,
…
)
:
F
x
(
q
)
=
(
p
1
,
p
2
,
p
3
,
…
)
,
F
x
(
q
)
↑
P
1
×
P
2 represents F
x
(
q
)’s projection on P
1
×
P
2, and F
x
(
q
)
↑
P
1
×
P
2
=
(
p
1
,
p
2
) or {
p
1
,
p
2
}.
(ii)Variables Replacement. Let “x
:
A” represent x is a variable of set A. Variable x may be replaced by any element in A.
Then the transition rule is given.Definition 3.
Transition Rule of 3DWFN.(i)
Preconditions about a transition t are denoted as for all s
∈
t
∙
,
(
s
,
t
)
∉
F
∘
:
Pre
(
s
,
t
)
=
Exp
(
s
,
t
), Pre
(
t
)
=
⋃
s
∈
t
∙
‍
Exp
(
s
,
t
), and for all s
∈
t
∙
,
(
s
,
t
)
∈
F
∘
:
Prev
(
s
,
t
)
=
Exp
(
s
,
t
).
(ii)
Postcondition about a transition t is denoted as for all s
∈
t
∙
,
:
Post
(
t
,
s
)
=
Exp
(
t
,
s
)
,
Post
(
t
)
=
⋃
s
∈
t
∙
‍
Exp
(
t
,
s
).
(iii)
A transitiont
∈
T isenabled under a marking M if and only if (
for
all
s
∈
t
∙
,
(
s
,
t
)
∉
F
∘
:
M
(
s
)
≥
(
Pre
(
s
,
t
)
↑
N
×
C
)
)
∧
(
for
all
s
∈
t
∙
,
(
s
,
t
)
∈
F
∘
:
M
(
s
)
≺
(
Prev
(
s
,
t
)
↑
N
×
C
)
).
(iv)
A newmarking
M
′ is produced after an enabled transition fires: M
′
=
M
-
(
Pre
(
t
)
↑
N
×
C
)
+
(
Post
(
t
)
↑
N
×
C
) denoting as M
[
t
>
M
′ or M
→
t
t
M
′.


## 3.2. Modeling and Analysis of Workflow Process

With detailed analysis of generalized cloud workflow systems, it is really indispensable to discriminate different parallelisms of workflow processes for adopting cloud technologies to promote its execution efficiency. Therefore, we divide the execution of multiple tasks in a cloud workflow system into three levels according to different parallelisms, that is, process level execution, task level execution, and application level execution.As shown in Figure1 by 3DWFN, there are two parallel processes, named S1 and S2. S1 shows a sequential process and S2 shows a process including parallel tasks. U and R are colored sets. U represents the set of users, while R represents the set of resources. As a result, execution of a 3DWFN looks like a user acting, as some role carries some kind of data or uses some kind of resources to “walk” through a certain path of the net.Figure 1
Parallel processes modeled by 3DWFN.These two processes could be performed in parallel at different computing node in cloud environment, which illustrates the parallelism of process level execution in the cloud workflow system.When the workflow system enter state S2.2, S2.3, and S2.4 after transition S2.t1 fired, three tasks that are represented by S2.t2, S2.t3, and S2.t4 are enabled to be carried out in parallel at different computing node in cloud environment controlled by a single user or multiple users. Then, the joint task S2.t5 could be triggered to be executed only if resources in S2.5, S2.6, S2.7, and S2.10 are all available. This scenario illustrates the parallelism of task level execution in the cloud workflow system.Finally, if a single task is intensive computing, such as the task execution between S1.2 and S1.3, it could be divided into more fine-grained subtasks and carried out in parallel at different computing node in cloud environment controlled by a single user. This scenario shows the parallelism in application level.


## 3.3. Architecture of Cloud Workflow

According to the above-mentioned analysis, the integrated framework of Aneka-based cloud workflow engine is presented. There are three parts, environment, applications, and control parts, which can solve the analyzed parallelisms problems in the three levels and achieve extensibility and reusability of workflow. Details are presented in Figure2.Figure 2
Integrated framework of Aneka-based cloud workflow engine.


### 3.3.1. Cloud Workflow Environment

There are three executing models in the Aneka cloud environment, Task Model, MapReduce Model, and Thread Model. In the remainder of this paper, all experiments are run with Task Model.


### 3.3.2. Cloud Workflow Applications

The cloud workflow applications contain all instances of workflow processes.


### 3.3.3. Cloud Workflow Control

The cloud workflow control part contains the workflow engine and host application. The cloud workflow engine is in charge of running workflow instances, and the host application is in charge of defining workflow processes and monitoring workflow process executions.


## 3.3.1. Cloud Workflow Environment

There are three executing models in the Aneka cloud environment, Task Model, MapReduce Model, and Thread Model. In the remainder of this paper, all experiments are run with Task Model.


## 3.3.2. Cloud Workflow Applications

The cloud workflow applications contain all instances of workflow processes.


## 3.3.3. Cloud Workflow Control

The cloud workflow control part contains the workflow engine and host application. The cloud workflow engine is in charge of running workflow instances, and the host application is in charge of defining workflow processes and monitoring workflow process executions.


## 3.4. Design of Cloud Workflow

### 3.4.1. Design of Workflow Runtime Environment

A lightweight cloud workflow engine is designed, whose functions include starting process execution, scheduling processes, and tasks based on preestablished rules. The workflow runtime environment is shown in Figure3, which is composed of three parts, host application, workflow instances, and runtime engine.Figure 3
Workflow runtime environment.Then, Figure4 shows all service classes design of the workflow engine. The class “WorkflowRuntimeService” is the base class and the others are the derived classes.Figure 4
Class diagram WF service.


### 3.4.2. Design of Cloud Workflow Execution Process

After a process is started, each task will be executed following the control flow when requirements of data flow and resource flow are met. When a task is enabled, the task executor will send its execution request to workflow engine. Then, the workflow engine will instantiate the ready task. If the task is not intensive computing, then it will be executed locally. Otherwise, if the task is intensive computing, it will be submitted to the cloud. The execution process of cloud workflow is depicted as in Figure5.Figure 5
Process of cloud workflow execution.


### 3.4.3. Design of Task Model Submission Process

Next, the submission process of task is designed. As mentioned above, Task Model is chosen. In Aneka cloud environment, Task Model is used not only to solve the distributed applications which are composed of single tasks, but also to execute the correlating tasks of these applications. Once users submit their sequence of tasks with rules, the results will be returned by Aneka after a while.Aneka Task Model is composed of the class AnekaTask, the interface ITask, and the class AnekaApplication. The task submission process in Aneka Task Model is as follows: firstly, to define a class “UserTask,” which inherits class “AnekaTask” in Aneka Task Model; secondly, to create an instance of UserTask for the application program; and thirdly, to package class “UserTask” instance to class “AnekaTask” and submit it to Aneka cloud by class “AnekaApplication.” The sequence diagram of the above process is shown in Figure6.Figure 6
Process of submitting tasks.Then, the implementation of workflow tasks is presented in Figure6. Firstly, the implementation manager submits tasks to the workflow runtime engine. Then, the workflow runtime engine selects a custom made operation flow and creates its workflow instance and then runs it at the same time.


## 3.4.1. Design of Workflow Runtime Environment

A lightweight cloud workflow engine is designed, whose functions include starting process execution, scheduling processes, and tasks based on preestablished rules. The workflow runtime environment is shown in Figure3, which is composed of three parts, host application, workflow instances, and runtime engine.Figure 3
Workflow runtime environment.Then, Figure4 shows all service classes design of the workflow engine. The class “WorkflowRuntimeService” is the base class and the others are the derived classes.Figure 4
Class diagram WF service.


## 3.4.2. Design of Cloud Workflow Execution Process

After a process is started, each task will be executed following the control flow when requirements of data flow and resource flow are met. When a task is enabled, the task executor will send its execution request to workflow engine. Then, the workflow engine will instantiate the ready task. If the task is not intensive computing, then it will be executed locally. Otherwise, if the task is intensive computing, it will be submitted to the cloud. The execution process of cloud workflow is depicted as in Figure5.Figure 5
Process of cloud workflow execution.


## 3.4.3. Design of Task Model Submission Process

Next, the submission process of task is designed. As mentioned above, Task Model is chosen. In Aneka cloud environment, Task Model is used not only to solve the distributed applications which are composed of single tasks, but also to execute the correlating tasks of these applications. Once users submit their sequence of tasks with rules, the results will be returned by Aneka after a while.Aneka Task Model is composed of the class AnekaTask, the interface ITask, and the class AnekaApplication. The task submission process in Aneka Task Model is as follows: firstly, to define a class “UserTask,” which inherits class “AnekaTask” in Aneka Task Model; secondly, to create an instance of UserTask for the application program; and thirdly, to package class “UserTask” instance to class “AnekaTask” and submit it to Aneka cloud by class “AnekaApplication.” The sequence diagram of the above process is shown in Figure6.Figure 6
Process of submitting tasks.Then, the implementation of workflow tasks is presented in Figure6. Firstly, the implementation manager submits tasks to the workflow runtime engine. Then, the workflow runtime engine selects a custom made operation flow and creates its workflow instance and then runs it at the same time.


## 4. Implementation and Experiment

### 4.1. Building Aneka Cloud Environment

Our experimental cloud environment includes a server as a master node, some common PCs as the worker nodes, and a manager node. In this paper, the detailed hardware configuration is presented in Table1.Table 1
Aneka cloud environment configuration.
Type of node
Operating system
Quantity of computers
Manager
Windows 7
1
Master
Windows Server 2008
1
Worker
Windows 7
3Then, the cloud nodes are pretreated according to the following steps before installing Aneka.(a)
Install FTP server on the master node and worker nodes.
(b)
Offer access authority for the manager node to the master node and worker nodes.After pretreatment, Aneka cloud management platform is installed in the manager node. Then, we use remote access to install and configure the master node and worker nodes.


### 4.2. Workflow Process of an Example

Our example is to compute definite integral by a probabilistic method. The workflow process is composed of four steps: “generations of random number,” “computingX-axis,” “computing Y-axis,” and “computation of final result.”In this processing, there are three correlating tasks, which are “generation of random numbers”, “computation ofX-axis x” and “computation of Y-axis y.” We use the task “generation of random numbers” to compute real and imaginary axes. Then, we match and combine values of x
,
y to a p
o
i
n
t
(
x
,
y
). Admittedly, the combinational step is next to the computational step of f
(
x
,
y
), and the steps are in one task. In this case, we divide the position relations of all points into two cases. When a f
(
x
,
y
) is between x
=
a and x
=
b, we let the count increase by 1. In contrary, count is not changed. Then, letting the number of all points be equal to number n, we use p
=
R
/
n to estimate ∫
a
b
f
(
x
). The operation flow is present in Figure 7.Figure 7
Process diagram of task.


### 4.3. Implementation Methods

The task of computing axes is intensive computing and will be submitted to the Aneka cloud in Task Model. The execution function under the interface ITask is presented in Algorithm1. Then, the task is packaged and submitted to the cloud by the above mentioned class AnekaApplication. The core implementation is configured in Algorithm 2.Algorithm 1:Code of execute function.
public void Execute ()
{
this.result = (this.y  * this.y) * this.rd;.
}
public void Execute ()
{
this.result = this.x + (this.y − this.x) * this.rd:
}Algorithm 2:Aneka application configuration.
private static AnekaApplication < AnekaTask, TaskManager > Setup (string[
] args)
{
Configuration conf = Configuration.GetConfiguration (“configuration file”);
// ensure that SingleSubmission is set to false
// and that ResubmitMode to MANUAL.
conf.SingleSubmission = false;
conf.ResubmitMode = ResubmitMode.MANUAL;
conf.UserCredential = new Aneka.Security.UserCredentials(“administrator”, “”);
AnekaApplication < AnekaTask, TaskManager > app =
new AnekaApplication < AnekaTask, TaskManager > (“Workflow1”, conf);
// ensure that SingleSubmission is set to false
if (args.Length = = 1)
{
bLogOnly = (args [
0
] = = “LogOnly”? true: false);
}
return app;
}
∣


### 4.4. Results Analysis

Based on the above experiments, running results and workflow logs are analyzed. Three analysis conclusions are given as follows. Firstly, as shown in Table2, the results of definite integral workflow are presented with different number of points. It shows that the degree of accuracy increases along with the increase of task’s number. It accords with the mathematical regular rule. It is indicated that the functionality of our cloud workflow engine is normal.Table 2
Result of different number of the spots.
Number of the spots
70
100
150
1000
Computing result
0.286
0.310
0.393
0.342Secondly, the intensive computing tasks submitted to the Aneka cloud are executed in parallel by different workers. As shown in Figure8, the screenshot of workflow log, tasks A and B represent, respectively, the two intensive computing tasks, “computing X-axis” and “computing Y-axis.” It is indicated that our cloud workflow engine is effective and efficient.Figure 8
Process of task execution.Thirdly, the running time of the whole workflow completion is not simple linear growth with the number of points used in definite integral. The screenshot of workflow log shown in Table3 presents the time table of 10 tasks for their execution time, waiting time, and total time. Mean execution time is about 2.6 seconds, and mean waiting time is about 1 second except the last task. The waiting time of the last task is so long that it is nearly equal to the sum time of the other 9 tasks. In this case, if the number of used points is increased in the next experiment, the total time might not be increased but decreased, because the cloud might assign more workers (resources) to execute them to save time. It is indicated that the cloud workflow engine is scalable, which will not spend an impossible large amount of time when a lot of tasks and processes run in parallel.Table 3
Timetable of task.
Total execution time
Total waiting time
Total time spent
00:00:02
00:00:00.5730000
00:00:02.5730000
00:00:06
00:00:01.2300000
00:00:07.2300000
00:00:02
00:00:00.6670000
00:00:02.6670000
00:00:02
00:00:01.3100000
00:00:03.3100000
00:00:03
00:00:00.8700000
00:00:03.8700000
00:00:04
00:00:00.0470000
00:00:04.0470000
00:00:03
00:00:00.4500000
00:00:03.4500000
00:00:01
00:00:02.9370000
00:00:03.9370000
00:00:01
00:00:00.7000000
00:00:01.7000000
00:00:02
00:06:019.5058631
00:06:15.9415449


## 4.1. Building Aneka Cloud Environment

Our experimental cloud environment includes a server as a master node, some common PCs as the worker nodes, and a manager node. In this paper, the detailed hardware configuration is presented in Table1.Table 1
Aneka cloud environment configuration.
Type of node
Operating system
Quantity of computers
Manager
Windows 7
1
Master
Windows Server 2008
1
Worker
Windows 7
3Then, the cloud nodes are pretreated according to the following steps before installing Aneka.(a)
Install FTP server on the master node and worker nodes.
(b)
Offer access authority for the manager node to the master node and worker nodes.After pretreatment, Aneka cloud management platform is installed in the manager node. Then, we use remote access to install and configure the master node and worker nodes.


## 4.2. Workflow Process of an Example

Our example is to compute definite integral by a probabilistic method. The workflow process is composed of four steps: “generations of random number,” “computingX-axis,” “computing Y-axis,” and “computation of final result.”In this processing, there are three correlating tasks, which are “generation of random numbers”, “computation ofX-axis x” and “computation of Y-axis y.” We use the task “generation of random numbers” to compute real and imaginary axes. Then, we match and combine values of x
,
y to a p
o
i
n
t
(
x
,
y
). Admittedly, the combinational step is next to the computational step of f
(
x
,
y
), and the steps are in one task. In this case, we divide the position relations of all points into two cases. When a f
(
x
,
y
) is between x
=
a and x
=
b, we let the count increase by 1. In contrary, count is not changed. Then, letting the number of all points be equal to number n, we use p
=
R
/
n to estimate ∫
a
b
f
(
x
). The operation flow is present in Figure 7.Figure 7
Process diagram of task.


## 4.3. Implementation Methods

The task of computing axes is intensive computing and will be submitted to the Aneka cloud in Task Model. The execution function under the interface ITask is presented in Algorithm1. Then, the task is packaged and submitted to the cloud by the above mentioned class AnekaApplication. The core implementation is configured in Algorithm 2.Algorithm 1:Code of execute function.
public void Execute ()
{
this.result = (this.y  * this.y) * this.rd;.
}
public void Execute ()
{
this.result = this.x + (this.y − this.x) * this.rd:
}Algorithm 2:Aneka application configuration.
private static AnekaApplication < AnekaTask, TaskManager > Setup (string[
] args)
{
Configuration conf = Configuration.GetConfiguration (“configuration file”);
// ensure that SingleSubmission is set to false
// and that ResubmitMode to MANUAL.
conf.SingleSubmission = false;
conf.ResubmitMode = ResubmitMode.MANUAL;
conf.UserCredential = new Aneka.Security.UserCredentials(“administrator”, “”);
AnekaApplication < AnekaTask, TaskManager > app =
new AnekaApplication < AnekaTask, TaskManager > (“Workflow1”, conf);
// ensure that SingleSubmission is set to false
if (args.Length = = 1)
{
bLogOnly = (args [
0
] = = “LogOnly”? true: false);
}
return app;
}
∣


## 4.4. Results Analysis

Based on the above experiments, running results and workflow logs are analyzed. Three analysis conclusions are given as follows. Firstly, as shown in Table2, the results of definite integral workflow are presented with different number of points. It shows that the degree of accuracy increases along with the increase of task’s number. It accords with the mathematical regular rule. It is indicated that the functionality of our cloud workflow engine is normal.Table 2
Result of different number of the spots.
Number of the spots
70
100
150
1000
Computing result
0.286
0.310
0.393
0.342Secondly, the intensive computing tasks submitted to the Aneka cloud are executed in parallel by different workers. As shown in Figure8, the screenshot of workflow log, tasks A and B represent, respectively, the two intensive computing tasks, “computing X-axis” and “computing Y-axis.” It is indicated that our cloud workflow engine is effective and efficient.Figure 8
Process of task execution.Thirdly, the running time of the whole workflow completion is not simple linear growth with the number of points used in definite integral. The screenshot of workflow log shown in Table3 presents the time table of 10 tasks for their execution time, waiting time, and total time. Mean execution time is about 2.6 seconds, and mean waiting time is about 1 second except the last task. The waiting time of the last task is so long that it is nearly equal to the sum time of the other 9 tasks. In this case, if the number of used points is increased in the next experiment, the total time might not be increased but decreased, because the cloud might assign more workers (resources) to execute them to save time. It is indicated that the cloud workflow engine is scalable, which will not spend an impossible large amount of time when a lot of tasks and processes run in parallel.Table 3
Timetable of task.
Total execution time
Total waiting time
Total time spent
00:00:02
00:00:00.5730000
00:00:02.5730000
00:00:06
00:00:01.2300000
00:00:07.2300000
00:00:02
00:00:00.6670000
00:00:02.6670000
00:00:02
00:00:01.3100000
00:00:03.3100000
00:00:03
00:00:00.8700000
00:00:03.8700000
00:00:04
00:00:00.0470000
00:00:04.0470000
00:00:03
00:00:00.4500000
00:00:03.4500000
00:00:01
00:00:02.9370000
00:00:03.9370000
00:00:01
00:00:00.7000000
00:00:01.7000000
00:00:02
00:06:019.5058631
00:06:15.9415449


## 5. Conclusion

The work in this paper can be concluded as follows. A Petri net-based model called 3DWFN is given firstly, which can describe three dimensions of a workflow, that is, control flow, data flow, and resource flow. According to the analysis of the existing workflow systems, it is found that cloud workflow pays more attention to data, resources, and performance than control flow and functionality researched commonly in traditional workflow. Thus, 3DWFN is suitable for modeling of cloud workflow processes. Through analysis of the features of workflow processes executed potentially in cloud environment, three kinds of parallelisms are recognized as process level, task level, and application level and then modeled specifically by 3DWFN. The goal of the following design of cloud workflow engine is to support these parallelisms to improve scalability by using resources as far as in parallel.Then, the architecture of the Aneka cloud based workflow engine is designed. The workflow runtime environment and execution process are stated, and the process of packaging and submitting an intensive computing task to Aneka is explained. After the engine is implemented, a definite integral process is used as an example. By different numbers of points used to definite integral, the functionality and effectivity of the cloud workflow engine are shown. Based on the analysis of running results and workflow logs, the scalability and efficiency of the cloud workflow engine are given.In the future, the research can be improved in following directions. First, more practical workflow processes will be designed using powerful expression of 3DWFN. Second, novel cloud workflow engine will be built, which has dynamic scheduling and handling functions with complicated process.



---

*Source: 512476-2014-04-29.xml*