[rules-users] Rules not firing when facts asserted in a rule RHS in 5.0

Wolfgang Laun wolfgang.laun at gmail.com
Wed Dec 1 06:50:59 EST 2010


We aren't seeing the code where the insertions happen, but I suppose that's
identical to
repeats of
   QuestionValidation qc = new QuestionValidation();
   insert( qv );

I'm sure you've also ascertained that the inserted value:QuestionValidation
is the very same type (including package) as the one used in rule "Test".

I would try and use a Java equivalent for the declared class
QuestionValidation,
just to see whether this is at the root of the problem.

-W


On 1 December 2010 11:13, Chris Selwyn <chris at selwyn-family.me.uk> wrote:

> I have been using the open source Drools 5.1 where I have been inserting
> facts in the RHS of a rule and that has been causing subsequent rules to
> fire just fine.
>
> However, I am working at a customer that requires my to use a supported
> product, so I have moved my rules over to JBoss Rules 5.0.2 and I find
> that this does not work any more.
>
> I have a declarative fact type as follows
> declare QuestionValidation
>     question: String
>     state: String
>     mandatory: Boolean
>     type: String
> end
>
> I have an "init" rule with high salience that inserts a number of
> QuestionValidations into the session.
>
> In order to test what is going on, I created a rule:-
> rule 'Test'
> dialect 'mvel'
> when
>     $qv: QuestionValidation()
> then
>     System.out.println( "QuestionValidation found " + $qv.getQuestion()
> + "/" + $qv.getState() );
> end
>
> This rule never fires if I insert a QuestionValidation in the init rule!
>
> I can see the facts being inserted in the log as follows
>
> [#|2010-12-01T09:19:16.723+0000|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=70;_ThreadName=p:
> thread-pool-1; w: 7;|
> OBJECT ASSERTED value:QuestionValidation( mandatory=true, state=Closed,
> question=B2B_METER_SERIAL_NUMBER, type=string ) factId: 39|#]
>
> But I don't see any associated "ACTIVATION CREATED" for this object.
>
> However, if I insert a QuestionValidation fact created in Java by using
> kbase.getFactType("SWWB2BOutgoing", "QuestionValidation") then the Test
> rule gets fired just fine.
>
> Is there something I am missing? Do I need to to turn on rule chaining
> or something like that? (Surely chaining is on by default).
>
> Chris
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20101201/dc1cb91c/attachment.html 


More information about the rules-users mailing list