In your DRL (quote from the Expert manual):
global java.util.List list
or a Map or a ...
In the Java code (another quote from the Expert manual):
List list = new ArrayList();
ksession.setGlobal("list", list);
or a Map or a...
In your DRL a function
function setValue(Map map, String a, Integer b){
...
}
I guess you can complete the function. Important: pass the global as a
parameter.
-W
On 30/10/2013, bbarani <bbarani(a)gmail.com> wrote:
Sorry, I think I didn't explain my problem correctly.
Consider I have to process 2 records.
Each record will pass through the rule in drl file.
Name Count<br>
a 100<br>
b 200<br>
a 100<br>
Now I want to store the above values in a global hash map as below (When I
process the 3rd document).
I will
key value
a 200 <br>
b 200<br>
To achieve the above solution, I need a global hashmap which I can use as
temp storage to store the values.
--
View this message in context:
http://drools.46999.n3.nabble.com/How-to-use-global-hashmap-in-drools-tp4...
Sent from the Drools: User forum mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users