[rules-users] rules-users Digest, Vol 48, Issue 34

Wolfgang Laun wolfgang.laun at gmail.com
Tue Nov 9 16:17:40 EST 2010


This merely changes the object:
 $oRecord1.setStatus( "Matched" );

The Engine is not aware of a change of this fact. Other rules depending on
this value will not fire, and queries will fail.

The usual way for updates is
   modify( $varBoundToFact ){ setX(...), setY(),... }

You may also use
   $varBoundToFact.setX(...);
   update( $varBoundToFac );

(Another possibililty is to use PropertyChangeListener.)

-W



On 9 November 2010 22:06, Dennis Duggan <dennis at esptechnologies.com> wrote:

> Wolfgang:
> In the rule??
>
> rule "Match"
>     when
>         $oRecord1 : MyObject1( )
>         $oRecord2 : MyObject2(RefID==$oRecord1. RefID )
>       then
>          $oRecord1.setStatus( "Matched" );
>          $oRecord2.setStatus( "Matched" );
>       modify ( $oRecord1 ) { status = "Matched" };
>       modify ( $oRecord2 ) { status = "Matched" };
> end
>
> I get an error...
> __obj__.status cannot be resolved or is not a field
>
> Doesn't the setStatus calls just above update the object?
>
> Thanks!
> Dennis
>
> -----Original Message-----
> From: rules-users-bounces at lists.jboss.org [mailto:
> rules-users-bounces at lists.jboss.org] On Behalf Of
> rules-users-request at lists.jboss.org
> Sent: Tuesday, November 09, 2010 3:39 PM
> To: rules-users at lists.jboss.org
> Subject: rules-users Digest, Vol 48, Issue 34
>
> Send rules-users mailing list submissions to
>        rules-users at lists.jboss.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        https://lists.jboss.org/mailman/listinfo/rules-users
> or, via email, send a message with subject or body 'help' to
>        rules-users-request at lists.jboss.org
>
> You can reach the person managing the list at
>        rules-users-owner at lists.jboss.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of rules-users digest..."
>
>
> Today's Topics:
>
>   1. Re: Query query... (Dennis Duggan)
>   2. Re: Query query... (Wolfgang Laun)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 9 Nov 2010 14:13:07 -0600
> From: Dennis Duggan <dennis at esptechnologies.com>
> Subject: Re: [rules-users] Query query...
> To: "rules-users at lists.jboss.org" <rules-users at lists.jboss.org>
> Message-ID:
>        <121AF5D37A73F94E98B26D237302319E010A76863B at MBX04.exg5.exghost.com>
> Content-Type: text/plain; charset="us-ascii"
>
> I have a super interface, that both objects implement.
>
> The matching rule looks like:
> rule "Match"
>    when
>        $oRecord1 : MyObject1( )
>        $oRecord2 : MyObject2(RefID==$oRecord1. RefID )
>      then
>         $oRecord1.setStatus( "Matched" );
>         $oRecord2.setStatus( "Matched" );
> end
>
> I can breakpoint right after running the query and I see objects with all
> statuses so the matching rule is firing correctly.
>
> Thanks!
> Dennis
> Dennis Duggan
> Principal Software Engineer, Software Engineering
> ESP Technologies Corp. "THE Buy-Side Solution"
> One Indian Head Plaza Suite 701, Nashua, NH 03060
> 603.324.2444 ext. 1304 Office |  603.324.2447 Fax
> dennis at esptechnologies.com
>
> ESP Technologies, winner 2009 Red Herring North America 100 and 2008
> Deloitte Technology Fast 500.
> This e-mail and/or attachments may contain privileged, confidential or
> proprietary information.  Unintended recipients should notify the sender
> immediately and delete. Disclosure, copying, distribution or use of this
> e-mail or any attachment is prohibited. Brokerage services provided by
> Electronic Securities Processing (ESP) LLC. Member FINRA, SIPC. This is
> neither an offer or recommendation to buy or sell any security or other
> financial instrument.  Email compliance at esptechnologies.com with questions
> regarding this disclosure.
>
> From: Dennis Duggan
> Sent: Tuesday, November 09, 2010 1:55 PM
> To: 'rules-users at lists.jboss.org'
> Subject: Query query...
>
> I have 2 types of objects in my knowledge base that I am trying to equate.
>  Equality is based on a number of different variables contained in the
> objects.  Once I find equal objects I set a status member in each to
> "Matched", otherwise it will be "OneKnows" or "TwoKnows".
>
> After I fire the rules I use queries that I call from Java code to get the
> three different types of objects.
> query "OneFirmKnows"
>    oRecord : MyObject1( status=="OneKnows" )
> end
>
> query "TwoKnows"
>    oRecord : MyObject2( status=="TwoKnows" )
> end
>
> query "Matched"
>    oRecord : MyObject1( status=="Matched" )
> end
>
> Each query sends back all objects no matter what the status is.  The
> objects have a getStatus( ) method.  What am I doing wrong?
>
> Thanks!
> Dennis
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.jboss.org/pipermail/rules-users/attachments/20101109/ef70b469/attachment-0001.html
>
> ------------------------------
>
> Message: 2
> Date: Tue, 9 Nov 2010 21:38:56 +0100
> From: Wolfgang Laun <wolfgang.laun at gmail.com>
> Subject: Re: [rules-users] Query query...
> To: Rules Users List <rules-users at lists.jboss.org>
> Message-ID:
>        <AANLkTikxs+9XhVj2XNQzKDRFAgVa2Mai3fgBFFLtLaNM at mail.gmail.com<AANLkTikxs%2B9XhVj2XNQzKDRFAgVa2Mai3fgBFFLtLaNM at mail.gmail.com>
> >
> Content-Type: text/plain; charset="windows-1252"
>
> You don't call modify or update on $oRecord1/$oRecord2!
> -W
>
>
>
> 2010/11/9 Dennis Duggan <dennis at esptechnologies.com>
>
> >  I have a super interface, that both objects implement.
> >
> >
> >
> > The matching rule looks like:
> >
> > *rule* "Match"
> >
> >     *when*
> >
> >         $oRecord1 : MyObject1( )
> >
> >         $oRecord2 : MyObject2(RefID==$oRecord1. RefID )
> >
> >       *then*
> >
> >          $oRecord1.setStatus( "Matched" );
> >
> >          $oRecord2.setStatus( "Matched" );
> >
> > *end*
> >
> >
> >
> > I can breakpoint right after running the query and I see objects with all
> > statuses so the matching rule is firing correctly.
> >
> >
> >
> > Thanks!
> > Dennis
> >
> > Dennis Duggan
> >
> > Principal Software Engineer, Software Engineering
> >
> > ESP Technologies Corp. "THE Buy-Side Solution*"*
> >
> > One Indian Head Plaza Suite 701, Nashua, NH 03060
> >
> > 603.324.2444 ext. 1304 Office |  603.324.2447 Fax
> >
> > dennis at esptechnologies.com
> >
> >
> >
> > *ESP Technologies, winner 2009 Red Herring North America 100 and 2008
> > Deloitte Technology Fast 500*.**
> >
> > This e-mail and/or attachments may contain privileged, confidential or
> > proprietary information.  Unintended recipients should notify the sender
> > immediately and delete. Disclosure, copying, distribution or use of this
> > e-mail or any attachment is prohibited. Brokerage services provided by
> > Electronic Securities Processing (ESP) LLC. Member FINRA, SIPC. This is
> > neither an offer or recommendation to buy or sell any security or other
> > financial instrument.  Email compliance at esptechnologies.com with
> questions
> > regarding this disclosure.
> >
> >
> >
> > *From:* Dennis Duggan
> > *Sent:* Tuesday, November 09, 2010 1:55 PM
> > *To:* 'rules-users at lists.jboss.org'
> > *Subject:* Query query...
> >
> >
> >
> > I have 2 types of objects in my knowledge base that I am trying to
> equate.
> > Equality is based on a number of different variables contained in the
> > objects.  Once I find equal objects I set a status member in each to
> > ?Matched?, otherwise it will be ?OneKnows? or ?TwoKnows?.
> >
> >
> >
> > After I fire the rules I use queries that I call from Java code to get
> the
> > three different types of objects.
> >
> > *query* "OneFirmKnows"
> >
> >     oRecord : MyObject1( status=="OneKnows" )
> >
> > *end*
> >
> >
> >
> > *query* "TwoKnows"
> >
> >     oRecord : MyObject2( status=="TwoKnows" )
> >
> > *end*
> >
> >
> >
> > *query* "Matched"
> >
> >     oRecord : MyObject1( status=="Matched" )
> >
> > *end*
> >
> >
> >
> > Each query sends back all objects no matter what the status is.  The
> > objects have a getStatus( ) method.  What am I doing wrong?
> >
> >
> >
> > Thanks!
> >
> > Dennis
> >
> > _______________________________________________
> > 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/20101109/3712f2f4/attachment.html
>
> ------------------------------
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> End of rules-users Digest, Vol 48, Issue 34
> *******************************************
>
> _______________________________________________
> 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/20101109/42fdf19f/attachment.html 


More information about the rules-users mailing list