Book Image

OSWorkflow: A guide for Java developers and architects to integrating open-source Business Process Management

Book Image

OSWorkflow: A guide for Java developers and architects to integrating open-source Business Process Management

Overview of this book

OSWorkflow is an open-source workflow engine written entirely in Java with a flexible approach and a technical user-base target. It is released under the Apache License. You can create simple or complex workflows, depending on your needs. You can focus your work on the business logic and rules. No more Petri Net or finite state machine coding! You can integrate OSWorkflow into your application with a minimum of fuss. OSWorkflow provides all of the workflow constructs that you might encounter in real-life processes, such as steps, conditions, loops, splits, joins, roles, etc.This book explains in detail all the various aspects of OSWorkflow, without assuming any prior knowledge of Business Process Management. Real-life examples are used to clarify concepts.
Table of Contents (13 chapters)
OSWorkflow
Credits
About the Author
About the Reviewers
Introduction

Embedding OSWorkflow into your Application


OSWorkflow can be embedded in any application whether it's J2SE or JEE based by simply including the osworkflow.jar file into the classpath of the application. In any case, you must have the osworkflow.xml file, any referenced resources such as workflows.xml, and the XML of the process in the classpath. In this case, the workflow descriptor name is holiday.xml.

Starting a Workflow

Imagine you have an application that interfaces with OSWorkflow, and you'd like to instantiate a new Workflow. This is as easy as:

Workflow wf = new BasicWorkflow("johndoe");
Long id = Wf.initialize("holiday", 1, null);

The first line creates a new BasicWorkflow with the current username as parameter. BasicWorkflow objects are heavyweight and it is reasonable to have one instance per user to avoid the creation cost.

The second line executes the initialize() method with the workflow name as the first parameter, the initial action number as the second parameter, and the actions...