[rules-users] How to obtain the object/fact created in the rule file?

Wolfgang Laun wolfgang.laun at gmail.com
Mon Jan 31 03:02:25 EST 2011


A global List object maintains order and can be modified by Java code, none
of which is guaranteed with a query, which incidentally adds some overhead
to Rete.

Not knowing what the ultimate purpose and destination of the FieldResults
facts is, it is difficult to suggest. Perhaps it isn't even necessary to
insert them as facts?

-W


2011/1/31 Patricia Bogoevici <patriciabogoevici at yahoo.com>

> I am using the knowledge session to get the objects created.
>
> knowledgeSession.getObjects():
>
> this will return all objects: the facts that were inserted into the engine
> before fireAllRules(), plus the new facts created as result of the rule
> execution.
>
> Also you can use getQueryResults, or openLiveQuery for the working memory
> to retrieve facts from the working memory.
>
>
>
>
>
> --- On *Fri, 1/28/11, Benson Fung <benson.redhat at gmail.com>* wrote:
>
>
> From: Benson Fung <benson.redhat at gmail.com>
> Subject: [rules-users] How to obtain the object/fact created in the rule
> file?
> To: "Rules Users List" <rules-users at lists.jboss.org>
> Date: Friday, January 28, 2011, 12:02 PM
>
> Hi,
>
> I developed a rule as below:
>
>     rule "Rule1"
>         dialect "mvel"
>         when
>             Fields( field1 > "100" )
>         then
>             FieldResults fact0 = new FieldResults();
>             fact0.setField1( "This is Correct!" );
>             insert(fact0 );
>     end
>
> After calling fireAllRules(...), the above rule will be fired and
> created a fact object in the working memory.
> My problem is how to obtain the FieldResults object in the java
> program.  Please advise.
>
>
> Thanks
> Benson
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org<http://mc/compose?to=rules-users@lists.jboss.org>
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110131/bef4ea92/attachment.html 


More information about the rules-users mailing list