Wednesday, June 23, 2010

Enterprise jBPM v3.2.5-SP5 running on JBoss EAP v5 howto

This article will provide you with the pointers and tips needed to extract the jBPM framework from the latest JBoss SOA Platform product and get it running on the latest JBoss EAP v5 product. Why would you want to do this? Well for one thing, imagine you want to slim down your JBoss SOA Platform to remove the unused services (such as Rules or the ESB components) and just run the included JBoss EAP, then this is the guide for you.

# This guide assumes you have installed JBoss SOA-P v5 and JBoss EAP v5.
# You will want to copy the jBPM component to your JBoss EAP installation
# as follows for a Linux machine (unix commands). 
# 
$ cp -ruv $JBOSS_SOA_HOME/jbpm-jpdl/deploy/server/default/deploy/jbpm \
$JBOSS_EAP_HOME/jboss-as/server/default/deploy

# Now we need to edit some of the configuration details to sort out the
# missing queues and security issues for logging into jBPM console.
#
# First we need to replace the existing queue definitions in 
# jboss-as/server/default/deploy/jbpm/jbpm-mq-service.xml with:
#

 
    jboss.messaging:service=ServerPeer
    jboss.messaging:service=PostOffice
  

 
    jboss.messaging:service=ServerPeer
    jboss.messaging:service=PostOffice
  

# now we setup $JBOSS_EAP_HOME/jboss-as/server/default/conf/login-config.xml
#
 
      
         
            java:/JbpmDS
            
            
             SELECT PASSWORD_ FROM JBPM_ID_USER WHERE NAME_=?

            
            
             SELECT g.NAME_ ,'Roles'
             FROM JBPM_ID_USER u,
                  JBPM_ID_MEMBERSHIP m,
                  JBPM_ID_GROUP g
             WHERE g.TYPE_='security-role'
               AND m.GROUP_ = g.ID_
               AND m.USER_ = u.ID_
               AND u.NAME_=?

            
         
      
   

# but now the hsqldb is not being created properly, so add this too by copying
# $JBOSS_SOA_HOME/jbpm-jpdl/deploy/docs/examples/jbpm/hibernate.cfg.hsqldb.xml
# to 
# $JBOSS_HOME/jboss-as/server/default/deploy/jbpm/jbpm-service.sar/hibernate.cfg.xml
# and modify changing the following:
#
java:JbpmDS

# and uncomment:
#
create

# to adjust the jbpm-console authorization to use the JBoss JMX auths adjust
# the file jbpm/jsf-console.war/WEB-INF/jboss-web.xml
#
java:/jaas/jmx-console
jbpm-console

# adjust jbpm/jsf-console.war/WEB-INF/web.xml to add JMX credential roles:
#
  
  
    
      Secure Area
      /app/*
      GET
      POST
    
    
      user
      admin
      JBossAdmin
    
  

Now startup the server and enjoy your jBPM within your JBoss EAP!