Examples
OBE provides some example workflows which illustrate the various
XPDL capabilities and OBE extensions.
- Document
Approval
- A workflow that automates the approval chain for a piece of
sales or marketing collateral. It shows a chain of activities performed
by humans with the aid of a browser-hosted worklist
handler and a WebDAV document repository.
- New Employee
- A workflow that automates IT provisioning for a new
employee by invoking a series of enterprise services.
- Enterprise Application
Integration
- A fully-automated straight-through ('STP') data
transformation process. A workflow is triggered by an inbound XML
message which it transforms using
XSLT then forwards to an external destination.
- Travel Bookings
- A workflow that automates composite travel bookings.
Illustrates
compensating transactions for long-running business transactions
(sagas).
- WfMC Sample Workflow
- The WfMC's Sample
Workflow Process. This is a sales order processing scenario
where customers pay either by credit card or credit account.
Deployment and Execution
The example workflows can either be executed by the basic workflow
engine or by the J2EE workflow server. The shell scripts are all in
$OBE_HOME/bin
and can either be
executed from a console window or invoked directly by clicking on them in your
OS's
native graphical file explorer.
Tip: When working from a console window,
cd to the $OBE_HOME/bin
directory and
establish the OBE client environment for your
shell by executing .\obeinit
(Windows) or
. ./obeinit
(Unix/Linux).
Having done this you can then change to other directories and
execute OBE scripts directly without having to provide qualified
paths.
Basic Workflow Engine
- Select the example configuration by executing
examples
.
- Start the command line
worklist
by executing
clworklist
.
- Set the client protocol to
local
(menu
option 1).
- Connect to OBE (menu option 2). This will start a local, in-memory copy of
the workflow engine.
- The example workflows will all be deployed automatically because the
BasicProcessRepository
scans and auto-deploys *.xpdl
files in the $OBE_HOME/examples/config/processes
directory.
- To start a workflow manually:
- Navigate to
Workflow Processes
(menu option 4).
- Instantiate the process of your choice (menu option 2).
- Provide workflow startup data (the 'formal parameters').
- Quit back to the main menu.
- To start an event-triggered workflow:
- Copy/paste or drag/drop a data file from
$OBE_HOME/examples/etc/*
to the
$OBE_HOME/examples/config/events
directory (being sure to hold
down the control key to copy the file rather than move it).
- The
BasicApplicationEventBroker
should detect and read the
file, raising the event and instantiating the workflow.
- Navigate to
Worklist
(menu option 5) then list and execute
work items as appropriate to the workflow.
J2EE Workflow Server
- Configure the application server and deploy
$OBE_HOME/j2ee/lib/
obeserver.ear
.
- Select the example configuration by executing
examples
.
- Start the application server by executing
startas
.
- Start the command line
administrator
by executing
cladmin
.
- Set the client protocol to rmi
(menu option 1)
- The
JNDI Factory
should be correct for your application
server. If it is not, this means you didn't configure OBE properly. You
are recommended to quit and re-run $OBE_HOME/prepare
,
specifying appropriate properties.
- Connect to OBE (menu option 2). This will create a remote connection to the
workflow server.
- When prompted, supply
Host URL
, User ID
and
Password
. If the defaults are not correct you can quit and
re-run $OBE_HOME/prepare
, specifying appropriate
properties, or you can simply type them in.
- Navigate to
Process Definitions
(menu option 4).
- For each workflow you wish to work with:
- Import the appropriate XPDL package (menu option 3). The example
workflows are located in the
$OBE_HOME/examples/config/processes
directory. You can drag/drop
the file from a graphical explorer window onto the console window to
save typing the file name in.
- Start your web browser and point it to the OBE Web Worklist
at http://localhost:8080/obeworklist/
(substituting an appropriate host name and port, depending on your
application server). Log in as the workflow participant whose role you
wish to assume. If you log in as '
system
' (default password '
password
'), you will have access to all functionality.
- To start a workflow manually:
- Click on the
Processes
link.
- Click on the
ID
of the process of your choice then click on
Instantiate
.
- Provide workflow startup data ('formal parameters') as prompted.
- To start an event-triggered workflow:
- Send a data file to the OBE JMS application event queue by executing the
send
shell script from
$OBE_HOME/examples/etc/*
,
supplying the file name as an argument.
- The EJB
ApplicationEventBroker
will receive the data through JMS, raising
an application event and instantiating the workflow.
- Once the workflow is started, you can explore its attributes, activity
instances and their associated work items, executing and/or marking
them complete and thereby drive the process instance to completion.
- To view the audit trail for a work item, activity or process
instance, click on the corresponding 'History' link in the Web Worklist
or execute the 'History' command in the Command Line Worklist.
Manual vs. Triggered Process Instantiation
Most of the example workflows can be either started manually using a
worklist handler client or triggered by an asynchronous application
event. Typically the <WorkflowProcess>
declares at least one
<FormalParameter>
,
meaning that the corresponding process attribute must be assigned a
value before a newly created process instance can be started.
Event-triggerable workflows initialize this mandatory process attribute
from an OUT-mode event parameter.
Execution Tracing
OBE uses Log4J via Apache Commons Logging to log workflow enactment
activity. You can enable DEBUG-level logging to see the fine detail of
workflow, activity and work item execution, by setting the logging
level in log4j.properties
thus:
# OBE engine.
log4j.logger.org.obe.engine=DEBUG
# OBE repositories.
log4j.logger.org.obe.engine.repository=DEBUG
# OR simply enable all OBE logging:
log4j.logger.org.obe=DEBUG
Alternatively you can set the logging level via JMX if your application
server supports it. JBoss does; you can access the Log4J Service's MBean
via the JBoss JMX web console.
Viewing and Editing the Example
Workflows
You may wish to open the example workflows in a purpose-written XPDL editor
such as Enhydra's JaWE
in order to follow the process descriptions more clearly. The JPEG
images in this documentation show the activity/transition networks but
lack some important details.
Feel free to experiment by editing and redeploying the example
workflows. You can either just edit the raw XML in a text editor, or
use a generic syntax-directed XML instance editor, or use JaWE. You can edit the
workflow in place (i.e., at $OBE_HOME/examples/config/processes
)
but you might wish to make a backup copy in a different directory before
changing anything. The BasicProcessRepository
in the basic OBE configuration will detect changed changed process
definitions
and automatically redeploy them. If you are running
the OBE J2EE Server configuration it will be necessary to manually
redeploy using the cladmin
client (it is not recommended to use the
BasicProcessRepository
in the J2EE server configuration because the former uses Java file I/O
and allocates threads, both of which techniques are expressly forbidden to EJBs
by the J2EE
specifications).
Credits
John Wiley & Sons
The Document Approval
and New Employee
workflows are reproduced with kind permission from
John Wiley & Sons. They were developed by OBE's author Adrian
Price as a contribution to the recent
publication:
Workflow Management Coalition
The WfMC Sample Workflow
is reproduced with kind permission from the Workflow Management Coalition.
Enhydra Community
The workflow diagrams were created with the use of the Open Source Java
Workflow Editor - JaWE. Many thanks to the Enhydra team for
graciously making a few changes to enable JaWE to
support OBE.
Definitions
- WebDAV
- Web-based Distributed Authoring and Versioning, an HTTP
extension protocol supported by word processors etc. See http://www.ietf.org/rfc/rfc2518.txt
- XFORMS
- XML Forms language, the W3C's powerful successor to
traditional HTML forms. See http://www.w3.org/TR/xforms
- XSL
- Extensible Stylesheet Language, for transforming XML
documents. See http://www.w3.org/Style/XSL/
- WSDL
- Web Service Description Language. See: http://www.w3c.org/2002/ws/