Re: [rules-users] Understanding Fusion temporal reasoning
by Jeremy Ary
I see a few posts from you Chris on 9/25 and one more from yesterday. Probably more, but I emptied my folder a few days before that. If it's an all-or-none thing, I can confirm I've received posts daily for the last week.
- Jeremy
----- Original Message -----
From: "Edson Tirelli" <ed.tirelli(a)gmail.com>
To: "Rules Users List" <rules-users(a)lists.jboss.org>
Sent: Tuesday, September 29, 2009 3:27:50 PM GMT -06:00 US/Canada Central
Subject: Re: [rules-users] Understanding Fusion temporal reasoning
Talking just about myself, I was kicked off the list (too many bounces it said) and I noticed yesterday, so I lost all messages in the last week or so. Edson 2009/9/29 Chris Richmond > Ok..will do. > > > > BTW…is the newgroup problem happening again? I posted this question about > 3 times over the last week as well as some others, and I don’t mind that > people can’t help all the time at all, but I know there was a problem before > and I posted this again today because iI never received any responses for > like a week and that doesn’t happen, usuallly someone mentions something. > > Thanks, > > Chris > > > ------------------------------ > > *From:* rules-users-bounces(a)lists.jboss.org [mailto: > rules-users-bounces(a)lists.jboss.org] *On Behalf Of *Edson Tirelli > *Sent:* Tuesday, September 29, 2009 9:21 AM > *To:* Rules Users List > *Subject:* Re: [rules-users] Understanding Fusion temporal reasoning > > > > > Chris, > > Someone found a bug a couple days ago that might be affecting you too. > What happens if you write: > > declare NumReading > > @role( event ) > > @expires( 10s ) > > end > > > ? > > Edson > > 2009/9/29 Chris Richmond > > Hello, > > > > I am trying to make a rule to delay firing until a certain amount of time > has passed without another event being received. I have set up a loop that > goes every 10 seconds in my main application that takes readings and injects > them into the ReadingStream. These are like sensor readings. > > > > I have a thread started at initialization that is basically calling > fireUntilHalt() and I never call halt until shutdown, and that seams to be > working fine. > > > > So basically any time an out of spec reading in my Reading object (<15) is > received, I want to wait to see if a FollowUpReading is not received in the > next 5 seconds, before I fire the results(The second rule below). The first > rule is there just to verify I am indeed detecting NumReadings with values < > 15 being injected and that works fine. Now at this point in my appication > I am **never** inserting a FollowUpReading object/event, so I would expect > the 2nd rule to fire all the time, however the strange thing is that it > only fires the first time I receive a reading out of spec. I see rule one > fire, then the seond time, but after that any subsequent out of spec > readings received(I know they are out of spec, because rule 1 still fires > when received) but rule 2 never fires again. It only ever fires one time! > This is very confusing. These ar the only 2 rules and the only two object > types being inserted to the stream. Know that rule 2 **can** fire because > it does once and only once. Why won’t it fire beyond the first time, even > though I never insert the FollowUpReading() ? > > > > Thanks, > > > Chris > > > > declare NumReading > > @role( event ) > > end > > > > declare FollowUpReading > > @role(event) > > end > > > > > > rule "Determine out of spec reading" > > when > > $n : NumReading($r:reading < 15) from entry-point "ReadingStream"; > > then > > System.err.println("Fire off a follow up reading for device: " + $n); > > end > > > > > > rule "Missed degrading confirmation reading" > > when > > $n : NumReading($r:reading < 15) from entry-point "ReadingStream"; > > not (FollowUpReading(this after[0s, 5s] $n)) > > then > > System.err.println("No good reading received for: " + $n); > > end > > > > > > > _______________________________________________ > rules-users mailing list > rules-users(a)lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users > > >
_______________________________________________ rules-users mailing list rules-users(a)lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
15 years, 3 months
Understanding Fusion temporal reasoning
by Chris Richmond
Hello,
I am trying to make a rule to delay firing until a certain amount of time
has passed without another event being received. I have set up a loop that
goes every 10 seconds in my main application that takes readings and injects
them into the ReadingStream. These are like sensor readings.
I have a thread started at initialization that is basically calling
fireUntilHalt() and I never call halt until shutdown, and that seams to be
working fine.
So basically any time an out of spec reading in my Reading object (<15) is
received, I want to wait to see if a FollowUpReading is not received in the
next 5 seconds, before I fire the results(The second rule below). The first
rule is there just to verify I am indeed detecting NumReadings with values <
15 being injected and that works fine. Now at this point in my appication
I am *never* inserting a FollowUpReading object/event, so I would expect the
2nd rule to fire all the time, however the strange thing is that it only
fires the first time I receive a reading out of spec. I see rule one fire,
then the seond time, but after that any subsequent out of spec readings
received(I know they are out of spec, because rule 1 still fires when
received) but rule 2 never fires again. It only ever fires one time! This
is very confusing. These ar the only 2 rules and the only two object types
being inserted to the stream. Know that rule 2 *can* fire because it does
once and only once. Why won't it fire beyond the first time, even though I
never insert the FollowUpReading() ?
Thanks,
Chris
declare NumReading
@role( event )
end
declare FollowUpReading
@role(event)
end
rule "Determine out of spec reading"
when
$n : NumReading($r:reading < 15) from entry-point "ReadingStream";
then
System.err.println("Fire off a follow up reading for device: " + $n);
end
rule "Missed degrading confirmation reading"
when
$n : NumReading($r:reading < 15) from entry-point "ReadingStream";
not (FollowUpReading(this after[0s, 5s] $n))
then
System.err.println("No good reading received for: " + $n);
end
15 years, 3 months
Better ways to write left hand sides
by Dave Schweisguth
Greetings fellow Droolers,
I've just begun using Drools and am very happy with it so far as it seems to
be a great fit for what we want to do. My left hand sides are not quite
beautiful enough, however, and I wondered if anyone could suggest
improvements.
1) One of my facts' properties is a set of strings. The goal is to "grep"
them for some search string. The most convenient syntax I've come up with
so far is to give the fact a method anyTextContains which loops over the
set and calls contains(searchString) on each member, and then use
fact: Fact() eval(fact.anyTextContains("searchString"))
in my LHS. It's compact enough, but I wondered whether it could be done
without a custom method or eval. "from" seems not to be a possibility since
the collection is of strings, not objects. Any suggestions?
2) Another of my facts' properties, "attributes", is a Map of Map of String.
Unfortunately the second level of keys is sparse. If the attribute I want
is present,
Fact(attributes.KeyOne.KeyTwo == 42)
looks and works great. If KeyTwo is absent, however, I get
org.drools.RuntimeDroolsException: Exception executing predicate attributes.KeyOne.KeyTwo == 42 [...] Caused by: [Error: unable to resolve method: java.util.HashMap.KeyTwo() [arglength=0]] [Near : {... Unknown ....}]
The best syntax I've found which is null-safe is
Fact(attributes.KeyOne["KeyTwo"] == 42)
which works but hurts the eyes somewhat. I'm not clear whether MVEL-style
null-safe traversal should work here; my experiments suggest it does not.
Again, any suggestions?
Thanks,
--
| Dave Schweisguth http://schweisguth.org/~dave/ |
| Home: dave at schweisguth.org Work: http://www.nileguide.com/ |
| For compliance with the NJ Right to Know Act: Contents partially unknown |
15 years, 3 months
Expected rule not firing.
by Wicks, J Matthew
I am building my app's rules from decision tables using Drools 4.0.7.
At one point, I expect a particular rule to fire but it never does. The rule originally was constrained to the presence of a POJO to store the results of the rule's evaluation that is as yet not evaluated and a POJO that containing the data to be evaluated. While trying to diagnose why it never fires, I have reduced the constraints to the presence of the POJO results container. It still doesn't fire.
Excerpts from the initialization and evaluation decision tables (compiled to DRL):
# Construct DecisionPoint container to hold results of evaluation
#From row number: 53
rule "Init Plus 5V PS Overtemp"
salience 65484
no-loop true
ruleflow-group "Initialize Testpoint Groups"
when
then
subtestName = "Fault Sum";
ruleName = "Plus 5V PS Overtemp"; serviceProvider.create("DecisionPoint",ruleName);
dsl.addDebugString("row called " + "IN_52");
end
# Record that +5V PS Overtemp condition exists in DecisionPoint object
#From row number: 26
rule "Plus 5V PS Overtemp Set"
salience 65510
no-loop true
ruleflow-group "PS Overtemp"
when
outputDecision: DecisionPoint(name == "Plus 5V PS Overtemp")
then
subtestName = "Fault Sum";
ruleName = "Plus 5V PS Overtemp";
ID = "PASSED";
modifyRetract(outputDecision);
outputDecision.setEvaluation(ruleName, ID);
modifyInsert(outputDecision);
dsl.addDebugString("row called " + "DE_26");
end
Enabling listeners for working memory updates and ruleflow transitions, I see that the container is built and added to memory but is not found when the PS Overtemp ruleflow group is activated.
Sep 28, 2009 1:52:49 PM com.lmco.orts.equipmentFDFI.controller.rules.engine.RulesHelper contineStatefulRunWithMoreInputs
INFO: in continue stateful run (obj). class com.lmco.orts.equipmentFDFI.controller.rules.data.DecisionPoint Plus 5V PS Overtemp EV_NOT_EVAL
Sep 28, 2009 1:52:49 PM com.lmco.orts.equipmentFDFI.controller.rules.data.DecisionPoint getPassed
INFO: [Plus 5V PS Overtemp] passed == false
Sep 28, 2009 1:52:49 PM com.lmco.orts.equipmentFDFI.controller.rules.engine.RulesHelper$2 objectInserted
INFO: ~~~~~~~~~~~~~workingmemory Inserted: DecisionPoint: [Plus 5V PS Overtemp] EV_NOT_EVAL
row called IN_52
...
Sep 28, 2009 1:52:57 PM com.lmco.orts.equipmentFDFI.controller.rules.engine.RulesHelper$1 ruleFlowGroupActivated
INFO: RFG Activated: PS Overtemp
Sep 28, 2009 1:52:57 PM com.lmco.orts.equipmentFDFI.controller.rules.engine.RulesHelper$1 ruleFlowGroupDeactivated
INFO: RFG Deactivated: OT Fault Sum
Sep 28, 2009 1:52:57 PM com.lmco.orts.equipmentFDFI.controller.rules.engine.RulesHelper$1 ruleFlowGroupActivated
INFO: RFG Activated: Report Fault Sum Faults
Sep 28, 2009 1:52:57 PM com.lmco.orts.equipmentFDFI.controller.rules.engine.RulesHelper$1 ruleFlowGroupDeactivated
INFO: RFG Deactivated: PS Overtemp
It is probably something obvious, but I am so close to it that I can't see the forest for the trees.
J. Matthew Wicks
(856) 359-1115
15 years, 3 months
Re: [rules-users] Push model for rule updates?
by Blythe, Marshall
> The only wrinkle I see is that you want to store the rulebase in the
> database. I'm not quite sure how you'd configure the changescanner to
> read from the database. Is a shared file system not viable?
I suppose could use a shared file system if push came to shove, but using a database would actually follow the path of least resistance in my organization- at least from a political standpoint (don't get me started!).
----------------------------------------- This e-mail and any attachments may contain CONFIDENTIAL information, including PROTECTED HEALTH INFORMATION. If you are not the intended recipient, any use or disclosure of this information is STRICTLY PROHIBITED; you are requested to delete this e-mail and any attachments, notify the sender immediately, and notify the LabCorp Privacy Officer at privacyofficer(a)labcorp.com or call (877) 23-HIPAA.
15 years, 3 months
First experience with Drools 'BPM' ruleflow : some questions
by Thierry
Hi !
I've tried the Drools Ruleflow to implement process.
I found it very nice and wonders if it's still usefull to retain the JBPM
process : if anyone has an objective comparison of the two, I would be
interested. Personaly I think I have a better acces to the workflow control
and logic in Drools. I just miss the possibility to map an ActionClass when I
want to do something requiring many java code lines. Otherwise it seems
overall better.
I still have a few questions for those that are experimented in Drools
Ruleflow.
Is there a way to render the process model more user friendly toward
more 'business' people ? It seems to me I have to build my business model
through JavaBeans, meaning I have to generate get/set methodes and have no
graphical view of my process model. A graphical editor would be very nice.
Is there a way to change a node type (other than XML hacking...) I wanted to
test my process using action nodes. If I want to change them to ruleset or
human task how can I do it ?
Are they tool to facilitate process simulation ?
Are they way to generate Human Task test screen ?
Is it possible to instanciante a process variable in a node ?
I had a 'testIt' variable, type specific Object. I did inject a null instance
at process start. In a action node I tried : testIt = new MyObject(); Still
testIt remains null. I can execute methods on variable, but not instanciate
them ?
Bugs ? As it's my first try I wouldn't report them until sure it's bugs (and
they're not yet reported !)
- In my first process I just clicked on 'OK' to enter constraints on split
node (I had one on always true, and every other blank). That removed the
process compil error. But generated a null pointer error at run time. I wished
the error would give me the node name. I wished those null pointer error were
detected in the process check phase. The possibility to have 'blank'
constraints just to test other part of the process would be nice.
- I have a split note with constraints going towards actions node. I realize
one action node is useless and wants to map directly toward the next node in
taht line (to remove the useless action node). Dragging the connection removes
the constraits... Too bad :(
- I got StackOverflow doing unintentionaly a loop in my process. I wished the
engine would allow a special exit conditions on those case !
Thanks a lot for insights of experienced user !
15 years, 3 months
Push model for rule updates?
by Blythe, Marshall
Has anyone successfully implemented a push model for updating rules in a Drools 5.0 application? Here's what I'd like to do:
1. Rules will be authored out-of-process, and serialized KnowledgePackages will be stored in a database.
2. When the client application starts up (i.e. a regular servlet-based app) it will fetch the KnowledgePackages from the database and use them to configure a singleton KnowledgeBase instance.
3. A special UI in the client application will allow authorized users to upload new KnowledgePackages. When new packages are uploaded they are first persisted in the database and then used to update the KnowledgeBase at runtime. All subsequent calls to fireAllRules() should use the rules in the new package.
If anyone has done something like this before then I'd appreciate some advice on how to manage updates to the KnowledgeBase at runtime.
----------------------------------------- This e-mail and any attachments may contain CONFIDENTIAL information, including PROTECTED HEALTH INFORMATION. If you are not the intended recipient, any use or disclosure of this information is STRICTLY PROHIBITED; you are requested to delete this e-mail and any attachments, notify the sender immediately, and notify the LabCorp Privacy Officer at privacyofficer(a)labcorp.com or call (877) 23-HIPAA.
15 years, 3 months
infinite loop rules problem
by Costigliola Joel (EXT)
Hello,
Me again and no it is not spamming, and I'm still drools newbie ;-)
I was facing a problem of infinite loop with one of my rule, I have solved it but I'm wondering if my solution is not too costful on a performance point of view.
So my question is really on the most efficient way of solving the infinite loop problem I'm gonna expose you right now.
First of all, a few words the problem I want to solve with Drools :
My company is a bank where traders are making deals on markets, these deals must be classified in book, this is what we call "booking process".
Booking is done according to booking criteria : which trader has made the deal ? on which product ? etc ...
A booking rule defines a set of criteria and the target book where the deal will classified.
The guilty rule's job was to fill DealMatchingBookingRules with the booking rules applicable on a deal, (DealMatchingBookingRules references a unique deal).
I have put below a corrected version by commenting the update($dealMatchingBookingRules) instruction of the RHS.
With update uncommented, the problem occurred when 2 booking rule were matching the same deal in here's my understanding of the problem
Facts inserted in the session :
- dmbr1 (instance of DealMatchingBookingRule) referencing a deal
- br1 and br2 matching the deal referenced in dmr1
Results :
1. rule is activated with (dmbr1, br1), dmbr1 is updated
2. rule is activated with (dmbr1, br2), dmbr1 is updated - (dmbr1, br1) does not activate the rule because of no-loop rule attribute
3. rule is activated AGAIN with (dmbr1, br1), dmbr1 is updated : back to step 1
4. rule is activated AGAIN with (dmbr1, br2), dmbr1 is updated : back to step 2
5. infinite loop on step1 & step 2
I have fixed the problem by removing the call to update, but for the next steps of my process (not shown here) Drools need to aware of the modified DealMatchingBookingRules. I thus have written a rule which only update all DealMatchingBookingRules.
Is there a better way to solve this infinite loop ?
Feel free to make comments, I'm really open to any suggestion/enhancement.
Regards,
Joël Costigliola
rule "Find matching level 1 booking rules by deal"
salience 10
no-loop
ruleflow-group "Find level 1 matching booking rules by deal group"
when
$dealMatchingBookingRules : DealMatchingBookingRules($dealModel : deal, $dealProductRelatedIndexes : dealProductRelatedIndexes)
$bookingRule : BTExecutionBookingRuleModel (
priority == 1
// when a criterion is not set, it is considered as satisfied.
&& (traderCriterion == null || $dealModel.trader == traderCriterion)
&& (portfolioCriterion == null || $dealModel.portfolio == portfolioCriterion)
// when a product type criterion is set to unknown, it is considered as satisfied whatever deal product type is.
&& (productTypeStringCriterion == null || productTypeCriterion == ProductType.Unknown
|| $dealModel.product.productType == productTypeCriterion)
&& (listedIndexCriterion == null || $dealProductRelatedIndexes.relatedIndexes contains listedIndexCriterion)
)
then
$dealMatchingBookingRules.addMatchingBookingRule($bookingRule);
// update($dealMatchingBookingRules) : COMMENTED BECAUSE WAS CAUSING INFINITE LOOP !
end
// Does the job of update($dealMatchingBookingRules) but without INFINITE LOOP.
rule "Refresh facts in level 1 booking rule process"
salience 5
no-loop
ruleflow-group "Refresh facts in level 1 booking rule process group"
when
$dealMatchingBookingRules : DealMatchingBookingRules()
then
update($dealMatchingBookingRules);
end
--------------------------------------------------------
Ce courriel et toutes les pièces jointes sont confidentiels et peuvent être couverts par un privilège ou une protection légale. Il est établi à l'attention exclusive de ses destinataires. Toute utilisation de ce courriel non conforme à sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse préalable. Toutes opinions exprimées dans ce courriel ne sauraient nécessairement refléter celle de Natixis, de ses filiales. Elles sont aussi susceptibles de modification sans notification préalable. Si vous recevez ce courriel par erreur, merci de le détruire et d'en avertir immédiatement l'expéditeur. L'Internet ne permettant pas d'assurer l'intégrité de ce courriel, Natixis décline toute responsabilité s'il a été altéré, déformé ou falsifié et chaque destinataire qui utilise ce mode de communication est supposé en accepter les risques.
This email and any attachment are confidential and may be legally privileged or otherwise protected from disclosure. It is intended only for the stated addressee(s) and access to it by any other person(s) is unauthorised. Any use, dissemination or disclosure not in accordance with its purpose, either in whole or in part, is prohibited without our prior formal approval. Any opinion expressed in this email may not necessarily reflect the opinion of Natixis, its affiliates. It may also be subject to change without prior notice. If you are not an addressee, you must not disclose, copy, circulate or in any other way use or rely on the information contained in this email. If you have received it in error, please inform us immediately and delete all copies. The Internet can not guarantee the integrity of this email therefore Natixis shall not be liable for the email if altered, changed or falsified and anyone who communicates with us by e-mail is taken to accept these risks.
--------------------------------------------------------
15 years, 3 months
Variables in human tasks
by Renato Herebia
Hi all!
I'm developing a flow to controll what each actor must do in my system using
human tasks for that.
After verify pending tasks for an actor, I have to verify what is the
persistent object related to this flow.
The idea to resolve this situation is to attribute the persistent object id
to a flow variable before start
the process and then attribute the flow variable to task variable/parameter.
Thus, when I have the list
of pending tasks for an actor, I can get the id of persistent object and
restore this object.
In this scenario, my doubt is: how to get the task variable/parameter?
Thanks!
--
Renato Herebia
Desenvolvimento
Dextra Sistemas - MPS.Br Nível F!
www.dextra.com.br
+55 19 3256-6722 Ramal 27
Este email é confidencial. Mais informações em:
This message is confidential. More information at:
www.dextra.com.br/confidencial.htm
15 years, 3 months