Created attachment 1006701 [details] [0] boundary timer - cancel activity = true Description of problem: If you tick "Cancel Activity" on a boundary event it is not possible to build a kjar including a such process. Version-Release number of selected component (if applicable): BPMN2 Modeler - Diagram Editor 1.0.2.201402102317 org.eclipse.bpmn2.modeler.feature.feature.group Eclipse.org How reproducible: always Steps to Reproduce: 1. Attach boundary event to task 2. Set cancel activity to true 3. build a kjar Actual results: mvn clean package fails with [ERROR] Unable to build KieBaseModel:kbase ProcessLoadError: unable to parse xml : Exception class java.lang.NullPointerException : null Expected results: kjar is built successfully Additional info: When you tick Cancel Activity the jBPM code does not generate element cancelActivity. This element is generated only when the Cancel Activity is unchecked - in this case it generates cancelActivity="false". The NPE is coming from this place https://github.com/droolsjbpm/jbpm/blob/6.0.x/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/BoundaryEventHandler.java#L60 It is understandable, as there is no such element, we can't access it. If I manually alter *.bpmn definition and add attribute cancelActivity="true" then it is possible to build the kjar without any issues. Also, hundreds of warning messages are generated whether the build process is successful or not.
Anton, could you please provide complete stack trace as to me it's impossible that this code would cause NPE. Mainly because schema defines default value for that element meaning if that is not present it will return default value - see [1] Here [2] is a process definition that shows that it's completely valid to have it without declared attribute in bpmn2 xml. And here [3] is the test case verifying this process works as expected [1] https://github.com/droolsjbpm/jbpm/blob/6.0.x/jbpm-bpmn2/src/main/resources/META-INF/Semantic.xsd#L116 [2] https://github.com/droolsjbpm/jbpm/blob/6.0.x/jbpm-bpmn2/src/test/resources/BPMN2-TimerBoundaryEventInterrupting.bpmn2#L38 [3] https://github.com/droolsjbpm/jbpm/blob/6.0.x/jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/IntermediateEventTest.java#L1038 Moreover I tried to use it in latest master build and after cleaning up the boundary event definition as there were multiple event definition which jbpm does not support it worked just fine, both deploy and execution.
Created attachment 1007119 [details] [1] reproducer+full stack
Hi Maciej, I have attached full reproducer. The archive includes also full stracktrace. Execute 'mvn clean package' for reproducing the issue. The process was created using JBDS. Anton.
Anton, the problem is due to incomplete configuration of kie-maven-plugin. If you would like to build processes (bpmn2) with kie-maven-plugin then you need to add jbpm-bpmn2 dependency to that plugin like this: <plugin> <groupId>org.kie</groupId> <artifactId>kie-maven-plugin</artifactId> <version>${drools.version}</version> <extensions>true</extensions> <dependencies> <dependency> <groupId>org.jbpm</groupId> <artifactId>jbpm-bpmn2</artifactId> <version>${drools.version}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> <version>1.7.7</version> </dependency> </dependencies> </plugin> this is required to find proper parsers and schema definitions. As you can see after adding that dependency both NPE and schema errors are gone.
Hi Maciej, I confirm that your advise solved the issue (thanks!!). The reason for my configuration is that Mario and Tomas confirmed in this bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=1070191 The it is sufficient now to include jbpmn-bpmn2 dependency on a project level and not necessary on the plugin level - see comment 1 and 2. Can you please comment on this? Why it's not enough to add the jbpm-bpmn2 dependency on a project level? Thanks, Anton
Looks like only classes are then taken from the project level but not resources (such as xdd files that are stored in jars/META-INF directory. Don't know the details of kie-maven-plugin and maven plugins in general to explain this, maybe Mario could provide some additional information
this has been fixed to make all resource types visible to the class loader on kie maven plugin droolsjbpm-integration master: https://github.com/droolsjbpm/droolsjbpm-integration/commit/d5a6b52d506db7eee09e8665e9c661fab952dc80 6.3.x: https://github.com/droolsjbpm/droolsjbpm-integration/commit/6fbc1c870eb6b905521038adca556cc32e9c14cd
Verified in 6.2.0ER5