2 Replies Latest reply on Sep 20, 2011 11:16 AM by olddave

    A bit more needed in the debug output?

    olddave

      Hi,

       

      I run my Processes from a RESTful service provided by BPM console server

       

      Across many processes after doing a getDefinitionsJSON() it calls this

       

      KnowledgePackage kpackage: getSession().getKnowledgeBase().getKnowledgePackages()

       

      which returns none because they have all failed with lots of these

       

      [ERROR 13:41:19.202 BST] qtp451360643-61:CommandDelegate - Process Compilation error The left-hand side of an assignment must be a variable

      The left-hand side of an assignment must be a variable

       

      The proplem I have is I cannot think of anywhere I am doing assigments. Can I make a change somewhere that at least gives me the Node name where these are occuring? Otherwise you have no clue about where these are.

       

      Thx.

       

      Ed.

        • 1. Re: A bit more needed in the debug output?
          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

            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.