-
1. Re: A bit more needed in the debug output?
olddave Sep 20, 2011 9:34 AM (in response to olddave)Hi,
I found the place where it logs the errors and this is what I have so far
Process Compilation error : org.drools.lang.descr.ProcessDescr@18a91155
org/drools/bpmn2/Process_org_drools_bpmn2_Load_Data_once_0.java (11:621) : The left-hand side of an assignment must be a variable
org/drools/bpmn2/Process_org_drools_bpmn2_Load_Data_once_0.java (22:1325) : The left-hand side of an assignment must be a variable
Where might I find these files, I assume they are temporary? Could not find them even when having a breakpoint on this "kbuilder.getErrors()"
Thx.
Ed
-
2. Re: A bit more needed in the debug output?
olddave Sep 20, 2011 11:16 AM (in response to olddave)Hi,
Very interesting. I traced into jBPM 5.1 to the point where it validates my ActionNode. It seems that if you use the java dialect then you do not get the benefit of validation!!!!
if (actionString == null) {
errors.add(new ProcessValidationErrorImpl(process,
"Action node '" + node.getName() + "' [" + node.getId() + "] has empty action."));
} else if( "mvel".equals( droolsAction.getDialect() ) ) {
try {
ExpressionCompiler compiler = new ExpressionCompiler(actionString);
compiler.setVerifying(true);
ParserContext parserContext = new ParserContext();
//parserContext.setStrictTypeEnforcement(true);
compiler.compile(parserContext);
List<ErrorDetail> mvelErrors = parserContext.getErrorList();
if (mvelErrors != null) {
for (Iterator<ErrorDetail> iterator = mvelErrors.iterator(); iterator.hasNext(); ) {
ErrorDetail error = iterator.next();
errors.add(new ProcessValidationErrorImpl(process,
"Action node '" + node.getName() + "' [" + node.getId() + "] has invalid action: " + error.getMessage() + "."));
}
}
} catch (Throwable t) {
errors.add(new ProcessValidationErrorImpl(process,
"Action node '" + node.getName() + "' [" + node.getId() + "] has invalid action: " + t.getMessage() + "."));
}
}
So this should be a documented warning to users who write their action code in java? I assume at some point the java gets compiled and this is where my error is picked up. I am going to rewrite in mvel and see how that goes.
I also note that the action node name is given for mel debug output. Since mvel takes a superset of Java, why not use it to determine the error with any java code as well?!?
} else if( "mvel".equals( droolsAction.getDialect() ) || "java".equals(droolsAction.getDialect() ) ) {
Thx.
Ed.