[jboss-user] [jBPM] - Re: A bit more needed in the debug output?

olddave do-not-reply at jboss.com
Tue Sep 20 11:15:08 EDT 2011


olddave [http://community.jboss.org/people/olddave] created the discussion

"Re: A bit more needed in the debug output?"

To view the discussion, visit: http://community.jboss.org/message/627544#627544

--------------------------------------------------------------
Hi,

Very interesting. I traced into jBPM 5.1 to the point where it validates my ActionNode. It seems that if you ue theh java dialect then you do not get theh 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 theh action nod enam eis 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.
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/627544#627544]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110920/1655bd21/attachment-0001.html 


More information about the jboss-user mailing list