Spring and jBPM 4.3

Instead of using the following old jBPM 4.0 way, to inject those beans :

<bean id="jbpmConfiguration" p:sessionFactory-ref="sessionFactory">
  <constructor-arg value="jbpm.cfg.xml" />
<bean id="processEngine" factory-bean="jbpmConfiguration"
      factory-method="buildProcessEngine" />
<bean id="taskService" factory-bean="jbpmConfiguration"
      factory-method="getTaskService" />
<bean id="repositoryService" factory-bean="jbpmConfiguration"
      factory-method="getRepositoryService" />
<bean id="executionService" factory-bean="jbpmConfiguration"
      factory-method="getExecutionService" />
<bean id="historyService" factory-bean="jbpmConfiguration"
      factory-method="getHistoryService" />
<bean id="managementService" factory-bean="jbpmConfiguration"
      factory-method="getManagementService" />

jBPM 4.3 has a new Spring integration configuration :

<bean id="springHelper">
  <property name="jbpmConfiguration" value="jbpm.cfg.xml"/>
<bean id="processEngine" factory-bean="springHelper" 
      factory-method="createProcessEngine" />

In java classes, you can simply use :

private ProcessEngine processEngine;
ExecutionService executionService = processEngine.getExecutionService();

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s