0 Replies Latest reply on Jun 13, 2011 10:01 AM by stellina_rosa

    org.drools.RuntimeDroolsException: invalid package name

    stellina_rosa Newbie

      Hi!

      in my process there is a rule-task that set some process variable... for example, this is one rule:

       

      rule "no result"

                ruleflow-group "rules"

                when

       

                          $process: WorkflowProcessInstance()

                          $c: CostFlight(cost == "0")

       

                then

       

                 System.out.println("Nosolution avaible!");

                 $process.setVariable("result","no_result");

       

      end

       

      and at this point I haven't any problem. If I use a diverging gateway ( XOR) with 2 possible way, I must write 2 constraint like this:

       

      (to node NO_RESULT)

      org.drools.runtime.process.WorkflowProcessInstance process = (org.drools.runtime.process.WorkflowProcessInstance)kcontext.getProcessInstance();    

      return "no_result".equals(process.getVariable("result"));

       

      (to node RESULT)

      org.drools.runtime.process.WorkflowProcessInstance process = (org.drools.runtime.process.WorkflowProcessInstance)kcontext.getProcessInstance();    

      return "ok".equals(process.getVariable("result"));


       

      but when I try to launch it, I have this ERROR:

       

      org.drools.RuntimeDroolsException: invalid package name

                at org.jbpm.compiler.ProcessBuilderImpl.buildProcess(ProcessBuilderImpl.java:175)

                at org.jbpm.compiler.ProcessBuilderImpl.addProcessFromXml(ProcessBuilderImpl.java:254)

                at org.drools.compiler.PackageBuilder.addProcessFromXml(PackageBuilder.java:430)

                at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:470)

                at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)

                at com.sample.ProcessTest.readKnowledgeBase(ProcessTest.java:65)

                at com.sample.ProcessTest.main(ProcessTest.java:35)

      [5,58]: [ERR 102] Line 5:58 mismatched input 'process' expecting '(' in rule "RuleFlow-Split-com.sample.bpmn.hello-13-11-DROOLS_DEFAULT" in pattern org.drools.runtime.process.WorkflowProcessInstance

      [5,119]: [ERR 102] Line 5:119 mismatched input ')' expecting '(' in rule "RuleFlow-Split-com.sample.bpmn.hello-13-11-DROOLS_DEFAULT" in pattern org.drools.runtime.process.WorkflowProcessInstance

      [5,120]: [ERR 102] Line 5:120 mismatched input 'kcontext' expecting ')' in rule "RuleFlow-Split-com.sample.bpmn.hello-13-11-DROOLS_DEFAULT"

      [6,7]: [ERR 101] Line 6:7 no viable alternative at input 'return' in rule "RuleFlow-Split-com.sample.bpmn.hello-13-11-DROOLS_DEFAULT"

      [6,53]: [ERR 101] Line 6:53 no viable alternative at input '"risultato"' in rule "RuleFlow-Split-com.sample.bpmn.hello-13-11-DROOLS_DEFAULT" in pattern equals

      [13,58]: [ERR 102] Line 13:58 mismatched input 'process' expecting '(' in rule "RuleFlow-Split-com.sample.bpmn.hello-13-12-DROOLS_DEFAULT" in pattern org.drools.runtime.process.WorkflowProcessInstance

      [13,119]: [ERR 102] Line 13:119 mismatched input ')' expecting '(' in rule "RuleFlow-Split-com.sample.bpmn.hello-13-12-DROOLS_DEFAULT" in pattern org.drools.runtime.process.WorkflowProcessInstance

      [13,120]: [ERR 102] Line 13:120 mismatched input 'kcontext' expecting ')' in rule "RuleFlow-Split-com.sample.bpmn.hello-13-12-DROOLS_DEFAULT"

      [14,7]: [ERR 101] Line 14:7 no viable alternative at input 'return' in rule "RuleFlow-Split-com.sample.bpmn.hello-13-12-DROOLS_DEFAULT"

      [14,46]: [ERR 101] Line 14:46 no viable alternative at input '"risultato"' in rule "RuleFlow-Split-com.sample.bpmn.hello-13-12-DROOLS_DEFAULT" in pattern equals

      org.drools.compiler.ProcessLoadError: unable to parse xml : Exception class org.drools.RuntimeDroolsException : invalid package name

      java.lang.IllegalArgumentException: Could not parse knowledge.

                at org.drools.builder.impl.KnowledgeBuilderImpl.newKnowledgeBase(KnowledgeBuilderImpl.java:58)

                at com.sample.ProcessTest.readKnowledgeBase(ProcessTest.java:67)

                at com.sample.ProcessTest.main(ProcessTest.java:35)

       

       

      could anyone help me?I can't understand where is the problem!

      thank you very much