2. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
Outline
1 The workflow metaphor
2 Agent-based workflows
3 WADE
Overview
Architecture
4 The Factorial case study
Preparing the Infrastructure
Creating the Agent
Creating the Workflow
WADE Delegation Model
Running sub-workflows
3. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
Definition
Workflow
A workflow is the automation of a business
process, which artifacts, information and/or tasks
are passed from one actor to another according
to a set of procedural rules.
[Workflow Management Coalition, 2013]
4. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
Definition
Workflow
A workflow is the automation of a business
process, which artifacts, information and/or tasks
are passed from one actor to another according
to a set of procedural rules.
[Workflow Management Coalition, 2013]
Formalisms
Many formalisms exist to represent a workflow.
Some examples are flow charts, UML activity
diagrams and finite state machine diagrams.
7. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
Examples of Workflow Description
Languages
BPEL
Business Process Execution Language.
• Keywords: SOA, WS oriented
• More information: OASIS
(http://www.oasis-open.org)
XPDL
XML Process Definition Language.
• Keywords: Visual modelling notations,
XML based
• More information: Workflow Management
Coalition (http://www.wfmc.org)
9. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
Pros and Cons
Pros
• Extremely intuitive. Can be validated by
domain experts with no programming skills
• Self-documented
• Execution steps are made explicit
• Workflows are interpreted at runtime
• Several infrastructure facilities
10. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
Pros and Cons
Pros
• Extremely intuitive. Can be validated by
domain experts with no programming skills
• Self-documented
• Execution steps are made explicit
• Workflows are interpreted at runtime
• Several infrastructure facilities
Cons
• Not suitable to deal with low-level
operations
• Supporting tools not comparable with those
available for normal code development
• Less efficient execution
11. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
Bringing the workflow approach to the
Multiagent world
Agent-based workflows
The basic idea is to use the
expressiveness of the workflow
metaphor to improve the agent
communication process.
12. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
What is WADE?
• is a software platforma based on JADE
• A WADE application is also a JADE application
• All JADE features are available in WADE too
• Allows the execution of tasks using the workflow
metaphor
• Adopted the XPDL meta-model to facilitate
import/export from/to a standard workflow
representation format
a
For more information: http://jade.tilab.com/wade/
13. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
Main components
Figure: Source: [Telecom Italia, 2011b]
WADE and WOLF
In principle WADE supports
“notepad-programming”, but it comes
with a graphical development
environment called WOLF
[Telecom Italia, 2011b].
15. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
A classroom case study using WADE
• Now, it’s time to develop a
simple but complete application
using WADE ...
• ... from scratch !
16. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
Formal Definition
• In mathematics, the factorial of
a non-negative integer n,
denoted by n!, is the product of
all positive integers less than or
equal n
• For example: 5! = 5 x 4 x 3 x 2
x 1 = 120
• According to the rule, the value
of 0! is 1
17. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
Implementing the application using the
workflow metaphor
Note
We know ... The factorial problem could easily be implemented in one line, as the
example above in LISP:
(defun fa (n)
(cond ((eq n 1) n) ((> n 1) (* (fa (- n 1) ) n ) ) )
By the other hand, this problem allows to explore the workflow metaphor, keeping
us focused on the approach and not on out-of-scope issues.
18. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
Implementing the application using the
workflow metaphor
• We will start by implementing a
simple solution using only one
workflow agent
• Next, we will improve the
application, enabling the
parallel execution of
sub-workflows
25. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
(4) Defining the Agent
• The Factorial Agent will
not inherit from the
jade.core.Agent class
directly
• We will use the
WorkflowEngineAgent a
• All workflow agents are
automatically registered
in the DF
a
See FactorialAgent.java
26. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
(5) Agent Types
• WADE agents
automatically registers
with the DF providing a
default description.
• Such description
contains the agent type
as indicated in the
cfg/types.xml file where
relevant agent types are
declared.
Figure: See cfg/types.xml
27. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
(6) Allowing the Agent to execute
Workflows
DispatchCapabilities Object
By embedding a DispatchingCapabilities
instance, an agent acquires the ability of
launching workflows, setting and
retrieving, workflow relevant data and
listening to events generated by the
execution of workflows
[Telecom Italia, 2011a].
Figure: See FactorialAgent.java
28. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
(7) Preparing the configuration for the
first execution
Configuration file
Before lauching our application
we still need to declare which
agents we want to activate in it.
This can be done by means of
an "Application Configuration
File".
Figure: See cfg/configuration/Factorial.xml
51. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
(8) Creating a Workflow
• Workflows in
WADE are Java
classes that extend
the
WorkflowBehaviour
class
• Indirectly, this class
extends our known
JADE Behaviour
• WOLF provides a
view to edit a
workflow in a
bidirectional
fashion.
Figure: See FactorialWorkflow.java
61. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
A workflow with two actors
Executing sub-workflows
Now, we will change the code
to allow agents delegate the
execution of sub-workflows to
other agents
64. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
Changing Project Settings
• Creating the mutiply agent (See MultiplyAgent.java)
• (12) Adding multiplier to cfg/types.xml
65. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
Changing Project Settings
• Creating the mutiply agent (See MultiplyAgent.java)
• Adding multiplier to cfg/types.xml
• (13) Creating the multiplication sub-workflow (See
MultiplyWorkflow.java)
66. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
Changing Project Settings
• Creating the mutiply agent (See MultiplyAgent.java)
• Adding multiplier to cfg/types.xml
• Creating the multiplication sub-workflow (See
MultiplyWorkflow.java)
• (14) Changing the project configuration (See
cfg/configuration/Factorial.xml)
67. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
(15) Changing the Factorial Agent
Executing sub-workflows
Now, we will change the code
to allow the factorial agent
keep on track of multiply
agents life-cycle a.
a
See subscribe method defined in FactorialAgent.java
68. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
(16) Changing the Factorial Workflow
Changing the workflow
Now, we will change the
workflow in order to execute
the multiplication in parallel,
joining the results at the end
of all operations a.
a
See FactorialWorkflow.java
70. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
Conclusion
Questions?
• A hands-on example on WADE
• Much more examples and resources on
http://jade.tilab.com/wade/
• See also the WADE tutorial at
http://jade.tilab.com/wade/doc/tutorial/WADE-
Tutorial.pdf
Contact Information
• Marcio Fuckner
• marcio.fuckner@utc.fr
71. UTC
The workflow
metaphor
Agent-based
workflows
WADE
Overview
Architecture
The Factorial
case study
General Information
Implementation
Preparing the
Infrastructure
Creating the Agent
Creating the
Workflow
WADE Delegation
Model
Running
sub-workflows
Caire, G. (2008).
WADE: an open source platform for workflows and agents.
The Seventh International Conference On Autonomous
Agents and Multiagent Systems.
Telecom Italia (2011a).
WADE Tutorial.
Telecom Italia.
Available at
http://jade.tilab.com/wade/doc/tutorial/WADE-Tutorial.pdf.
Telecom Italia (2011b).
WADE User Guide.
Telecom Italia.
Available at
http://jade.tilab.com/wade/doc/WADE-User-Guide.pdf.
Workflow Management Coalition (2013).