4 Replies Latest reply on Nov 8, 2013 11:16 AM by marcos.sousa

    [Q] JBPM 4.3 to 4.4 Upgrade Issue

    khoying

      I have recently upgraded my JBPM implementation from 4.3 to 4.4.  However, this has caused a significant problem for me.

       

      As part of my process definition I have the following decision defined:

       

      <decision g="901,209,48,48" name="decision.supplierInitApprover">
            <handler expr="#{jbpmDecideHasSupplierApprover}"/>
      
            <transition g="-50,-18" name="result.approver" to="state.supplierInitApproval"/>      
            <transition g="30,-80" name="result.noApprover" to="state.memberReview">
      </decision>
      
      

       

      I am expecting the handler expression to be resolved using the Juel script engine as it is my default (and only) script language that I have configured.  However since upgrading to 4.4 it appears that this is no longer being resolved by Juel.

       

      Reviewing the source code, I notice there has been a change in the ObjectDescriptor.construct() method that is causing my issue.

       

      In 4.3, it resolved the expression by the following:

       

      Line 180:

      } else if (expr!=null) {
            ScriptManager scriptManager = ScriptManager.getScriptManager();
            object = scriptManager.evaluateExpression(expr, lang);
          }

       

      In 4.4 it resolves the expression by the following:

       

      Line 176:

      } else if (expression!=null) {
            object = expression.evaluateInScope(wireContext.getScopeInstance());
          }

       

      Does anyone know how I can fix my problem and have JBPM 4.4 use the ScriptManager and Juel once again?

       

      Thanks in Advance!

      Ken

        • 1. Re: [Q] JBPM 4.3 to 4.4 Upgrade Issue
          rebody

          Hi Ken,

           

          In jBPM-4.4,  the expr attribute will always be handled by org.jbpm.pvm.internal.el.Expression.  It won't use ScriptManager directly.

           

          But the Expression used juel to resovle the expr attribute.  So in fact, we still used juel to resovle expr attribute in jbpm-4.4 by default.  And the behaviour between jbpm-4.3 and jbpm-4.4 is exactly the same.

           

          Could you show us what wrong about using expr in jbpm-4.4.  Maybe we could find a way to handle it.  Thank you very much.

          • 2. Re: [Q] JBPM 4.3 to 4.4 Upgrade Issue
            khoying

            Thank you for the assistance.

             

            In the expression below,  jbpmDecideHasSupplierApprover is a Spring bean.  We have integrated Spring with our JBPM inplementation.

             

            <decision g="901,209,48,48" name="decision.supplierInitApprover">
                  <handler expr="#{jbpmDecideHasSupplierApprover}"/>
            
                  <transition g="-50,-18" name="result.approver" to="state.supplierInitApproval"/>      
                  <transition g="30,-80" name="result.noApprover" to="state.memberReview">
            </decision>
            
            

             

             

            We had difficulty getting JBPM to see our entire Spring context.  Our Spring configuration is broken into several files and for some reason JBPM will only see the configuration and the beans in the file that it was created or loaded in.

             

            As a result, We made a small extension to the Juel Script Engine and the configuration in order to expose out entire Spring context.  This all worked great until we upgraded.

             

                 <script-manager default-expression-language="juel" default-script-language="juel"
                                    read-contexts="execution, environment, process-engine, spring, springSca" write-context="">
                          <script-language  name="juel" factory="com.premierinc.sca.agreement.util.ScaJuelScriptEngineFactory" />
                 </script-manager>
            

             

            Any help would be GREATLY appreciated!  We could really use the new API features of 4.4 to be able to determine the transitions dynamically.  However, if we have to give up Spring intergration then it is no longer viable.

             

            Ken

            • 3. Re: [Q] JBPM 4.3 to 4.4 Upgrade Issue
              mwohlf

              not sure if this helps:

              the read-contexts and write-context attributes are deprecated in jBPM4.4 in the script-manager tag.

              • 4. Re: [Q] JBPM 4.3 to 4.4 Upgrade Issue
                marcos.sousa

                Hi Ken,  Can you share with me your com.premierinc.sca.agreement.util.ScaJuelScriptEngineFactory.java?  If it is confidentially please send it to me to marcosvasousa at gmail.com