[rules-users] Drools Guvnor - validate a rule results in "Unable to Analyse Expression"

Michael Anstis michael.anstis at gmail.com
Fri Apr 27 06:24:28 EDT 2012


Can you create a JIRA https://issues.jboss.org/browse/GUVNOR and attach a
repository export please?

On 25 April 2012 13:57, FlyingEagle <elisabeth.wirth at wincor-nixdorf.com>wrote:

> Hi folks,
>
> I have defined some rules in Eclipse and tested with JUnit tests and
> everything was fine.
> Now I defined the rules in Guvnor and while validating I get the following
> error:
>
> [CardTrapping] Unable to Analyse Expression Fraud fraud = new
> Fraud(Fraud.CARD_TRAPPING, new SSTEvent[] { $event1, $event2, $event3,
> $event4 }); fraudControl.handleFraud(fraud);: [Error: expected type:
> com.wn.fraud.droolstest.model.SSTEvent; but found:
> com.wn.fraud.droolstest.model.SSTEvent] [Near : {... SSTEvent[] { $event1,
> $event2, $event3, $event4 }) ....}] ^ [Line: 1, Column: 70]
>
> I have imported my data model, before creating the rules, therefor for the
> type SSTEvent an import is defined. But it seems, that the type SSTEvent
> exists with different versions?
>
> I have this problem for each rule, when I'm using the SSTEvent type in the
> "then" case.
>
> Here the complete rule defintion:
>
> package com.wn.fraud.droolstest
>
> import com.wn.fraud.droolstest.model.Fraud;
> import com.wn.fraud.droolstest.model.FraudControl;
> import com.wn.fraud.droolstest.model.SSTEvent;
>
> global FraudControl fraudControl;
>
> rule "CardTrapping"
>    when
>    $event1 : SSTEvent ( eventNumber == SSTEvent.CARD_JAMMED ) from
> entry-point "device-event-stream"
>        $event2 : SSTEvent ( this after [ 0s, 30s ] $event1,
>                         eventNumber == SSTEvent.IN_SERVICE,
>                         deviceId == $event1.deviceId,
>                         branchName == $event1.branchName ) from entry-point
> "device-event-stream"
>        $event3 : SSTEvent ( this after [ 0s, 30s ] $event2,
>                         eventNumber == SSTEvent.CARD_JAMMED,
>                         deviceId == $event1.deviceId,
>                         branchName == $event1.branchName ) from entry-point
> "device-event-stream"
>        $event4 : SSTEvent ( this after [ 0s, 30s ] $event3,
>                         eventNumber == SSTEvent.IN_SERVICE,
>                         deviceId == $event1.deviceId,
>                         branchName == $event1.branchName ) from entry-point
> "device-event-stream"
>    then
>        // inform fraud control
>        Fraud fraud = new Fraud(Fraud.CARD_TRAPPING, new SSTEvent[] {
> $event1, $event2, $event3, $event4 });
>        fraudControl.handleFraud(fraud);
> end
>
>
> Thx a lot for help!
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Drools-Guvnor-validate-a-rule-results-in-Unable-to-Analyse-Expression-tp3938096p3938096.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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120427/0e2dd737/attachment.html 


More information about the rules-users mailing list