[rules-users] How to access a Guvnor-declarative model from working memory?

satjo jo_satish at yahoo.com
Sat Jun 6 16:19:42 EDT 2009


Hi 

Could someone point to some documentation/examples that provides information
about the API to access objects  from workingmemory while using
statefulsession and decalarative model on Guvnor?


Let us take an example: 

There are a  couple of models test.model and test.result.

test.model
x: String
y : String

test.results
z: Sring

User has defined the rules using the values of x and y that set the values
of z. After execution of the rules, a collection of results need to
accessed.


WorkingMemory workingMemory = rb.newStatefulSession();
FactType msgIn = rb.getFactType("test.model");
FactType msgout = rb.getFactType("test.results");
		

Object msgDetail = msgIn.newInstance();
Object msgResults = msgout.newInstance();
	
//Set the values	
msgIn.set(msgDetail, "x", "aa");
..
..

workingMemory.insert(msgInfo);
workingMemory.insert(msgout);

//Fire the rules		
workingMemory.fireAllRules();

Could someone show to access the 'results' collection from the
workingmemory?
Again, this 'results' model has been defined by an user using Guvnor. 

Regards
sj
-- 
View this message in context: http://www.nabble.com/How-to-access-a-Guvnor-declarative-model-from-working-memory--tp23905232p23905232.html
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list