13 Replies Latest reply on Mar 1, 2007 2:15 PM by Jeff DeLong

    streching the expression language

    Tom Baeyens Master

       

      "Jeff" wrote:
      Tom,

      I have two problems with this process model.

      1) does not like <= , complains that it must not contain the '<' character. But this is legit in the JSF expressions guide.

      2) even if I change to LT, the Yes transition is always taken, no matter the value of basePrice. However if I switch the order of the transitions in the file, the No transition is taken. This remains the case if the value of basePrice is greater than 300.

      I have used similar expression before with success (well not the <), so I am not sure what is going on here. basePrice is an int, if that makes a difference. I can print out the value of basePrice, and know that has been set correctly (by JBoss rules). Changing basePrice from an int to an Integer or String does not help.

      Any ideas?

      Thanks,

      Jeff



      <?xml version="1.0" encoding="UTF-8"?>
      
      <process-definition
       xmlns="urn:jbpm.org:jpdl-3.2" name="InsuranceProcess">
       <start-state name="start">
       <transition name="" to="Execute Underwriting Rules"></transition>
       </start-state>
       <node name="Execute Underwriting Rules">
       <action class="org.jbpm.action.RulesActionHandler">
       <ruleFile>pricing/PolicyPricing.xls</ruleFile>
       <ruleFileType>XLS</ruleFileType>
       <objectNames>
       <element>driver</element>
       <element>policy</element>
       </objectNames>
       </action>
       <transition name="" to="Manual Review Required?"></transition>
       </node>
       <decision name="Manual Review Required?" >
       <transition name="No" to="end">
       <condition expression="#{policy.price LT 300}" />
       </transition>
       <transition name="Yes" to="Underwriter Signoff">
       <condition expression="#{policy.price > 300}" />
       </transition>
       </decision>
       <task-node name="Underwriter Signoff">
       <task name="Underwriter Signoff">
       <assignment class="org.jbpm.assignment.RulesAssignmentHandler">
       <ruleFile>/Assignment.drl</ruleFile>
       <group>underwriter</group>
       <objectNames>
       <element>policy</element>
       </objectNames>
       </assignment>
       </task>
       <transition name="" to="end"></transition>
       </task-node>
       <end-state name="end"></end-state>
      </process-definition>


      Maybe it has to do with the fact that i took and tweaked some older version (pre-unified-expression-language) from the apache commons stuff.

      I have not yet been able to get the same things out of the EL RI. Once I get that to work properly it could replace the commons EL and solve these problems.

      I'm a bit afraid of the backwards incompatibility, though. Now I have this abstraction of method binding and value binding. If the expression is used to get a value and a method is given, then the return value of the method is taken. Something that will probably be hard to get in the RI of EL.

      regards, tom.