[rules-users] Strange MVEL error

Shah, Malay Malay.Shah at morganstanley.com
Tue Nov 3 12:07:19 EST 2009


Hi All,
 
I am trying to compile a drool rule using MVEL dialect and getting the
following weird error. 
 
Unable to determine the used declarations.

unbalanced braces (near code: << ... core1_entityOID); ...>>) (position:
33) : [Rule name=Legacy ETSDB Rule, agendaGroup=MAIN, salience=0,
no-loop=false]

org.mvel.ParseException: unbalanced braces (near code: << ...
core1_entityOID); ...>>) (position: 33)Unable to build expression for
'consequence'

 
The code I am trying to compile is:
 
package S_124
import com.ms.ieddata.dataQuality.violation.Violation;
import com.ms.ieddata.etsdb.model.EtsExecution_core;
import com.ms.ieddata.etsdb.model.EtsExecutionOrder_core;
global java.util.HashSet violations;
global java.util.HashSet violationKeys;

dialect "mvel"

rule "Legacy ETSDB Rule"

when
EtsExecution_core1:EtsExecution_core(crossInd == "1" , lastCapacity !=
"3" , lastDestinationID not in ("EUREX","IDEM","MEFF","LIFFE"))
EtsExecutionOrder_core1:EtsExecutionOrder_core(entityOID ==
EtsExecution_core1.parentOID , exDestination in ("I","L") ,
swapComponentType != "swaps" , orderCapacity not in
("D","R","X","L","E","T","C","O","P","S"),EtsExecutionOrder_core1_entity
OID:entityOID,EtsExecutionOrder_core1_application:application,EtsExecuti
onOrder_core1_entityVID:entityVID)

then

String key="S-124_EtsExecution_core" + "_entityVID_" +
"EtsExecutionOrder_core1_entityVID" + "_application_" +
"EtsExecutionOrder_core1_application" + "_entityOID_" + 
"EtsExecutionOrder_core1_entityOID";

vPresent = violationKeys.contains(key);

if (!vPresent)
{
     violation = new Violation();
     violation.putRuleActionAttribute("ruleId","S-124");
     violation.putRuleActionAttribute("ruleName","Legacy ETSDB Rule");
     violation.putRuleActionAttribute("legacyRuleType","1");
     violation.putRuleActionAttribute("entityName","EtsExecution_core");
     violation.putRuleActionAttribute("fieldName","Field");
 
violation.putRuleActionAttribute("entityVID",EtsExecutionOrder_core1_ent
ityVID);
 
violation.putRuleActionAttribute("application",EtsExecutionOrder_core1_a
pplication);
 
violation.putRuleActionAttribute("entityOID",EtsExecutionOrder_core1_ent
ityOID);
}
 
end
 
The code works fine when I use java dialect. Also, if I remove the if
statement from consequence, the code get compiled in mvel and java
dialects. Am I missing something obvious here? I am using drools 4.0.1.
 
Thanks
 
Malay Shah
Morgan Stanley | IDEAS Practice Areas
750 Seventh Avenue, 6th Floor | New York, NY  10019
Phone: +1 212 762-4495
Malay.Shah at morganstanley.com

 

--------------------------------------------------------------------------
NOTICE: If received in error, please destroy, and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error. We may monitor and store emails to the extent permitted by applicable law.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20091103/9e890668/attachment.html 


More information about the rules-users mailing list