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