[rules-users] Iterating facts

Phani Saripalli saripalli.phani at gmail.com
Thu Oct 11 05:46:16 EDT 2012


Hi. 
1) I could list all the facts via knowledge session.facthandle.iterator.
2) I could iterate over the objects contained in a fact. For example:
    
      List<FactField> fFields = 
ksession.getKnowledgeBase().getFactType(pckg, "Project").getFields();

3) I could get the name of the object and retrieve the contained value as a
string if it is a primitive datatype - int, real, boolean.

4) The problem for me is I am not able to retrieve the values of the inner
fields of an object. 

For example, fFields.get(0).get(projIns) - yields me C( a=1, bool=false,
cc=0 ), I could retrieve this particular objects' name and also the inner
fields' names, but not the contained values for a, bool and cc.

I have tried java reflection, but no positive result so far. 

I am using declared types, with no metadata. Any other nice way to tackle
this problem.

Thank you.



--
View this message in context: http://drools.46999.n3.nabble.com/Iterating-facts-tp4020214.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list