[rules-users] Re: Entity-Beans with Drools 4.0.2
Frank Langelage
frank at lafr.de
Mon Oct 22 11:50:08 EDT 2007
Guardian wrote:
> Hello,
>
> i have a problem to use entity-beans (ejb 3.0) in a DRL-file.
> If i use java-beans everything works fine, but when I use the following rule
> with the "pruefungs"-entity object i get an exception. What is the problem,
> can i use EJB 3.0 entitybeans with drools?
>
> My rules are the following:
>
> rule "Test Entity"
> when
> p : Pruefung( name : pruefungsName )
> then
> System.out.println( name )
> end
>
> rule "Hello World"
> when
> m : Message( status == Message.HELLO, message : message )
> then
> System.out.println( message );
> m.setMessage( "Goodbye cruel world" );
> m.setStatus( Message.GOODBYE );
> update( m );
> end
>
>
> and the exception that occurs:
>
> 12:29:31,093 INFO [STDOUT] cannot read rule file:
> /drools/rules/testRule.drl
> 12:29:31,093 ERROR [STDERR] org.drools.rule.InvalidRulePackage: Rule
> Compilation error : [Rule name=Test Entity, agendaGroup=MAIN, salience=0,
> no-loop=false]
> drools/rules/Rule_Test_Entity_0.java (8:25) : File
> drools/rules/Rule_Test_Entity_0.java, Line 8, Column 25: Expression
> "System.out.println(name)" is not a type
That has nothing to do with the type of Object.
There's simply missing the ";" at the end of the RHS line.
More information about the rules-users
mailing list