[rules-users] The buss pass example of inference results in compilation errors, how to solve these?

ajklunder2 albert.jan.klunder at gmail.com
Wed Mar 20 02:44:44 EDT 2013


Hi,

In the Drools documentation is "the buss pass" example of how to use
inference. 

rule "Infer Adult"
when
  $p : Person( age >= 18 )
then
  insert( new IsAdult( $p ) )
end

However, when I try this myself I get compilation errors on IsAdult and a
missing ";" after the insert statement. (I am using the Drools plugin in
Eclipse)

Here is an example of my own what has the same issue:

//list any import classes here.
import com.example.vdc.VdcLandingPage;
import com.invoicestore.domain.Debtor;

//declare any global variables here
global VdcLandingPage UI;


rule "Infer bad debtor"

when
  	$debtor : Debtor( isBadDebtor() == true )
then
  	insert( new IsBadDebtor( $debtor ) );
end


BuildError: Unable to Analyse Expression drools.insert( new IsBadDebtor(
$debtor ) );:
[Error: Failed to compileShared: 1 compilation error(s): 
 - (1,16) could not resolve class: IsBadDebtor]
[Near : {... drools.insert( new IsBadDebtor( $debtor ) ); ....}]
                            ^
[Line: 23, Column: 0]

I have studied the Drools documentation and cannot find anything what might
lead to a solution. I have tried to set the dialect to "mvel" but that is
not solving the problem.

Any suggestions how to solve this?
  



--
View this message in context: http://drools.46999.n3.nabble.com/The-buss-pass-example-of-inference-results-in-compilation-errors-how-to-solve-these-tp4022912.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list