[rules-users] having a little problem when using LHS variable in RHS

nemesis29 at free.fr nemesis29 at free.fr
Wed Feb 6 06:35:54 EST 2008


Hello All,

Well i'm trying to create a rule witch need to get some infos in the RHS that
are available in variables declared in the LHS part of the rule.

To make it clear (as my english is not on top ;-) here is an exemple:

the rule file :


rule "NODSLVIP"
	dialect "java"
	when
		$rt : RuleTargetContainer()
		$travellers : TravellerListType() from $rt.metaDossier.travellers
		$traveller : TravellerType() from $travellers.traveller
		$user : UserType() from $traveller.user
		$personalInfo : PersonalInfoType(isVIP == true) from $user.personalInfo
	then
		System.out.println("VIP");
                System.out.println($user.getName());
end

When i use it in my code i have the following exception trhown :

org.mvel.CompileException: problem encountered at node [11] 5{172,191}: unable
to resolve token: declr.identifier

If i remove the line printing the user name all goes well (ie : i have VIP in my
trace when user is vip ^^ ).

What am i missing here? I have seen in the documentation that using LHS variable
is possible bu can't make it work for my case :-( .

Thant in advance for any help you can supply.

N Beucler.



More information about the rules-users mailing list