Hide Forgot
Description of problem: It seems like it is not possible to make use of || (OR) operator in ON ENTRY/ ON EXIT fields for User Tasks, for instance. The project containing the business process fails to build with the following error message: 10:24:28,574 ERROR [org.drools.compiler.kie.builder.impl.AbstractKieModule] (http-/0.0.0.0:8080-1) Unable to build KieBaseModel:defaultKieBase Unable to determine the used declarations. java.lang.NullPointerException : Process org.jbpm.TestProcess(TestProject.TestProcess) java.lang.NullPointerException Process Compilation error : Process org.jbpm.TestProcess(TestProject.TestProcess) org/jbpm/Process_org$u46$jbpm$u46$TestProcess1299745802.java (16:618) : Syntax error on token ")", : expected ... If || is changed to && it builds properly. Version-Release number of selected component (if applicable): Reproduced in BPM Suite 6.1.0 and 6.2.2 How reproducible: Always Steps to Reproduce: 1. create a simple HT process as follows: Start Event -> User Task -> End Event 2. Set a process variable such as: a -> String 3. In the User Task -> On Exit field, add a script like: if ( a == null || a ) { System.out.println("print"); } 4. save the process 5. try to build the project. Actual results: The error will be thrown. Expected results: It should build properly. Additional info: If changing the code to: if ( a == null && a ) { System.out.println("print"); } it builds.
Created attachment 1149146 [details] TestProcess
hi all, I attached a simple test process to reproduce the issue easier. Are we missing something here or is it really a bug? Thanks in advance!
Amana, This looks like it might be a designer issue: When I look at the BPMN2 definition that you attached, I'm seeing the following: <drools:onExit-script scriptFormat="http://www.java.com/java"> <drools:script><![CDATA[if ( b == null ]]></drools:script> </drools:onExit-script> <drools:onExit-script scriptFormat="http://www.java.com/java"> <drools:script><![CDATA[]]></drools:script> </drools:onExit-script> <drools:onExit-script scriptFormat="http://www.java.com/java"> <drools:script><![CDATA[!b ) { System.out.println("print"); }]]></drools:script> This is, (as far as I know?), not a valid script. Could you confirm that you created this BPMN2 file via designer? And also, that you added "if ( b == null || !b ) { System.out.println("print"); }" in designer as the onExit script? Thanks!
Hi Marco, It is actually the customer process... but I have the same behaviour if trying to create a new process in business central using similar script with Boolean or String process variables... Thanks
Tiho (or Jeremy), it looks like Designer is incorrectly parsing the "||" signs when it adds a script. Would you mind taking a look?
Marco, yes I'm on it. thanks