0 Replies Latest reply on Sep 15, 2007 5:38 AM by Michael Schwartz

    Transition script bug

    Michael Schwartz Newbie


      Seems there is a bug in jBPM 3.2.1 when using Scripts in Transistions. I wrote a script condition for a transition like this one:

      new Boolean(DataObject.hasNode("Connector.Xml.Data.idx.request.signoff"));

      hasNode returns boolean (integral type), so I convert this to Boolean.

      jBPM though answers with

      org.jbpm.JbpmException: transition condition new Boolean(DataObject.hasNode("Connector.Xml.Data.idx.request.sign
      on")); evaluated to non-boolean: java.lang.String

      I found in JbpmExpressionEvaluator in line 39 the following code:
      result = evaluator.evaluate(dollarExpression, Object.class, usedVariableResolver, functionMapper);

      which should be imho:
      result = evaluator.evaluate(dollarExpression, Boolean.class, usedVariableResolver, functionMapper);

      I am not able to test the changes, but it might be necessary to change also the method convertStaticValueToExpectedType() in ExpressionEvaluatorImpl

      greetings from Austria,