AnsweredAssumed Answered

How to access a custom bean variable in an XML condition expression ?

Question asked by cnirparis on Jun 3, 2014
Latest reply on Jun 4, 2014 by jbarrez
Hello everyone.

I launch programmatically the tasks of my BPMN workflow (so I don't use JavaDelegate in my classes). I have made a java bean for passing variables from task to task (and that I get from a processInstanceQuery).
I set a boolean variable in my bean in a Java program.
The problem I have is that I'm not able to test this in a XML level, in a condition sequence flow like this one :

      <sequenceFlow id="flowRejet" name="Rejet" sourceRef="exclusivegateway1" targetRef="CorrectionErrorTask">
        <conditionExpression xsi:type="tFormalExpression"><![CDATA[${mybean.myvalue == false}]]></conditionExpression>

I get

Exception in thread "main" org.activiti.engine.ActivitiException: Unknown property used in expression: ${mybean.myvalue == false}

I've added this to my activiti.cfg.xml  :

  <bean id="mybean" class="mypackage.mybean"></bean>

and this to my processEngineConfiguration bean

    <property name="beans">
         <entry key="mybean" value-ref="mybean" />

without any success. I suspect Activiti engine cannot "see" my bean, or perhaps there is a bad syntax in my condition expression ?

Thank you  if you have an answer.