[rules-users] rule does not fire at first event
Mauricio Salatino
salaboy at gmail.com
Wed Nov 9 12:03:03 EST 2011
Are you calling the fireAllRules() method after inserting the events? or
using fireUntilHalt()?
You can activate the log to see what is happening with:
KnowledgeRuntimeLoggerFactory.newConsoleLogger(session);
Cheers
On Wed, Nov 9, 2011 at 1:37 PM, ukriegel
<ulrich.kriegel at isst.fraunhofer.de>wrote:
> Hi there,
> we use drools fusion 5.3. Final.
> In a drl-file, a fact and an event and the following rules are declared
>
> package ... etc
>
> declare ActivityState
> @role(fact)
> state : StateType
> end
>
>
> rule "set initial state"
> dialect "java"
> salience 100
> when not (exists KFActivityState())
> then
> ActivityState $actState = new ActivityState();
> $actState.setState(StateType.STANDBY);
> insert($actState);
> System.out.println("ActivityState inserted "+ new Date());
> end
>
>
>
>
> declare Command
> @role (event)
> end
>
>
> rule "request information"
> dialect "java"
> when Command(commandType == CommandType.REQUEST_INFORMATION) from
> entry-point "XXX"
> $s: ActivityState(state ==
> ComponentStateType.ACTIVE||state ==
> ComponentStateType.PASSIVE||state == ComponentStateType.STANDBY)
> then
> System.out.println("Send Report");
> end
>
>
> The rule request information doesn't fire with the first command event, but
> from the second one it fires always.
>
> What's wrong with my code?
>
> Thanks in advance
>
> Ulrich
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/rule-does-not-fire-at-first-event-tp3494056p3494056.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
>
--
- CTO @ http://www.plugtree.com
- MyJourney @ http://salaboy.wordpress.com
- Co-Founder @ http://www.jugargentina.org
- Co-Founder @ http://www.jbug.com.ar
- Salatino "Salaboy" Mauricio -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20111109/70caf8d0/attachment.html
More information about the rules-users
mailing list