}
if ( subFlow.getProcessId() == null ) {
errors.add( new RuleFlowProcessValidationErrorImpl( RuleFlowProcessValidationError.SUBFLOW_WITHOUT_PROCESS_ID, "name = " + subFlow.getName() ) );
}
} else if ( node instanceof ActionNode ) {
final ActionNode actionNode = (ActionNode) node;
if ( actionNode.getFrom() == null ) {
errors.add( new RuleFlowProcessValidationErrorImpl( RuleFlowProcessValidationError.ACTION_NODE_WITHOUT_INCOMING_CONNECTIONS, "name = " + actionNode.getName() ) );
}
if ( actionNode.getTo() == null ) {
errors.add( new RuleFlowProcessValidationErrorImpl( RuleFlowProcessValidationError.ACTION_NODE_WITHOUT_OUTGOING_CONNECTIONS, "name = " + actionNode.getName() ) );
}
if ( actionNode.getAction() == null ) {
errors.add( new RuleFlowProcessValidationErrorImpl( RuleFlowProcessValidationError.ACTION_NODE_WITHOUT_ACTION, "name = " + actionNode.getName() ) );
} else {
if (actionNode.getAction() instanceof DroolsConsequenceAction) {
DroolsConsequenceAction droolsAction = (DroolsConsequenceAction) actionNode.getAction();
String actionString = droolsAction.getConsequence();
if (actionString == null) {
errors.add( new RuleFlowProcessValidationErrorImpl( RuleFlowProcessValidationError.ACTION_NODE_WITHOUT_ACTION, "name = " + actionNode.getName() ) );
} else {
try {
ExpressionCompiler compiler = new ExpressionCompiler(actionString);
compiler.setVerifying(true);
ParserContext parserContext = new ParserContext();
//parserContext.setStrictTypeEnforcement(true);
compiler.compile(parserContext);
List mvelErrors = parserContext.getErrorList();
if (mvelErrors != null) {
for (Iterator iterator = mvelErrors.iterator(); iterator.hasNext(); ) {
Object error = iterator.next();
errors.add( new RuleFlowProcessValidationErrorImpl( RuleFlowProcessValidationError.ACTION_NODE_WITH_INVALID_ACTION, "name = " + actionNode.getName() + " " + error ) );
}
}
} catch (Throwable t) {
errors.add( new RuleFlowProcessValidationErrorImpl( RuleFlowProcessValidationError.ACTION_NODE_WITH_INVALID_ACTION, "name = " + actionNode.getName() + " " + t.getMessage() ) );
}
}
}
}
}