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

Adding Code to our Definition


This section is about customizing and adding functionality to our XML OSWorkflow process definition. Both classic Java code and BeanShell scripts are available to extend and enhance the business process.

FunctionProviders

During execution and transitioning of the workflow instance you may need to execute code specific to your application or custom functionality. OSWorkflow provides a way to do so, through the use of FunctionProvider.

The FunctionProvider can be a regular Java class, an EJB, or a BeanShell script. OSWorkflow has several useful built-in functions that you can use in your definition.

Creating our first FunctionProvider

Defining a Java FunctionProvider is very easy; all you need to do is implement the com.openshymphony.workflow.FunctionProvider interface. A sample FunctionProvider that simply prints its arguments is shown in the following code snippet:

package packtpub.osw;
import java.util.Map;
import com.opensymphony.module.propertyset.PropertySet...