Bug 1206055 - Not possible to build a process with boundary event when Cancel Activity is set to true
Summary: Not possible to build a process with boundary event when Cancel Activity is s...
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: jBPM Core
Version: 6.0.3
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ER5
: 6.2.0
Assignee: Alessandro Lazarotti
QA Contact: Jakub Schwan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-26 08:32 UTC by Anton Giertli
Modified: 2020-03-27 20:00 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-27 20:00:08 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
[0] boundary timer - cancel activity = true (8.11 KB, application/xml)
2015-03-26 08:32 UTC, Anton Giertli
no flags Details
[1] reproducer+full stack (16.91 KB, application/zip)
2015-03-27 07:58 UTC, Anton Giertli
no flags Details

Description Anton Giertli 2015-03-26 08:32:15 UTC
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.

Comment 2 Maciej Swiderski 2015-03-26 17:29:00 UTC
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.

Comment 3 Anton Giertli 2015-03-27 07:58:06 UTC
Created attachment 1007119 [details]
[1] reproducer+full stack

Comment 4 Anton Giertli 2015-03-27 07:58:49 UTC
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.

Comment 5 Maciej Swiderski 2015-03-27 11:06:33 UTC
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.

Comment 6 Anton Giertli 2015-03-27 11:17:01 UTC
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

Comment 7 Maciej Swiderski 2015-03-27 11:20:15 UTC
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

Comment 9 Maciej Swiderski 2015-10-21 10:21:03 UTC
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

Comment 10 Jakub Schwan 2015-11-12 14:03:01 UTC
Verified in 6.2.0ER5


Note You need to log in before you can comment on or make changes to this bug.