JESS: Getting asserted fact from Activation object in JessListener

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

JESS: Getting asserted fact from Activation object in JessListener

Dwight Hare

In my JessListener I looked at all of the facts from the Token gotten from the Activation. I see all the facts matched in the patterns, but I want access to the fact asserted in the action clause.

 

So if my rule is:

 

(defrule SIRS

            ?ab <- (logical (AbnormalTemperature))

            ?ev <- (logical (ElevatedHeartRate {patientId == ab.patientId}))

            ?p <- (Patient {patientId == ab.patientId})

            =>

            (assert (SIRS (patientId ?p.patientId)))

)

 

Then in the listener I see the facts matched in the pattern but I don’t see the SIRS fact asserted in the action part. Can I access this asserted fact somehow?

 

Thanks

Dwight

 

Reply | Threaded
Open this post in threaded view
|

Re: JESS: Getting asserted fact from Activation object in JessListener

Wolfgang Laun-2
You can listen for JessEvent.DEFRULE_FIRED events. Any successive JessEvent.FACT events (up to certain other events) are assert results executed on the RHS of that rule.

-W

On 4 August 2011 02:30, Dwight Hare <[hidden email]> wrote:

In my JessListener I looked at all of the facts from the Token gotten from the Activation. I see all the facts matched in the patterns, but I want access to the fact asserted in the action clause.

 

So if my rule is:

 

(defrule SIRS

            ?ab <- (logical (AbnormalTemperature))

            ?ev <- (logical (ElevatedHeartRate {patientId == ab.patientId}))

            ?p <- (Patient {patientId == ab.patientId})

            =>

            (assert (SIRS (patientId ?p.patientId)))

)

 

Then in the listener I see the facts matched in the pattern but I don’t see the SIRS fact asserted in the action part. Can I access this asserted fact somehow?

 

Thanks

Dwight

 


Reply | Threaded
Open this post in threaded view
|

Re: JESS: Getting asserted fact from Activation object in JessListener

Dwight Hare
Thanks, that works.

Dwight

On 8/4/2011 8:01 AM, Wolfgang Laun wrote:
> You can listen for JessEvent.DEFRULE_FIRED events. Any successive
> JessEvent.FACT events (up to certain other events) are assert results
> executed on the RHS of that rule.
>
> -W
>

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [hidden email]'
in the BODY of a message to [hidden email], NOT to the list
(use your own address!) List problems? Notify [hidden email].
--------------------------------------------------------------------