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 context) throws Exception {
}
}
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.