Red Hat Training

A Red Hat training course is available for JBoss Enterprise SOA Platform

Chapter 14. Configuring jBPM

14.1. jBPM

The JBoss Business Process Manager (jBPM) is a workflow management tool that provides the user with control over business processes and languages. jBPM 3 is used as default.

14.2. jBPM 3 and JBoss Enterprise SOA Platform Integration

The default way in which the JBoss Enterprise SOA Platform integrates with jBPM 3 is via the JMS/JCA-Inflow:
<service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" /> 
<service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" /> 

<bean name="jbpm.job.executor" class="org.jbpm.job.executor.JobExecutor"> 
    ...
</bean>
JMS/JCA inflow is the only supported jBPM/ESB integration configuration for the JBoss Enterprise SOA Platform. The jbpm.esb only provides support for the JBoss Messaging JMS provider.

Important

The jBPM enterprise module is not supported. (This consists of message and scheduler services based on JMS and EJB timers respectively.)
The simulation module is also unsupported. (This is a process analysis and optimization tool.)

14.3. Change the jBPM Integration Service

Procedure 14.1. Task

  1. Go into the jbpm.esb archive's config directory.
  2. Locate the configuration file for the service you want to use.
  3. To replace the active configuration, remove the one found in the jbpm.esb directory and replace it with the configuration file you wish to use (having first removed the .config suffix from its name).

14.4. jBPM Job Executor

The jBPM Job Executor is a web listener. It is only supported if the Enterprise Service Bus is not deployed on the execution.

14.5. Configure the jBPM Job Executor

Procedure 14.2. Task

  1. To use the jBPM Job Executor in a web application, open the application's web.xml file in a text editor and add the following code:
              
    <!-- Job executor launcher -->
    	<listener>
    		<description>
    			Starts the job executor on initialization and stops it on destruction.
    		</description>
    			<listener-class>org.jbpm.web.JobExecutorLauncher</listener-class>
    	</listener>
    <!-- Job executor launcher -->
    
  2. Save the file and exit.

14.6. Use a Remote Java Message Service Provider

If you want to make the JMS-based message and scheduling services reference remote JMS providers, you must add a provider adapter configuration for the local JNDI.

Note

The provider adapter is an instance of JMSProviderAdapter, as used within the standard application server's JCA Inflow configuration.

Procedure 14.3. Task

  1. Open a service.xml file in a text editor and add an MBean to it

    Note

    You can either make this specific to the jBPM (adding it to the jbpm-service.xml file) or it can be shared with other JCA inflow configurations.
    The following example code creates a provider adapter which refers to a remote JMS provider executing at this address: 192.168.1.1:1099.
          
    <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
    name="jboss.messaging:service=JMSProviderLoader,name=RemoteProviderLoader">
       <attribute name="ProviderName">RemoteProviderAdapter</attribute>
       <attribute
    name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
       <attribute name="QueueFactoryRef">XAQueueConnectionFactory</attribute>
       <attribute name="TopicFactoryRef">XATopicConnectionFactory</attribute>
       <attribute name="Properties">
          java.naming.provider.url=192.168.1.1:1099
       </attribute>
    </mbean>
    

    Note

    Use the value set for the Properties attribute to create the InitialContext for the JNDI.
  2. Provide references to the provider adapter within the JMSMessageServiceFactory file. Open it in a text editor: vi JMSMessageServiceFactory
  3. Add the location of the JNDI in the providerAdapterJNDI field:
          
    <service name="message">
      <factory>
        <bean
    class="org.jboss.soa.esb.services.jbpm.integration.msg.JmsMessageServiceFactory">
          <field name="providerAdapterJNDI"><string
    value="RemoteProviderAdapter"/></field>
        </bean>
      </factory>
    </service>
    
  4. Save the file and exit.
  5. Provide references to the provider adapter within the JMSSchedulerServiceFactory file in a text editor: vi JMSSchedulerServiceFactory
  6. Add the location of the JNDI in the providerAdapterJNDI field.
  7. Save the file and exit.