Page 1 of 1

using jbpm drools Rule/workflow engine

Posted: Thu Nov 08, 2012 8:10 am
by basavarajvs
hi,
I am new to broadleaf and I was evaluating if we can use jbpm/drools as workflow engine instead of the workflow engine provided by broadleaf. Has anybody tried this.

Re: using jbpm drools Rule/workflow engine

Posted: Tue Dec 11, 2012 3:54 am
by phillipuniverse
I don't really have experience with JBPM, but after a quick glance I don't think it would be too bad. If you already have all of your workflow configured there (like what should happen on checkout or when adding an item to your cart) you would just need a hook point into the Broadleaf workflows to execute your JBPM workflow. You could override the default Broadleaf workflows to have a single Activity that kicks off your JBPM process:

Code: Select all

   <bean id="blUpdateItemWorkflow" class="org.broadleafcommerce.core.workflow.SequenceProcessor">
      <property name="processContextFactory">
         <bean class="org.broadleafcommerce.core.order.service.workflow.CartOperationProcessContextFactory"/>
      </property>
      <property name="activities">
         <list>
            <bean class="com.mycompany.core.activity.UpdateItemJBPMActivity"/>
         </list>
      </property>
      <property name="defaultErrorHandler" ref="blDefaultErrorHandler"/>
   </bean>


And then your activity might look like:

Code: Select all

public class UpdateItemJBPMActivity extends BaseActivity {
    public 
ProcessContext execute(ProcessContext contextthrows Exception {
        
//kick off the JBMP process from here
    
}
}
 


However, you might check out the activities that are included in the default workflows to see which ones you want to include/exclude as some parts are necessary for Broadleaf to function correctly. Again, this is about a 5-minute assessment without knowing specifically how you're intending to use it.