-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
6.1.0.Final
-
None
-
None
In case of a compilation error inside the scriptTask java code, the line and the column reported inside the org.drools.compiler.kie.builder.impl.MessageImpl are incorrect.
The MessageImpl.getPath() should also return a path with the node id that contains the compilation error.
To reproduce:
KieHelper kieHelper = new KieHelper(); kieHelper.addResource(ResourceFactory.newClassPathResource("sample-jbpm6.bpmn")); Results res = kieHelper.verify(); for (Message msg : res.getMessages()) { System.out.println("Error: " + msg); } if (res.hasMessages(Message.Level.ERROR)) { throw new IllegalStateException("Could not verify the workflow"); }
Error: class org.drools.compiler.kie.builder.impl.MessageImpl [main] ERROR org.drools.compiler.kie.builder.impl.AbstractKieModule - Unable to build KieBaseModel:defaultKieBase Process Compilation error : Process org.jbpm.Hello World(com.sample.bpmn.hello) org/jbpm/Process_org$u46$jbpm$u46$Hello_World265679914.java (9:416) : Syntax error on token "halskdjfh", delete this token Exception in thread "main" java.lang.IllegalStateException: Could not verify the workflow at Main.main(Main.java:26) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) Process finished with exit code 1
I've tested with both with "ECLIPSE" and "NATIVE" as values of the "drools.dialect.java.compiler".