Windows Workflow Foundation (WWF): Brief Concepts.

This Post intends to be a little first look at Windows Workflow Foundation, with general descriptions and comments. We´ll be adding some WWF Stuff later on.

There is a version in spanish available here.

Definition: WWF is a model which objective is to develop and
to integrate workflows: a network of activities and conditions that describe a complete business process with software and people actions. The term of "workflow" is
important because unlike the one of "orquestation", it doesn´t only talks about
software work coordination, else, it also includes human work coordination.

Architecture: An application that works like Host (Windows
console, Windows forms, etc.) that it uses the "Worflow Runtime
Engine" (WRE) to instanciate one or more workflows. The Host process
provides services to persist the state of workflows, to handle the transactions
and other functions. Each workflow is made up of activities:



They are units of execution and reusability which
solves a defined problem. WWF provides a set of basic activities (Base Activity
Library) like ifElse/Code, etc but it gives the developer the chance to create
others like sendMail, createCustomer, etc…

Activities are implemented in classes: they manage
inheritance, and can contain many others activities and of course they are reusable.

Within Base Activity Library, we can found the most relevant

  • Code: it executes C # code of customized actions.
  • EventDriven: it represents a succession of activities whose
    execution is initiated by an event.
  • EventSink: it allows the workflow to receive information of
    Data Exchange Service (DES) registered in workflow Runtime.
  • Invoke Method: it allows workflow to invoke a method in the
    interface to send messages to the DES.
  • Invoke WebService: it allows workflow to invoke a Web-service.
  • Invoke workflow: it allows workflow to calls or start another workflow within the "Fire & Forget" model.
  • Select Data: it
    allows workflow to make queries through host indirectly.

Workflow Models: we have 2 existing workflow models: "sequential" and "state machine".

The sequential model executes activities with a predefined pattern
while state machine model only knows about the possible states the system may have, what they do, and what external events they respond to (here, the usual is having sequential-workflow logic).

Sequential Workflow exampleState Machine Workflow example 

Consuming Data and Communications:
There are two ways of consuming data in a workflow: through parameters and events. The parameters are defined manually in the workflow settings and the events that rise from host are attended by the workflow with EventDriven activity. On the other hand workflows can communicate calling Web services and can also be exposed like such being used by other applications, etc.

Leave a Reply