jBpm API Introduction

.

Services

The main package for using jBpm is org.jbpm This package contains all the service interfaces. jBpm has defined the services based upon the WfMC reference model. This means :

Configuration

To obtain these services you need a {@link org.jbpm.JbpmServiceLocator}. The easiest way to obtain a JbpmServiceLocator is by using the static {@link org.jbpm.JbpmServiceLocator#getInstance()} method.

A JbpmServiceLocator requires a {@link org.jbpm.JbpmConfiguration}. The default constructor of JbpmServiceLocator will just use the JbpmConfiguration singleton instance. The JbpmConfiguration can be configured in different ways. The easiest way is to put a jbpm.properties in the root of your classpath. The content of the jbpm.properties file is explained in {@link org.jbpm.JbpmConfiguration}.

Usage


// this code fragment shows how to use the jbpm execution service

// the next statement requires a jbpm.properties file in the root of the classpath
JbpmServiceLocator jbpmServiceLocator = JbpmServiceLocator.getInstance();

// the next line opens an execution service for user JohnDoe.
ExecutionService executionService = jbpmServiceLocator.openExecutionService("JohnDoe");
executionService.startProcessInstance("payraise");
executionService.close();
example of how to use the jBpm execution services