Logical assertions & the KnowledgeBaseConfiguration insertion modes.
by bardelman
Hi ,
i ve read that when the same fact is logically inserted into a session by
more rules, only one equal instance will be physically present in the
session.
On the other hand, i learned that Drools supports two fact insertion modes
:equality and identity.Identity (which is the default) means that no two
objects with the same JVM object reference can be inserted into the
knowledge session.
what if the equality mode is set and the logical assertion is used ? does
these modes only concerns the non logical assertion and not the logical?
i ve found in an exemple in the Drools-JBoss-Rules-5.0-Developers-Guide,
that each logically inserted fact has a counter which is incremented every
time an equal fact is inserted. Does this counter belongs to the drools
specification ?
--
View this message in context: http://drools.46999.n3.nabble.com/Logical-assertions-the-KnowledgeBaseCon...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 7 months
Intersect
by Gabriel Matei Toma
hello,
I've been searching for a while with no luck : is there a way to intersect
multiple time ranges ?
Thanks in advance,
Best regards,
Gab
12 years, 7 months
5.4.CR1 Guvnor bug?
by Sean Su
Attached is the repository exported from 5.3.final. There are two issues
here.
I would appreciate it if the development can take a look.
1. The last column of the decision table does not display any values on
5.4.CR1 while it works fine on 5.3.0. Please note the rules are still
generated correctly and it even passes the validator from 5.4.CR1. However
there is some GUI issue here.
2. If you generate a deployment Snapshot, everything seems fine. However
when trying to access the generated file (from the link provided by
Guvnor), I get the NullPointerException. This can be reproduced in both
5.3.0.final and 5.4.CR1, though the trace from 5.4.CR1 is shorter.
I initially reported this NPE couple of days ago under the assumption that
it is caused by Guvnor and Joda time integration. But it seems it happens
(randomly) in that situations.
Thanks
Sean
--
"But beware of the Dark Side. Anger, fear, aggression - the Dark Side of
the Force are they." -Yoda
12 years, 7 months
Re: [rules-users] Using GUVNOR for FUSION RULES
by Pellecchia Carolina
Hi Mike,
I couldn't bind a field because the click on the field doesn't work.
concretely, please see attached.
Thank you in advance,
Carolina Pellecchia
---------- Forwarded message ----------
From: Michael Anstis <michael.anstis(a)gmail.com<mailto:michael.anstis@gmail.com>>
Date: Fri, Apr 27, 2012 at 11:26 AM
Subject: Re: [rules-users] Using GUVNOR for FUSION RULES
To: Rules Users List <rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>>
Glad to be of assistance.
To bind a field, once the field has been added to the Fact type simply click on the field name.
With kind regards,
Mike
On 27 April 2012 08:31, Pellecchia Carolina <c.pellecchia(a)vitrociset.it<mailto:c.pellecchia@vitrociset.it>> wrote:
Hi Mike,
I’m a colleague of Matteo Cusmai, we would like to thank you for your suggestions. you have been very helpful.
Following your steps, I couldn't understand a point: how can I bind a field(for ex. RadiationObservation.location) to a variable?
specifically,
$obs : RadiationObservation(?$obsLocation : location? ) over window:length (1) from entry-point "lowLevelSensorStream"
Best regards,
Carolina Pellecchia
________________________________________
Da: rules-users-bounces(a)lists.jboss.org<mailto:rules-users-bounces@lists.jboss.org> [rules-users-bounces(a)lists.jboss.org<mailto:rules-users-bounces@lists.jboss.org>] per conto di rules-users-request(a)lists.jboss.org<mailto:rules-users-request@lists.jboss.org> [rules-users-request(a)lists.jboss.org<mailto:rules-users-request@lists.jboss.org>]
Inviato: giovedì 26 aprile 2012 19.07
A: rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>
Oggetto: rules-users Digest, Vol 65, Issue 93
Send rules-users mailing list submissions to
rules-users(a)lists.jboss.org<mailto:rules-users@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(a)lists.jboss.org<mailto:rules-users-request@lists.jboss.org>
You can reach the person managing the list at
rules-users-owner(a)lists.jboss.org<mailto:rules-users-owner@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: Setting variables in a stateless session (Welsh, Armand)
2. Re: Using GUVNOR for FUSION RULES (Michael Anstis)
3. Re: Guvnor guided editor and non argument constructor
(Michael Anstis)
4. looking for advice (Bobby Richards)
5. Re: Guvnor guided editor and non argument constructor
(Vincent LEGENDRE)
6. Re: Guvnor guided editor and non argument constructor (Sean Su)
----------------------------------------------------------------------
Message: 1
Date: Thu, 26 Apr 2012 15:57:11 +0000
From: "Welsh, Armand" <AWelsh(a)StateStreet.com>
Subject: Re: [rules-users] Setting variables in a stateless session
To: "rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>" <rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>>
Message-ID:
<D52DE19B4C463C4BA21F81790B9F079543084863(a)GDCPW3376.corp.statestr.com<mailto:D52DE19B4C463C4BA21F81790B9F079543084863@GDCPW3376.corp.statestr.com>>
Content-Type: text/plain; charset="us-ascii"
Think of a stateless knowledge session as being a statefull knowledge session, with the following adjustments:
A stateless knowledge session cannot be manipulated prior the start of the session.
A stateless knowledge session cannot be manipulated or queried after the end of the session.
A stateless session begins when you execute the fireallrules method.
A stateless session ends when the rule processing terminates. -- There is no pause, there is no restarting. The instant the rules stop firing, and return to your calling code, the knowledge session has been torn down.
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org<mailto:rules-users-bounces@lists.jboss.org> [mailto:rules-users-bounces@lists.jboss.org<mailto:rules-users-bounces@lists.jboss.org>] On Behalf Of bardelman
Sent: Thursday, April 26, 2012 2:06 AM
To: rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>
Subject: [rules-users] Setting variables in a stateless session
hi folks, this is a simple question ,
i just want to understand how is it possible that a stateless session have a
setGlobal() method as it does not maintain a state. What's the point ?!
i also have some confusion between a "request scope" and a "stateless
session scope" i think it s the same..
--
View this message in context: http://drools.46999.n3.nabble.com/Setting-variables-in-a-stateless-sessio...
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/rules-users
------------------------------
Message: 2
Date: Thu, 26 Apr 2012 15:52:09 +0100
From: Michael Anstis <michael.anstis(a)gmail.com<mailto:michael.anstis@gmail.com>>
Subject: Re: [rules-users] Using GUVNOR for FUSION RULES
To: Rules Users List <rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>>
Message-ID:
<CAAG9P0tN=HqTJ9hkJHDiQGBk=_10o4f810-bQBhbTFwUtO-fEQ(a)mail.gmail.com<mailto:10o4f810-bQBhbTFwUtO-fEQ@mail.gmail.com>>
Content-Type: text/plain; charset="iso-8859-1"
Sure.
- Create "New Rule"
- Add a condition (green + near "WHEN")
- Select "From Entry Point"
- Type "lowLevelSensorStream" into TextBox
- Click on "click to add patterns..."
- Select your Fact Type (see * below)
- In "Over sliding window" ListBox select "Length"
- Type "1" into the TextBox next to "Length".
* OK, so this is possibly where you're having problems.
In order for a Fact Type to be used with CEP it needs to be annotated as an
Event. This is how this can be accomplished:-
*If you have a Declarative Model
*
- Open the Declarative Model
- Select the Fact Type that should be an Event
- Add an Annotation, name="role", key="value", value="event"
- Save
*If you have a POJO Model*
- Create a new Declarative Model
- Add a Fact Type that matches the name of that in your JAR
- Add an Annotation, name="role", key="value", value="event"
- Save
Annotating your POJO is covered in the Drools Expert User Guide. You are
just using Guvnor to achieve what is required.
With kind regards,
Mike
On 26 April 2012 15:22, Matteo Cusmai <cusmaimatteo(a)gmail.com<mailto:cusmaimatteo@gmail.com>> wrote:
> Hi Mike,
> thanks for suggestion, but i have already read documentation.
>
> First of all, i cannot define "over window:length(1) from entry-point
> lowLevelSensorStream".
> Do you help me to do this?
>
> Best Regards,
> Matteo.
>
>
>
> On Thu, Apr 26, 2012 at 11:32 AM, Michael Anstis <michael.anstis(a)gmail.com<mailto:michael.anstis@gmail.com>
> > wrote:
>
>> Yes this is possible with Guvnor 5.2 onwards.
>>
>> The user-guide explains how to use the Guided Rule Editor (but not
>> specifically CEP features).
>>
>> Read that and give it a try - it's reasonably intuitive (not an excuse
>> for poor documentation though) and come back here with questions.
>>
>> With kind regards,
>>
>> Mike
>>
>> On 26 April 2012 09:08, Matteo Cusmai <cusmaimatteo(a)gmail.com<mailto:cusmaimatteo@gmail.com>> wrote:
>>
>>> Hi all,
>>> i am novice on GUVNOR, but i would like to define my fusion rules by
>>> graphical tool.
>>>
>>> An example of my rules is:
>>>
>>> rule "radiation-event"
>>> salience 10
>>> no-loop
>>> when
>>> $obs : RadiationObservation( $obsLocation : location, value >
>>> 10 ) over window:length(1) from entry-point lowLevelSensorStream
>>> not RadiationEvent( this meets[ 25s ] $obs, location
>>> geoIsWithinDistance[ 5m ] $obsLocation )
>>> then
>>> insert(new RadiationEvent( $obs, "Radiation over 10",
>>> Event.THREAT_HIGH, $obsLocation, $obs.getSensor() ));
>>> end
>>>
>>> rule "radiation-update"
>>> salience 5
>>> no-loop
>>> when
>>> $obs : RadiationObservation( $obsLocation : location, value >
>>> 10 ) over window:length(1) from entry-point lowLevelSensorStream
>>> $event : RadiationEvent( this meets[ 25s ] $obs, location
>>> geoIsWithinDistance[ 5m ] $obsLocation )
>>> then
>>> Event e = Event.clone($event);
>>> e.addObservation($obs);
>>> insert( e );
>>> retract($event);
>>> retract($obs);
>>> end
>>>
>>> Is it possibile to define rules such the above using GUVNOR?
>>> Are there some documentation or tutorial?
>>>
>>> Thanks a lot in advance,
>>> Matteo Cusmai.
>>>
>>> _______________________________________________
>>> rules-users mailing list
>>> rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>
>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>>
>>>
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org<mailto:rules-users@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/20120426/31ab515...
------------------------------
Message: 3
Date: Thu, 26 Apr 2012 14:40:27 +0100
From: Michael Anstis <michael.anstis(a)gmail.com<mailto:michael.anstis@gmail.com>>
Subject: Re: [rules-users] Guvnor guided editor and non argument
constructor
To: Rules Users List <rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>>
Message-ID:
<CAAG9P0tnkU2nLzXduz03si26uL-wFtRAA=0ogGAF05OJEZ4dGw(a)mail.gmail.com<mailto:0ogGAF05OJEZ4dGw@mail.gmail.com>>
Content-Type: text/plain; charset="iso-8859-1"
Seems reasonable enough.
On 26 April 2012 14:36, Sean Su <sean.x.su(a)gmail.com<mailto:sean.x.su@gmail.com>> wrote:
> It seems that the new fact created by the guided editor must be from
> the java class that has the default non argument constructor in
> Guvnor. There seems no way we can customize it to pass arguments in.
> This would force us to provide setters to the object.
>
> Is this a true statement?
>
> Thanks
>
> Sean
>
> Sent from my iPad
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org<mailto:rules-users@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/20120426/75a0a7a...
------------------------------
Message: 4
Date: Thu, 26 Apr 2012 11:42:41 -0500
From: Bobby Richards <bobby.richards(a)gmail.com<mailto:bobby.richards@gmail.com>>
Subject: [rules-users] looking for advice
To: rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>
Message-ID:
<CAAqkdrv7Nv1WMByZsd+XM=OZvetnEOFk03x7QaTGyNc6wAbccQ(a)mail.gmail.com<mailto:OZvetnEOFk03x7QaTGyNc6wAbccQ@mail.gmail.com>>
Content-Type: text/plain; charset="iso-8859-1"
I have not yet determined how I want to implement my problem and was hoping
to get some feedback.
I am using drools to migrate the logic from my automated currency trading
infrastructure. Each currency pair, i.e. eurusd has around
200 attributes associated with it.
This includes range values (high, low, average) for multiple time periods,
volatility information, bid/ask updates etc.
Currently I have classes associated for each, so say for range:
class Range {
double high;
double low;
double avg;
}
Range europe = new Range(); //european trading hours
Range us = new Range(); //us trading hours
Questions:
1. I am wondering if I should not just create a map that lists every
attribute per pair as a key ("eurusd:range:europe:high")? So essentially
my drools session will have one fact, not counting the incoming quotes. I
see on the list that this was a problem before the mvel updates but that
was a while ago.
2. When an incoming quote might modify a value, what is the performance
difference between using a rule to change the value or making the changes
outside of the ksession and referencing the facthandler to modify? Is one
method considered 'cleaner'?
Thanks,
Bobby
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120426/2b86c5f...
------------------------------
Message: 5
Date: Thu, 26 Apr 2012 18:48:37 +0200 (CEST)
From: Vincent LEGENDRE <vincent.legendre(a)eurodecision.com<mailto:vincent.legendre@eurodecision.com>>
Subject: Re: [rules-users] Guvnor guided editor and non argument
constructor
To: Rules Users List <rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>>
Message-ID:
<1c470056-3677-4bd2-a1eb-368610b51999(a)confiance.eurodecision.fr<mailto:1c470056-3677-4bd2-a1eb-368610b51999@confiance.eurodecision.fr>>
Content-Type: text/plain; charset="utf-8"
JavaBeans convention : all default constructible and plenty of setters (for writeable properties) and getters (for readeable properties)
----- Mail original -----
De: "Michael Anstis" <michael.anstis(a)gmail.com<mailto:michael.anstis@gmail.com>>
?: "Rules Users List" <rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>>
Envoy?: Jeudi 26 Avril 2012 15:40:27
Objet: Re: [rules-users] Guvnor guided editor and non argument constructor
Seems reasonable enough.
On 26 April 2012 14:36, Sean Su < sean.x.su(a)gmail.com<mailto:sean.x.su@gmail.com> > wrote:
It seems that the new fact created by the guided editor must be from
the java class that has the default non argument constructor in
Guvnor. There seems no way we can customize it to pass arguments in.
This would force us to provide setters to the object.
Is this a true statement?
Thanks
Sean
Sent from my iPad
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org<mailto:rules-users@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/20120426/29fa984...
------------------------------
Message: 6
Date: Thu, 26 Apr 2012 13:06:57 -0400
From: Sean Su <sean.x.su(a)gmail.com<mailto:sean.x.su@gmail.com>>
Subject: Re: [rules-users] Guvnor guided editor and non argument
constructor
To: Rules Users List <rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>>
Message-ID: <-6645870489207221519@unknownmsgid>
Content-Type: text/plain; charset="iso-8859-1"
What I am prototyping is part of the event processing (with or without
fusion). I want to use the rules created by the Guvnor to create the new
events. However, as you would understand, once the event has been created,
it should not be modified as it happened in the past.
So I am trying to avoid setters if possible.
Sean
Sent from my iPad
On Apr 26, 2012, at 12:49 PM, Vincent LEGENDRE <
vincent.legendre(a)eurodecision.com<mailto:vincent.legendre@eurodecision.com>> wrote:
JavaBeans convention : all default constructible and plenty of setters (for
writeable properties) and getters (for readeable properties)
------------------------------
*De: *"Michael Anstis" <michael.anstis(a)gmail.com<mailto:michael.anstis@gmail.com>>
*?: *"Rules Users List" <rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>>
*Envoy?: *Jeudi 26 Avril 2012 15:40:27
*Objet: *Re: [rules-users] Guvnor guided editor and non argument constructor
Seems reasonable enough.
On 26 April 2012 14:36, Sean Su <sean.x.su(a)gmail.com<mailto:sean.x.su@gmail.com>> wrote:
> It seems that the new fact created by the guided editor must be from
> the java class that has the default non argument constructor in
> Guvnor. There seems no way we can customize it to pass arguments in.
> This would force us to provide setters to the object.
>
> Is this a true statement?
>
> Thanks
>
> Sean
>
> Sent from my iPad
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>
> https://lists.jboss.org/mailman/listinfo/rules-users
>
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org<mailto:rules-users@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/20120426/26a2bda...
------------------------------
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/rules-users
End of rules-users Digest, Vol 65, Issue 93
*******************************************
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org<mailto:rules-users@lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/rules-users
12 years, 7 months
Re: [rules-users] modify, retract, setFocus and Salience
by gboro54
I will take a stab at answering this:
-Modify and Retract will cause the tree to be re-evaluated for the current
facts in memory. This may cause new activations or cancellations to occur.
Be forewarned that a rule that modifies a fact may cause a continuous loop
if the conditions for that rule are always satisfied. If you wish to not
have this behavior look at no-loop
-Salience: Can be useful but I have found that using a controller fact to
order execution is more efficient. The problem with Salience is that it can
cause your tree to become to linear thus the behavior of the rules engine is
more like a bunch of if statements rather then being able to match patterns
and fire. I do use salience for some rules but try not to over do it
-setFocus: I don't have anything wrong with this. This allows you to
segments your rules into agenda groups.
I am sure someone else on here can add more.
-Mike
aps4u wrote
>
> will these conditions make any trouble? waiting for a reply..
>
--
View this message in context: http://drools.46999.n3.nabble.com/modify-retract-setFocus-and-Salience-tp...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 7 months
Dynamically create drools mvel rules
by Anton Hughes
Hi
I remember seeing this functionality, but after googling - and not finding
anything - I thought I would ask here.
I have a lot of xml files that contain if conditions.
I would like to read these, and convert them to drools mvel rules.
Can someone suggest the best way to do this?
Thanks and regards,
Anton
12 years, 7 months
Drools Guvnor - validate a rule results in "Unable to Analyse Expression"
by FlyingEagle
Hi folks,
I have defined some rules in Eclipse and tested with JUnit tests and
everything was fine.
Now I defined the rules in Guvnor and while validating I get the following
error:
[CardTrapping] Unable to Analyse Expression Fraud fraud = new
Fraud(Fraud.CARD_TRAPPING, new SSTEvent[] { $event1, $event2, $event3,
$event4 }); fraudControl.handleFraud(fraud);: [Error: expected type:
com.wn.fraud.droolstest.model.SSTEvent; but found:
com.wn.fraud.droolstest.model.SSTEvent] [Near : {... SSTEvent[] { $event1,
$event2, $event3, $event4 }) ....}] ^ [Line: 1, Column: 70]
I have imported my data model, before creating the rules, therefor for the
type SSTEvent an import is defined. But it seems, that the type SSTEvent
exists with different versions?
I have this problem for each rule, when I'm using the SSTEvent type in the
"then" case.
Here the complete rule defintion:
package com.wn.fraud.droolstest
import com.wn.fraud.droolstest.model.Fraud;
import com.wn.fraud.droolstest.model.FraudControl;
import com.wn.fraud.droolstest.model.SSTEvent;
global FraudControl fraudControl;
rule "CardTrapping"
when
$event1 : SSTEvent ( eventNumber == SSTEvent.CARD_JAMMED ) from
entry-point "device-event-stream"
$event2 : SSTEvent ( this after [ 0s, 30s ] $event1,
eventNumber == SSTEvent.IN_SERVICE,
deviceId == $event1.deviceId,
branchName == $event1.branchName ) from entry-point
"device-event-stream"
$event3 : SSTEvent ( this after [ 0s, 30s ] $event2,
eventNumber == SSTEvent.CARD_JAMMED,
deviceId == $event1.deviceId,
branchName == $event1.branchName ) from entry-point
"device-event-stream"
$event4 : SSTEvent ( this after [ 0s, 30s ] $event3,
eventNumber == SSTEvent.IN_SERVICE,
deviceId == $event1.deviceId,
branchName == $event1.branchName ) from entry-point
"device-event-stream"
then
// inform fraud control
Fraud fraud = new Fraud(Fraud.CARD_TRAPPING, new SSTEvent[] {
$event1, $event2, $event3, $event4 });
fraudControl.handleFraud(fraud);
end
Thx a lot for help!
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Guvnor-validate-a-rule-results-i...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 7 months
Re: [rules-users] Using GUVNOR for FUSION RULES
by Pellecchia Carolina
Hi Mike,
I’m a colleague of Matteo Cusmai, we would like to thank you for your suggestions. you have been very helpful.
Following your steps, I couldn't understand a point: how can I bind a field(for ex. RadiationObservation.location) to a variable?
specifically,
$obs : RadiationObservation(?$obsLocation : location? ) over window:length (1) from entry-point "lowLevelSensorStream"
Best regards,
Carolina Pellecchia
________________________________________
Da: rules-users-bounces(a)lists.jboss.org [rules-users-bounces(a)lists.jboss.org] per conto di rules-users-request(a)lists.jboss.org [rules-users-request(a)lists.jboss.org]
Inviato: giovedì 26 aprile 2012 19.07
A: rules-users(a)lists.jboss.org
Oggetto: rules-users Digest, Vol 65, Issue 93
Send rules-users mailing list submissions to
rules-users(a)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(a)lists.jboss.org
You can reach the person managing the list at
rules-users-owner(a)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: Setting variables in a stateless session (Welsh, Armand)
2. Re: Using GUVNOR for FUSION RULES (Michael Anstis)
3. Re: Guvnor guided editor and non argument constructor
(Michael Anstis)
4. looking for advice (Bobby Richards)
5. Re: Guvnor guided editor and non argument constructor
(Vincent LEGENDRE)
6. Re: Guvnor guided editor and non argument constructor (Sean Su)
----------------------------------------------------------------------
Message: 1
Date: Thu, 26 Apr 2012 15:57:11 +0000
From: "Welsh, Armand" <AWelsh(a)StateStreet.com>
Subject: Re: [rules-users] Setting variables in a stateless session
To: "rules-users(a)lists.jboss.org" <rules-users(a)lists.jboss.org>
Message-ID:
<D52DE19B4C463C4BA21F81790B9F079543084863(a)GDCPW3376.corp.statestr.com>
Content-Type: text/plain; charset="us-ascii"
Think of a stateless knowledge session as being a statefull knowledge session, with the following adjustments:
A stateless knowledge session cannot be manipulated prior the start of the session.
A stateless knowledge session cannot be manipulated or queried after the end of the session.
A stateless session begins when you execute the fireallrules method.
A stateless session ends when the rule processing terminates. -- There is no pause, there is no restarting. The instant the rules stop firing, and return to your calling code, the knowledge session has been torn down.
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of bardelman
Sent: Thursday, April 26, 2012 2:06 AM
To: rules-users(a)lists.jboss.org
Subject: [rules-users] Setting variables in a stateless session
hi folks, this is a simple question ,
i just want to understand how is it possible that a stateless session have a
setGlobal() method as it does not maintain a state. What's the point ?!
i also have some confusion between a "request scope" and a "stateless
session scope" i think it s the same..
--
View this message in context: http://drools.46999.n3.nabble.com/Setting-variables-in-a-stateless-sessio...
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
------------------------------
Message: 2
Date: Thu, 26 Apr 2012 15:52:09 +0100
From: Michael Anstis <michael.anstis(a)gmail.com>
Subject: Re: [rules-users] Using GUVNOR for FUSION RULES
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<CAAG9P0tN=HqTJ9hkJHDiQGBk=_10o4f810-bQBhbTFwUtO-fEQ(a)mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
Sure.
- Create "New Rule"
- Add a condition (green + near "WHEN")
- Select "From Entry Point"
- Type "lowLevelSensorStream" into TextBox
- Click on "click to add patterns..."
- Select your Fact Type (see * below)
- In "Over sliding window" ListBox select "Length"
- Type "1" into the TextBox next to "Length".
* OK, so this is possibly where you're having problems.
In order for a Fact Type to be used with CEP it needs to be annotated as an
Event. This is how this can be accomplished:-
*If you have a Declarative Model
*
- Open the Declarative Model
- Select the Fact Type that should be an Event
- Add an Annotation, name="role", key="value", value="event"
- Save
*If you have a POJO Model*
- Create a new Declarative Model
- Add a Fact Type that matches the name of that in your JAR
- Add an Annotation, name="role", key="value", value="event"
- Save
Annotating your POJO is covered in the Drools Expert User Guide. You are
just using Guvnor to achieve what is required.
With kind regards,
Mike
On 26 April 2012 15:22, Matteo Cusmai <cusmaimatteo(a)gmail.com> wrote:
> Hi Mike,
> thanks for suggestion, but i have already read documentation.
>
> First of all, i cannot define "over window:length(1) from entry-point
> lowLevelSensorStream".
> Do you help me to do this?
>
> Best Regards,
> Matteo.
>
>
>
> On Thu, Apr 26, 2012 at 11:32 AM, Michael Anstis <michael.anstis(a)gmail.com
> > wrote:
>
>> Yes this is possible with Guvnor 5.2 onwards.
>>
>> The user-guide explains how to use the Guided Rule Editor (but not
>> specifically CEP features).
>>
>> Read that and give it a try - it's reasonably intuitive (not an excuse
>> for poor documentation though) and come back here with questions.
>>
>> With kind regards,
>>
>> Mike
>>
>> On 26 April 2012 09:08, Matteo Cusmai <cusmaimatteo(a)gmail.com> wrote:
>>
>>> Hi all,
>>> i am novice on GUVNOR, but i would like to define my fusion rules by
>>> graphical tool.
>>>
>>> An example of my rules is:
>>>
>>> rule "radiation-event"
>>> salience 10
>>> no-loop
>>> when
>>> $obs : RadiationObservation( $obsLocation : location, value >
>>> 10 ) over window:length(1) from entry-point lowLevelSensorStream
>>> not RadiationEvent( this meets[ 25s ] $obs, location
>>> geoIsWithinDistance[ 5m ] $obsLocation )
>>> then
>>> insert(new RadiationEvent( $obs, "Radiation over 10",
>>> Event.THREAT_HIGH, $obsLocation, $obs.getSensor() ));
>>> end
>>>
>>> rule "radiation-update"
>>> salience 5
>>> no-loop
>>> when
>>> $obs : RadiationObservation( $obsLocation : location, value >
>>> 10 ) over window:length(1) from entry-point lowLevelSensorStream
>>> $event : RadiationEvent( this meets[ 25s ] $obs, location
>>> geoIsWithinDistance[ 5m ] $obsLocation )
>>> then
>>> Event e = Event.clone($event);
>>> e.addObservation($obs);
>>> insert( e );
>>> retract($event);
>>> retract($obs);
>>> end
>>>
>>> Is it possibile to define rules such the above using GUVNOR?
>>> Are there some documentation or tutorial?
>>>
>>> Thanks a lot in advance,
>>> Matteo Cusmai.
>>>
>>> _______________________________________________
>>> 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
>>
>>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
12 years, 7 months
Guvnor and Joda time
by Sean Su
Do we support Joda time objects in Guvnor (5.3)? I did add joda time jar on
the classpath (Guvnor's lib folder) and there is no class not found
exception. However I get following exception when trying to access the
deployment snapshot.
The snapshot worked fine when I was using Date. After switching to Joda
time, I did reload the POJO model and regenerated the deployment snapshot.
I am using 5.3.final.
java.lang.NullPointerException
at java.io.OutputStream.write(OutputStream.java:58)
at
org.drools.guvnor.server.files.FileManagerUtils.loadBinaryPackage(FileManagerUtils.java:196)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
at
org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
at
org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at
org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at
org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at
org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:163)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at
org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
at
org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
at
org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
at
org.drools.guvnor.server.files.FileManagerUtils_$$_javassist_seam_10.loadBinaryPackage(FileManagerUtils_$$_javassist_seam_10.java)
at
org.drools.guvnor.server.files.PackageDeploymentServlet$1.execute(PackageDeploymentServlet.java:252)
at
org.drools.guvnor.server.files.RepositoryServlet.doAuthorizedAction(RepositoryServlet.java:75)
at
org.drools.guvnor.server.files.PackageDeploymentServlet.doGet(PackageDeploymentServlet.java:130)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:625)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.seam.web.ContextFilter$1.process(ContextFilter.java:42)
at
org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:65)
at org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:37)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
--
"But beware of the Dark Side. Anger, fear, aggression - the Dark Side of
the Force are they." -Yoda
12 years, 7 months
Redundancy check option not working in Drools Verifier 5.4
by worldofprasanna
Hi All,
I tried to use Drools Verifier to validate the available rules. I got all
the warning types like MISSING_EQUALITY, ALWAYS_FALSE. But I couldn t get
the redundancy warning, eventhough i have given the duplicate rules
explicitly.
I am using Drools Verifier 5.4.0.Final.
Herewith given the following details,
1. Sample rule file
rule "rule 1"
when
$server : Server(processors==2, memory==1024)
then
System.out.println("rule 1")
end
rule "rule 2"
when
$server : Server(processors==2, processors!=2)
then
System.out.println("rule")
end
rule "rule 3"
when
$server : Server(processors==2, memory==1024)
then
System.out.println("rule 3")
end
2. Code which verifies the validity of the rule.
VerifierBuilder vBuilder = VerifierBuilderFactory.newVerifierBuilder();
Verifier verifier = vBuilder.newVerifier();
verifier.addResourcesToVerify(new
ClassPathResource("sample.drl",
DroolsVerifierCheck.class),
ResourceType.DRL);
verifier.fireAnalysis();
VerifierReport result = verifier.getResult();
// To display the warnings in verifier.
Collection<VerifierMessageBase> warningMessages =
result.getBySeverity(Severity.WARNING);
for (VerifierMessageBase msg : warningMessages) {
System.out.println("Note: " + msg.getMessage() +
" type: " + msg.getMessageType() +
" on: " + msg.getFaulty());
}
Problem
In the sample rule, you can find rule 1 and rule 3 are same. But I didn t
get the warning for redundancy.
Research done
When i debug the code, i found like the rule "Find redundant pattern
possibilities from rule possibilities" and "Find redundant restrictions from
pattern possibilities" are loaded into the Knowledge base created and tagged
with Agenda group as Main, but those are not present in the Knowledge
session created (I mean after inserting the objects into the Knowledge
session in the code : VerifierImpl.java).
Also can anybody explain when a rule will be present in the knowledge base
but not selected by the agenda. I haven t modified anything in the
AgendaFilter and its given the default value ScopeAgendaFilter.
Kindly let me know why the redundancy warning is not given in my case ?
P.S : I have gone through the post below,
http://http://drools.46999.n3.nabble.com/Drools-verifier-td2681002.html
http://drools.46999.n3.nabble.com/Drools-verifier-td2681002.html
and at the bottom they have asked the same question, but there is no answer
available for it.
Thanks,
Prasanna.
--
View this message in context: http://drools.46999.n3.nabble.com/Redundancy-check-option-not-working-in-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 7 months