[rules-users] rule does not fire at first event
ukriegel
ulrich.kriegel at isst.fraunhofer.de
Wed Nov 9 11:37:34 EST 2011
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.
More information about the rules-users
mailing list