[rules-users] Event and Facts Problem

Wolfgang Laun wolfgang.laun at gmail.com
Fri Jun 28 09:13:26 EDT 2013


Well, the rule says: "With a Resource in state 0 and a Reservation
request, do...".

It's like two cars parking along the double yellow line (without a
ticket yet) and a traffic warden arriving at the scene: it'll be a
ticket for each car...

-W


On 28/06/2013, Andynator <hickl.andy at gmail.com> wrote:
> hey,
> I have a problem with events and facts: when i have two existing facts
> (resources) und i am inserting an event (request), then following rule is
> fired twice (for each resource)
>
> /declare ReservationRequest
> 	@role ( event )
> 	@timestamp ( timestamp )
> 	@expires(0s)
> end
>
> rule "Allocate"
> no-loop true
> when
>     $resource : Resource(state == 0)
>     $request : ReservationRequest() from entry-point "EventStream"
> then
>         modify($resource) { setState(1) };
>         insert(new Allocation($resource, $request.getDuration()));
>
>         log.warn("Rule 'Allocate' fired: '" + $resource.getName() + "' on
> Request '" + $request.getName());
> end/
>
> Any ideas why?
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Event-and-Facts-Problem-tp4024622.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>


More information about the rules-users mailing list