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

FlyingEagle elisabeth.wirth at wincor-nixdorf.com
Wed Apr 25 08:57:32 EDT 2012


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.


More information about the rules-users mailing list