[rules-users] Can we works on fact of "dynamic Map" instead of POJO?

王在祥 wangzaixiang at gmail.com
Thu Mar 25 23:10:07 EDT 2010


I have a requirement of run rules on dynamic map instead of POJO, for
example:

*when
    Map(* TransCode == "LOGIN" , userName == "wangzx", password == "123456"
)
*then
    doSth1()

when
   Map( *TransCode = "SaveOrder" userName == "wangzx" category == "Book")
*then
  doSth2()

*
the Fact is not a Java Bean, but a dynamic map<String, Object>, so the
TransCode == "Login" is what we means map("TransCode") == "Login".

By using map insteam of POJO, we can build a rules run on the message
dispatch, since there is a lot of Message Types, and each message type has
different schema, so using dynamic types is more flexible than POJO.

Can someone tell me how can it be supported in drools? Very thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100326/7493eebb/attachment.html 


More information about the rules-users mailing list