Re: [rules-users] Drools Decision Table, multiple actions accumulation

2012-06-01 Thread chsekhar
I was able to merge data from multiple ACTION columns in decision table. 

First ACTION column: 
(kept all keys as comma separated in single column. we can have it in
individual columns)
KeyPojo keys = new KeyPojo($1,$2,$3);

Second ACTION column:
 $myMap.put(keys, $param);

This worked great. Thanks Vincent for your answer.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-Decision-Table-multiple-actions-accumulation-tp4017733p4017740.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools Decision Table, multiple actions accumulation

2012-06-01 Thread chsekhar
In the example you had given, how would I be able to pass "keys" from one
ACTION to another in "decision table"? It cant be a global variable because
this(keys) has to be a new instance per row. Is there some mechanism in
decision table which would let me refer the values from column into another? 

KeyPojo keys = new KeyPojo();
  keys.setKey1(...);
  ...
  keys.setKeyk(...);
  ...
  keys.setKeyN(...);
  $myMap.put(keys, value);

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-Decision-Table-multiple-actions-accumulation-tp4017733p4017736.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Drools Decision Table, multiple actions accumulation

2012-06-01 Thread chsekhar
I am doing a similar example as described in this example in the link from
jboss website and go the section "6.1.3. How Decision Tables Work". (I have
attached the image as well)
http://drools.46999.n3.nabble.com/file/n4017733/example_decision_table.png 

http://docs.jboss.org/drools/release/5.2.0.Final/drools-expert-docs/html/ch06.html
Drools documentation 

In the example they are populating a "list" in the ACTION. So if a fact
matches couple of rows in the decision table, the list would contain those
two items.

My requirement is I need to have key value pair(Map) as my rule
consequence(ACTION). I was able to do one action which has "key,value" in a
single column and I was able to work with that. I am trying to find out if i
can have these values in two columns separately in the excel. (My key
actually contains 3 values and combining this with value looks messy. ex:
k1,k2,k3,value. So if can put the value in a separate column it would be
great)

I tried to create a global variable and called setter methods on separate
columns, but the problem is the setters in both the columns(ACTION) run
independently whereas I had to put both of them in a map which would mean I
should be able to pass the value present in both the columns in one method
call.


--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-Decision-Table-multiple-actions-accumulation-tp4017733.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users