Friday, September 2, 2011

JBPM and JEXL Integration

Following steps need to perform to configure the JEXL as a expression language for the JBPM.


1) Create a jbpm.default.scriptmanager.xml file.
     File contains following tag.

<?xml  version="1.0" encoding="UTF-8" ?>
<jbpm-configuration>
<process-engine-context>
<script-manager default-expression-language="jexl" default-script-language="jexl">
<script-language name="jexl" 
    factory="org.apache.commons.jexl2.scripting.JexlScriptEngineFactory" />
<script-language name="juel" factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
<script-language name="bsh" factory="org.jbpm.pvm.internal.script.BshScriptEngineFactory" />
<script-language name="groovy"
   factory="org.jbpm.pvm.internal.script.GroovyScriptEngineFactory" />
</script-manager>
</process-engine-context>
</jbpm-configuration>


2) Import jbpm.default.scriptmanager.xml file into jbpm.default.cfg.xml file.
3) For the decision node specify the condition as follows.

  <decision name="evaluate document">
    <transition to="submit document">
      <condition expr="content=='good'" lang="jexl" />
    </transition>
    <transition to="try again">
      <condition expr="content=='not so good'" lang="jexl"/>
    </transition>
    <transition to="give up" />
  </decision>

1 comment:

  1. It is very useful information about JBPM Integration for all and it is very simple to understand. Thanks for sharing it.

    ReplyDelete