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

Integration with OSWorkflow


This section discusses the Esper integration with OSWorkflow to process business event data and react with user-defined patterns.

Esper Function Provider

To enable Esper functionality inside an OSWorkflow definition, we must create a way to emit events from OSWorkflow into the Esper engine.

OSWorkflow can provide this extension via a custom FunctionProvider. This FunctionProvider will emit events into the engine. The code for the class is as follows:

package packtpub.osw.cep;
import java.util.Map;
import net.esper.client.*;
import com.opensymphony.module.propertyset.PropertySet;
import com.opensymphony.util.BeanUtils;
import com.opensymphony.workflow.FunctionProvider;
import com.opensymphony.workflow.WorkflowException;
/**
* Function provider that sends an event to the esper engine.
*/
public class PushEventFunctionProvider implements FunctionProvider
{
public void execute(Map transientVars, Map args, PropertySet ps)
throws WorkflowException
{
// the event POJO...