[jboss-user] [jBPM] - why java.util.Map doesn't work on RHS update

hardawaycg do-not-reply at jboss.com
Fri Mar 16 07:55:10 EDT 2012


hardawaycg [https://community.jboss.org/people/hardawaycg] created the discussion

"why java.util.Map doesn't work on RHS update"

To view the discussion, visit: https://community.jboss.org/message/724290#724290

--------------------------------------------------------------
my rule just like this:
==================java code=====================
......
StatefulKnowledgeSession statefulKSession = kbase.newStatefulKnowledgeSession();
Map valueMap = new HashMap();
valueMap.put("year", "2012");
statefulKSession.insert(valueMap);
statefulKSession.fireAllRules();
......
==============================================
=================rule code======================
rule "rule1"
          lock-on-active true
          salience 100
     when
          $map : Map(this["year"] == "2012")
    then
                   System.out.println(drools.getRule().getName());
          //String state = service.getState();
          $map.put("state","2");
          update($m);
end

rule "rule2"
  lock-on-active true
  salience 99
     when
            $map : Map(this["state"] == "2")
    then
          System.out.println(drools.getRule().getName());
end
=============================================

i insert a HashMap as a fact to the working memory
my first rule(rule1) just get "state" from service ,then put into the map then update ,and in the next rule(rule2) judge "state" ,but it never goes into rule2's RHS,why?

any guys can help me? tks
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/724290#724290]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120316/0613bdc2/attachment-0001.html 


More information about the jboss-user mailing list