=Paper= {{Paper |id=Vol-494/paper-9 |storemode=property |title=WADE: An Open Source Platform for Workflows and Agents (Extended Abstract) |pdfUrl=https://ceur-ws.org/Vol-494/mallowawesomepaper9.pdf |volume=Vol-494 |dblpUrl=https://dblp.org/rec/conf/mallow/CaireQS09 }} ==WADE: An Open Source Platform for Workflows and Agents (Extended Abstract)== https://ceur-ws.org/Vol-494/mallowawesomepaper9.pdf
      WADE – An Open Source Platform for Workflows and
                         Agents
                                             G. Caire, E. Quarantotto, G. Sacchi
                                                              Telecom Italia
                                                          Via Reiss Romoli 274
                                                           10148 Torino - Italy




Categories and Subject Descriptors                                      2.        WADE OVERVIEW
I.2.11 {Artificial Intelligence]: Distributed Artificial Intelligence   WADE (Workflow and Agent Development Environment) is a
- Multiagent systems; C.2.4 {Computer Communication                     domain independent platform, built on top of JADE 5, an open
Systems]: Distributed systems; D.2.11 [Software Engineering]:           source middleware for the development of distributed applications
Software architecture                                                   based on the agent-oriented paradigm. The distribution of JADE
                                                                        includes a runtime environment, a library of classes that
                                                                        programmers can use to develop their application and some
General Terms                                                           graphical tools for administration and monitoring purposes.
Management, Performance, Languages.
                                                                        Each running instance of the JADE runtime environment is called
                                                                        Container and a set of containers is called Platform. In a JADE
Keywords                                                                Platform a single special Main Container must always be active
Software Agent, workflow, JADE, Open Source, XPDL,                      and the other containers register with it at startup.
Scalability, Flexibility.
                                                                        One or more application agents can be started into a Container.
                                                                        The actual job of an Agent is to perform some tasks assigned to it.
1.        INTRODUCTION                                                  In JADE, a “Behavior” represents a task to be performed by an
WADE is the main evolution of JADE and adds to it the ability to        Agent and it is implemented as an object of a class that extends
define system logics according to the workflow metaphor.                the class Behaviour of the JADE library.
WADE is not just an add-on, but a complete platform (built on           An Agent to perform its tasks may need to communicate with
top of JADE) providing advanced administration and fault                other Agents in the Platform. JADE provides the agents with the
tolerance mechanisms and enabling a group of agents to                  ability to communicate. The communication model adopted is the
cooperatively execute complex tasks defined as workflow.                “Asynchronous Message Passing” and the format of the messages
Nowadays workflows are mostly adopted in BPM (Business                  is the ACL (Agent Communication Language) defined by FIPA 5.
Process Management) environments where they are used to                 WADE adds to JADE the support to the workflow execution and
represent business processes and orchestrate existing systems           a few mechanisms to manage the complexity of the distribution, in
typically (but not necessarily) accessible by means of Web              terms of administration and fault tolerance. It should be noticed
Services-based interfaces.                                              that a WADE-based application may even not use Workflow
The main challenge in WADE is to bring the workflow approach            Engine agents at all and just exploit the administration and fault
from the business process level to the level of system internal         tolerance features. In that case we end up with a WADE-based
logics. That is, even if in principle it could be used for that         application that does not use workflows. On the other side, it is
purpose too, WADE does not target high level orchestration of           also possible to use the workflow metaphor inside of a Jade
services provided by different systems, but the implementation of       platform.
the internal behaviour of each single system. Each agent embeds a       Wade specific components are:
micro-workflow engine and a complex process can be carried out
by a set of cooperating agents each one executing a piece of the             •    BootDaemon processes: there is a bootDaemon process
process.                                                                          for each host in the platform and it is in charge of the
                                                                                  Containers activation in its local host.
The approach followed by WADE is to provide a workflow view
on top of a normal Java class. That is a workflow is implemented             •    Configuration Agent (CFA): the configuration agent
as a Java class with a well defined structure. A key element in this              always runs in the Main Container and is responsible
approach is WOLF (WOrkflow LiFe cycle management                                  for interacting with the boot daemons and controlling
environment), the graphical development environment for WADE                      the application life cycle.
based applications.                                                          •    Controller Agents (CA): there is a controller agent for
The presentation will provide an overview of the WADE                             each container in the platform and they are responsible
platform, will highlight its most distinguishing features such as                 for supervising activities in the local container and for
workflow inheritance, support for web services and delegation.                    all the fault tolerance mechanisms provided by WADE.
     •    Workflow Engine Agents (WEA): Workflow Engine                Additionally, when processes have to be executed within the
          Agents embed an instance of the micro workflow engine        scope of a transaction, semi-automatic rollback procedures can be
          and therefore they are able to execute workflows.            activated in case of unexpected fault. Finally, since workflows are
                                                                       fully self-documented, workflow-based development releases the
                                                                       development team of the burden of keeping documentation
                                                                       aligned each time design choices must be revisited to face
                                                                       implementation details or evolving requirements.
                                                                       Nowadays the workflow metaphor is mostly used in BPM
                                                                       environments where a workflow represents a business process and
                                                                       orchestrates a number of existing systems typically (but not
                                                                       necessarily) accessible by means of Web Services based
                                                                       interfaces.
                                                                       The main challenge in WADE is to bring the workflow approach
                                                                       from the business process level to the level of system internal
                                                                       logics. That is, even if it could be used for that purpose too,
                                                                       WADE does not target high level orchestration of services
                                                                       provided by different systems, but the implementation of the
                                                                       internal behaviour of each single system.
                                                                       First of all it should be noticed that WADE does not include a
                  Figure 1 – a WADE platform                           single powerful workflow engine as the majority of BPM oriented
Figure 1 shows the topology of a WADE-based application.               tools. On the contrary WADE provides an extension of the basic
WADE specific components are highlighted in blue.                      Agent       class     of     the     JADE      library    called
                                                                       WorkflowEngineAgent that embeds a small and lightweight
As mentioned, workflows are represented in Wade as Java classes,
                                                                       workflow engine (we talk about "micro-workflow engine"). As a
so, in principle, Wade supports “notepad-programming” in the
                                                                       consequence, besides normal JADE behaviours, all Workflow-
sense that there is not hidden stuff that developers can’t control.
                                                                       Engine agents active in a WADE-based multi-agent applications
However, expecially considering that one of the main advantages
                                                                       are able to execute workflows represented according to a WADE
of the workflow approach is the possibility of representing
                                                                       specific formalism.
processes in a friendly graphical form, Wade comes with a
development environment called Wolf that facilitates the creation      The second important point to highlight is that, in order to allow
of Wade-based applications. Wolf is an Eclipse plug-in and as a        developers to exploit the workflow metaphor to define system
consequence allows Wade developers to exploit the full power of        internal logics and, at the same time, to give them the same power
the Eclipse IDE plus additional Wade specific features.                of a software programming language and a comparable execution
                                                                       efficiency, the WADE workflow representation formalism is
3.        Workflow approach                                            based on the Java language. That is, a workflow that can be
A workflow is a formal definition of a process in terms of             executed by WADE Workflow-Engine agents is expressed as a
activities to be executed, relations between them, criteria that       Java class with a well defined structure (as it will be explained in
specify the activation and termination and additional information      the following). As such WADE workflows can be edited,
such as the participants, the software tools to be invoked, required   refactored, debugged and in general managed as all Java classes
inputs and expected outputs and internal data manipulated during       and can include all pieces of code (methods, fields of whatever
the execution.                                                         types, inner classes, references to external classes and so on)
                                                                       needed to implement the process details. In addition, of course,
The key aspect of the workflow metaphor is the fact that the
                                                                       the execution flow they specify can be presented and modified in
execution steps as well as their sequencing are made explicit. This
                                                                       a friendly, graphical way. More in details WOLF (the
makes it possible to give a graphical representation of a process
                                                                       development environment for WADE based applications) is an
defined as a workflow. Such representation is clearly extremely
                                                                       Eclipse plugin and allows developers to work with a graphical
more intuitive with respect to a piece of software code and in
                                                                       view (suitable to manage the process flow) and a code view (the
general is understandable by domain experts as well as by
                                                                       usual Eclipse Java editor suitable to define execution details) that
programmers.
                                                                       are kept in synch.
Domain experts can therefore validate system logics directly and
                                                                       Finally it must be noticed that WADE does not impose that all
not only on documents that most of the time are not perfectly up
                                                                       system logics are defined as workflows. Developers are free to
to date. In some cases they could even contribute to the actual
                                                                       exploit the workflow metaphor to describe those tasks for which
development of the system without the need for any programming
                                                                       they think it is appropriate and use normal JADE behaviours (or
skill.
                                                                       other purely Java patterns) elsewhere.
Another important characteristic is that, being the execution steps
                                                                       As mentioned the approach followed by WADE is to provide a
explicitly identified, the workflow engine (i.e. a system able to
                                                                       workflow view on top of a normal Java class.
automatically execute a process defined as a workflow) can trace
them. This makes it possible to create automatic mechanisms to         As a consequence, a workflow is implemented as a Java class and
facilitate system monitoring and problem investigation.                no standard workflow definition language is used. However, Wolf
                                                                       adopts the workflow meta-model defined in the XPDL [2],
standard specified by the Workflow Management Consortium.                          the agent executing the subflow acts as responder. This
The XPDL meta-model has been chosen, because the XPDL                              protocol allows managing, when required, a process
language has been conceived as interchange formalism between                       carried out by a set of cooperating agents as a single
different systems. WADE supports the import of XPDL files and                      transaction.
the adoption of this meta-model facilitates these operations.
                                                                              •    Route Activity: a route activity is an activity which
Moreover, the XPDL meta-model is based on a Finite State
                                                                                   performs no work processing, but simply supports
Machine computational model that is the same model supported
                                                                                   routing decisions among its incoming and out coming
by the WADE agents.
                                                                                   transitions.
In the XPDL meta-model a process is represented as a workflow,
                                                                              Finally, WADE introduces a few types of Activity, among
consisting of one or more activities that can be thought as tasks to
                                                                              them the CodeActivity and the Web Services Activity.
be executed.
                                                                              In a Code Activity the operations are specified directly by a
In a workflow, the execution entry point is defined, specifying the
                                                                              piece of Java code embedded in the workflow process
first activity to be performed; this activity is called Start Activity.
                                                                              definition.
On the other hand, a workflow must have one or more termination
points, named Final Activities.                                               A Web Service Activity, instead, provides an easy way to
                                                                              invoke Web Services from a workflow. Two kinds of Web
The execution flow is defined by means of transitions. A                      Services invocations are allowed: static and dynamic.
transition is an oriented connection between two activities and
may have a condition associated. Regular or exception transitions             In the first case, it is necessary to import the WSDL
can be defined. Exception Transitions allow specifying branches               describing the Web Service using WOLF. This operation
that are taken only when an Exception is raised in the source                 generates a set of classes that will be used at workflow
activity.                                                                     execution time to actually invoke the web service described
Excluding the final ones, each activity may have one or more                  by the imported WSDL. These classes can be extended by
outgoing transitions. When the execution of an activity is                    users with development skills, in order to satisfy some
terminated, the conditions associated to its outgoing transitions             specific requirements (e.g.: logging some information before
are evaluated. As soon as a condition is verified the corresponding           and after the invocation of the Web Service).
transition is activated and the execution flow proceeds towards the           In the second case, the dynamic invocation is performed
destination activity.                                                         without the need of generating new classes. This approach is
Normally a process execution uses some internal data, for                     useful if the user doesn’t need to customise these classes.
instance, to pass intermediate results between activities and/or for      As mentioned a workflow is implemented by a Java class and it
evaluation of conditional expressions. In the XPDL meta-model             extends   directly  or    indirectly  the    WADE       class
internal data are modeled by Data Fields.                                 WorkflowBehaviour.
A process can have one or more inputs to be provided and one or           The WorkflowBehaviour class provides a set of APIs,
more outputs expected at the end of its execution. Inputs and             consistent with the XPDL meta-model described in the previous
outputs of a process can be formalized in the XPDL meta-model             section, which can be used by developers to implement their own
by means of the workflow Formal Parameters.                               workflows.
The XPDL meta-model defines some predefined types of activity.            The mapping between the meta-model objects and the workflow
The most important ones are:                                              implementation is shown in the example depicted in Figure 2.
     •    Tool Activity: a tool activity is an activity that is
          implemented by means of the invocation of one or more
          software tools, named Applications.
     •    Subflow Activity: a subflow activity is an activity that
          requires the execution of another workflow. When a
          workflow is called by a subflow activity, the workflow
          formal parameters permit the exchange of necessary
          data between calling and called process. A
          distinguishing characteristic of the WADE workflow
          engine is the Delegation mechanism that allows a set of
          agents to cooperatively execute a complex process.
          More in details the agent executing the calling workflow
          can decide to delegate the subflow to another agent on
          the basis of conditions evaluated at runtime. Such
          conditions may be related for instance to the current
          load (thus supporting the implementation of a GRID-
          like system) or to specific abilities required to carry out
          a portion of the whole process. The delegation
          mechanism is implemented by means of a an extension
          of the fipa-contract-net protocol (5) where the agent
          executing the calling workflow acts as initiator while
                                                                       the possibility of modeling the agents’ behaviours following the
  public class SendMail extends WorkflowBehaviour {...
                                                                       workflow metaphor. Moreover some administration and fault
  protected void defineActivities() {     SEND MAIL PROCESS            tolerance features are provided too.
      //ACTIVITY Prepare Mail …                                        As mentioned, in WADE a workflow is represented as a java class
      registerActivity(prepareMail, INITIAL);                          and WOLF provides a graphical view of it, making available to
                                                    Prepare Mail       the developers both the expressiveness of a visual representation
      //ACTIVITY Verify Mail…
                                                                       and the power of usual programming languages.
      registerActivity(verifyMail);
                                                                       As well known, the workflow metaphor is traditionally used in the
      …}                              Send          Verify Mail        BPM context for web service orchestration. Because WADE
                                                                       provides support for Web Service invocation, it can be used even
  protected void defineTransitions() {                                 in this context, but its actual challenge is to bring the workflow
                                                                       approach from the business process level to the level of system
      registerTransition(new Transition(), PREPARE_MAIL,               internal logics. A direct consequence of the approach described is
                VERIFY_MAIL);                    Modify Mail           that the full power of WADE can be exploited for applications
                                                                       that imply the execution of possibly long and fairly complex tasks.
      registerTransition(newTransition("IsCorrect", this),
              VERIFY_MAIL, SEND_MAIL);}                                Furthermore, unlike the majority of existing workflow systems
                                                                       that provide a powerful centralized engine, in WADE each agent
  protected void executePrepareMail (final ApplicationList             can embed a “micro workflow engine” and therefore a complex
            applications) throws Exception {…                          process can be carried out by a set of cooperating agents through
                                                                       the delegation mechanism.
  }
  protected boolean checkIsCorrect() {...                              From an industrial point of view WADE can be particularly useful
                                                                       to develop applications with strong requirements of both
              }                                                        performance and scalability and high flexibility in defining the
                                                                       systems’ logics.
       Figure 2 – Mapping between meta – model objects and
                    workflow implementation
                                                                       5.        REFERENCES
The         methods        registerActivity()        and               [1] JADE - Java Agent Development framework.
registerTransition() must be used respectively to add an                   http://jade.tilab.com
activity and a transition.
                                                                       [2] FIPA – Foundation for Intelligent Physical Agents
When the registerActivity() method is called, its first
parameter is an instance of the activity to be added.                       http://www.fipa.org
The actual tasks to be performed by an activity (no matter of its      [3] FIPA – The FIPA Contract Net interaction protocol
type) are specified in a void method of the workflow class; this
                                                                       [4] XPDL XML Process Definition Language,
method must have the same name of the activity, preceeded by the           http://www.wfmc.org/standards/xpdl.htm
prefix “execute” (execute).                       The
workflow engine is in charge of invoking that method when the          [5] Shapiro, R. 2002. A comparison of XPDL, BPML and
activity is visited.                                                       BPEL4WS (Rough Draft), Cape Vision
In the same way, the registerTransition() method takes                 [6] BPMN Business Process Modeling Notation
a transition instance as parameter. For transitions with conditions,       http://www.bpmn.org/
the boolean expression to be evaluated by the workflow engine
                                                                       [7] G. Caire “WADE: An Open Source Platform for Workflows
is specified in a boolean method that has same name of the
                                                                           and Agents”
condition,        preceeded     by       the     prefix     “check”
(check).                                                     http://jade.tilab.com/wade/doc/tutorial-aamas2008.zip
An important feature of the object-oriented programming                [8] Caire G., Gotta D., Banzi “WADE: A software platform to
languages is the possibility to reuse the code by means of                 develop mission critical applications exploiting agents and
inheritance mechanisms. In order to bring the programming                  workflows”, M., Proc. of 7th Int. Conf. on Autonomous
languages power also to the workflow representation, it has been           Agents and Multiagent Systems (AAMAS 2008) – Industry
choosen to provide the workflow with the inerithance mechanism             and Applications Track, Berger, Burg, Nishiyama (eds.),
too. Therefore it is possible to define a new workflow extending           May, 12-16., 2008, Estoril, Portugal, pp. 29-36.
an old one, and then adding/removing activities and transitions.       [9] “WADE User Guide”
The overriding of methods associated to the activities and to the
                                                                            http://jade.tilab.com/wade/doc/WADE-User-Guide.pdf
conditions of transitions is also permitted.
                                                                       [10] G. Caire, M. Porta, E. Quarantotto, G. Sacchi “ Wolf – An
4.          CONCLUSIONS                                                     Eclipse Plug-in for WADE”
In this paper we described WADE, an open source framework to
develop distributed applications based on the agent programming
paradigm. WADE is based on JADE and in particular adds to it