<div class="gmail_extra">Sure.<br><ul><li>Create "New Rule"</li></ul><ul><li>Add a condition (green + near "WHEN")</li></ul><ul><li>Select "From Entry Point"</li></ul><ul><li>Type "lowLevelSensorStream" into TextBox</li>
</ul><ul><li>Click on "click to add patterns..."</li></ul><ul><li>Select your Fact Type (see * below)</li></ul><ul><li>In "Over sliding window" ListBox select "Length"</li></ul><ul><li>Type "1" into the TextBox next to "Length".</li>
</ul>* OK, so this is possibly where you're having problems.<br><br>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:-<br><br><i><b>If you have a Declarative Model <br>
</b></i><ul><li>Open the Declarative Model</li></ul><ul><li>Select the Fact Type that should be an Event</li></ul><ul><li>Add an Annotation, name="role", key="value", value="event"</li></ul><ul>
<li>Save</li></ul><br><i><b>If you have a POJO Model</b></i><br><ul><li>Create a new Declarative Model</li></ul><ul><li>Add a Fact Type that matches the name of that in your JAR</li></ul><ul><li>Add an Annotation, name="role", key="value", value="event"</li>
</ul><ul><li>Save</li></ul>
<br>Annotating your POJO is covered in the Drools Expert User Guide. You are just using Guvnor to achieve what is required.<br><br>With kind regards,<br><br>Mike<br><br><div class="gmail_quote">On 26 April 2012 15:22, Matteo Cusmai <span dir="ltr"><<a href="mailto:cusmaimatteo@gmail.com" target="_blank">cusmaimatteo@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra">Hi Mike,<br>thanks for suggestion, but i have already read documentation.<br><br>First of all, i cannot define "over window:length(1) from entry-point lowLevelSensorStream".<br>
Do you help me to do this?<br>
<br>Best Regards,<br>Matteo.<div><div class="h5"><br><br><br><div class="gmail_quote">On Thu, Apr 26, 2012 at 11:32 AM, Michael Anstis <span dir="ltr"><<a href="mailto:michael.anstis@gmail.com" target="_blank">michael.anstis@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra">Yes this is possible with Guvnor 5.2 onwards.<br><br>The user-guide explains how to use the Guided Rule Editor (but not specifically CEP features).<br>
<br>Read that and give it a try - it's reasonably intuitive (not an excuse for poor documentation though) and come back here with questions.<br>
<br>With kind regards,<br><br>Mike<br><br><div class="gmail_quote"><div><div>On 26 April 2012 09:08, Matteo Cusmai <span dir="ltr"><<a href="mailto:cusmaimatteo@gmail.com" target="_blank">cusmaimatteo@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>Hi all,<br>i am novice on GUVNOR, but i would like to define my fusion rules by graphical tool.<br>
<br>An example of my rules is:<br>
<br>rule "radiation-event"<br> salience 10<br> no-loop<br> when<br> $obs : RadiationObservation( $obsLocation : location, value > 10 ) over window:length(1) from entry-point lowLevelSensorStream<br>
not RadiationEvent( this meets[ 25s ] $obs, location geoIsWithinDistance[ 5m ] $obsLocation )<br> then<br> insert(new RadiationEvent( $obs, "Radiation over 10", Event.THREAT_HIGH, $obsLocation, $obs.getSensor() ));<br>
end<br><br>rule "radiation-update"<br> salience 5<br> no-loop<br> when<br> $obs : RadiationObservation( $obsLocation : location, value > 10 ) over window:length(1) from entry-point lowLevelSensorStream<br>
$event : RadiationEvent( this meets[ 25s ] $obs, location geoIsWithinDistance[ 5m ] $obsLocation )<br> then<br> Event e = Event.clone($event);<br> e.addObservation($obs);<br> insert( e );<br>
retract($event);<br> retract($obs);<br>end<br><br>Is it possibile to define rules such the above using GUVNOR?<br>Are there some documentation or tutorial?<br><br>Thanks a lot in advance,<br>Matteo Cusmai.<br>
<br></div></div>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br></div></div></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br></div>