[rules-users] accessing hashmap from condition on decision table

Sascha Sascha.Janz at gmx.net
Thu Dec 4 06:01:22 EST 2008


thank you!!! 

i wrote 

eval(workflowData.getValue("KST").equals("$1")) 

in the column header of the excel sheet and now i got what i want!!!

----- Original Message ----- 
  From: Knapp, Barry 
  To: Rules Users List 
  Sent: Wednesday, December 03, 2008 6:19 PM
  Subject: RE: [rules-users] accessing hashmap from condition on decision table


  An eval needs to evaluate to true or false, such as 

   

  eval(myMapWrapper.get("KEY").equals("SOME_VALUE"))

   

  Barry

   

   

   

  From: rules-users-bounces at lists.jboss.org [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Sascha
  Sent: Wednesday, December 03, 2008 11:49 AM
  To: Rules Users List
  Subject: Re: [rules-users] accessing hashmap from condition on decision table

   

  thank you for response

   

  i typed eval(wrapper.getValue("KEY")) in the header of the excel column

   

  but i get

   

  org.drools.rule.InvalidRulePackage: [7,63]: unknown:7:63 mismatched token: [@33,182:183='==',<76>,7:63]; expecting type RIGHT_PAREN[16,63]: unknown:16:63 mismatched token: [@71,353:354='==',<76>,16:63]; expecting type RIGHT_PAREN[25,63]: unknown:25:63 mismatched token: [@109,524:525='==',<76>,25:63]; expecting type RIGHT_PAREN[34,63]: unknown:34:63 mismatched token: [@147,695:696='==',<76>,34:63]; expecting type RIGHT_PAREN[43,63]: unknown:43:63 mismatched token: [@185,866:867='==',<76>,43:63]; expecting type RIGHT_PAREN[52,63]: unknown:52:63 mismatched token: [@223,1035:1036='==',<76>,52:63]; expecting type RIGHT_PAREN[61,63]: unknown:61:63 mismatched token: [@261,1204:1205='==',<76>,61:63]; expecting type RIGHT_PAREN

  at org.drools.rule.Package.checkValidity(Package.java:424)

  at org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:394)

  at com.sample.DroolsExcelTest.readRule(DroolsExcelTest.java:66)

  at com.sample.DroolsExcelTest.main(DroolsExcelTest.java:22)

    ----- Original Message ----- 

    From: Knapp, Barry 

    To: Rules Users List 

    Sent: Wednesday, December 03, 2008 2:14 PM

    Subject: RE: [rules-users] accessing hashmap from condition on decision table

     

    You may want to wrap your map in another class that you assert into the engines working memory.

     

    Then you can access the contents of the map with an eval

     

    eval(myMapWrapper.get("KEY").equals("SOME_VALUE"))

     

     

    Barry

     

     

    From: rules-users-bounces at lists.jboss.org [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Sascha
    Sent: Wednesday, December 03, 2008 7:32 AM
    To: Rules Users List
    Subject: [rules-users] accessing hashmap from condition on decision table

     

    i got a java class with a hashmap containing string keys and values.

     

    i want to access the values from a condition on a decision table. 

     

    e.g. map.get("mykey") 

     

    how can i do this?

     

    i tried but got an 

    unknown:7:50 Unexpected token

    error.

    greetings sascha


----------------------------------------------------------------------------

    _______________________________________________
    rules-users mailing list
    rules-users at lists.jboss.org
    https://lists.jboss.org/mailman/listinfo/rules-users



------------------------------------------------------------------------------


  _______________________________________________
  rules-users mailing list
  rules-users at lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20081204/670a18f1/attachment.html 


More information about the rules-users mailing list