[rules-users] activationCancelled() not being executed?

Edson Tirelli tirelli at post.com
Thu Aug 30 08:45:20 EDT 2007


    Hi,

    Really interesting project. Congratulations!
    Regarding your question, I just plugged the DebugAgendaEventListener to
the manners test working memory, and it seems to be working fine. This
default implementation of agenda event listener simply prints out the
events. See bellow a snippet of the log generated by it:

[BeforeActivationFired: rule=makePath; tuple=[fid:2187:2555:[Path id=63,
seat=63, guest=2]]
[fid:2250:2624:[Seating id=64 , pid=63 , pathDone=false , leftSeat=63,
leftGuestName=2, rightSeat=64, rightGuestName=1]]
[fid:169:2628:[Context state=MAKE_PATH]]
]
[AfterActivationFired(2691): rule=makePath]
[BeforeActivationFired: rule=pathDone; tuple=[fid:2250:2624:[Seating id=64 ,
pid=63 , pathDone=false , leftSeat=63, leftGuestName=2, rightSeat=64,
rightGuestName=1]]
[fid:169:2628:[Context state=MAKE_PATH]]
]
==>[ActivationCreated(2757): rule=areWeDone; tuple=[fid:2250:2692:[Seating
id=64 , pid=63 , pathDone=true , leftSeat=63, leftGuestName=2, rightSeat=64,
rightGuestName=1]]
[fid:168:168:[LastSeat seat=64]]
[fid:169:2693:[Context state=CHECK_DONE]]
]
==>[ActivationCreated(2757): rule=continue; tuple=[fid:169:2693:[Context
state=CHECK_DONE]]
]
[AfterActivationFired(2691): rule=pathDone]
[BeforeActivationFired: rule=areWeDone; tuple=[fid:2250:2692:[Seating id=64
, pid=63 , pathDone=true , leftSeat=63, leftGuestName=2, rightSeat=64,
rightGuestName=1]]
[fid:168:168:[LastSeat seat=64]]
[fid:169:2693:[Context state=CHECK_DONE]]
]
<==[ActivationCancelled(2757): rule=continue; tuple=[fid:169:2693:[Context
state=PRINT_RESULTS]]
]
==>[ActivationCreated(2758): rule=allDone; tuple=[fid:169:2694:[Context
state=PRINT_RESULTS]]
]
[AfterActivationFired(2757): rule=areWeDone]
[BeforeActivationFired: rule=allDone; tuple=[fid:169:2694:[Context
state=PRINT_RESULTS]]
]
[AfterActivationFired(2758): rule=allDone]

    As you can see, seems all events are correctly reported. I'm using trunk
(4.0.1.SNAPSHOT), but I am not aware of any problem in 4.0GA either.
    Just as a test, try plugging it in your system and check the results...
i you still think it is a problem, can you please open a JIRA and attach a
self contained test case showing the problem?

    []s
    Edson



2007/8/30, Fermion <henss at physik.uni-wuppertal.de>:
>
>
> Hi!
>
> I'm using a JTable to display rules that have been activated.
>
> My goal is to have the table display a set of activations ordered by their
> salience. The user should then choose which one of them to fire (if you
> want
> to know why, be invited to read the background).
>
> Of course this makes only sense as long as the activations are valid.
> Rules
> whose activation has been cancelled should still be displayed, but in a
> different style (like greyed out).
>
> In order to accomplish this, I want to use an implementation of the
> AgendaEventListener-interface, implementing the
> activationCancelled()-method.
> The Listener itself works, as I use the activationCreated()-method to add
> the rule as a row to my table (which works fine).
>
> Unfortunately the activationCancelled()-method doesn't seem to be executed
> at all!
>
>
> I assume that I have a fundamental misunderstanding of what should trigger
> an activationCancelled() event?
>
>
> Background: (just if you're curious...)
> I'm working as a PhD student in physics at the CERN international
> high-energy physics laboratory, for the ATLAS experiment.
> As a member of the Detector Control System (DCS) group, I'm going to write
> an expert system in order to assist the shift crew with the detector
> operation.
>
> The operation of the detector is a difficult task, because more than 70000
> parameters (like voltages, currents and temperatures) have to be
> controlled.
> A Finite State Machine (FSM) computes a defined and limited number of
> states
> from the given parameters (like ON, OFF, STANDBY,...).
>
> I'm going to synchronize the expert system application to ERROR states of
> the FSM, in order to extract the relevant parameters from the system (as
> it
> would be impossible to feed all parameters into the XPS all the time).
> This is handled by quite some control rules that decide which data has to
> be
> requested, released and so on.
> Once all necessary data has been received, this might lead to activations
> of
> the (more interesting) user rules.
> Those rules have an explanatory character like "The temperature of this
> XYZ
> is too high, so please try ABC."
>
> For a given set of facts I assume more then one rule to be activated.
> Whilst
> the rule engine should take care of the execution (firing) of all control
> related rules, the execution of the user rules should be under direct user
> control.
>
> Displaying all activations in a GUI will allow the user to pick one (try
> it)
> and rate it (the proposed solution solved the problem "yes/no"). Changing
> the rules salience according to the answer, will allow the system to
> dynamically reflect the current system status. (Rules that are related to
> broken connections / wrongly connected cables are likely to be found at
> the
> beginning of the experiment but hopefully only on rare occasion later on.)
>
> In order to ensure that no information is lost during the absence of DCS
> experts (which will not always be around), a log file should be written
> for
> each major FSM-ERROR. At the moment the WorkingMemoryFileLogger seems to
> be
> predestined for this job. This way I hope to collect large amounts of
> ERROR
> data during the initial phase of the experiment that helps to extract
> rules
> for numerous error conditions.
> This will become especially handy, as such errors have a tendency to come
> back, even if the original detector experts are gone for years...
> --
> View this message in context:
> http://www.nabble.com/activationCancelled%28%29-not-being-executed--tf4348054.html#a12387991
> Sent from the drools - user mailing list archive at Nabble.com.
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070830/0fa5eb1d/attachment.html 


More information about the rules-users mailing list