Bug 1002877

Summary: Designer validate doesn't detect multiple incoming connections to a Task
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Toshiya Kobayashi <tkobayas>
Component: jBPM 5Assignee: Kris Verlaenen <kverlaen>
Status: VERIFIED --- QA Contact: Marek Baluch <mbaluch>
Severity: medium Docs Contact:
Priority: unspecified    
Version: BRMS 5.3.1CC: nwallace
Target Milestone: GA   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1022758    
Attachments:
Description Flags
repository_export_multiple_connections.zip
none
validation_brms531.png
none
validation_bpms600er2.png
none
BZ1002877_validate.diff
none
validation_fix.png none

Description Toshiya Kobayashi 2013-08-30 06:59:59 UTC
Description of problem:

When a Task has multiple incoming connections, "Validate Process" button doesn't detect the error. But it fails at building a package.


Steps to Reproduce:
1. Import attached repository_export_multiple_connections.xml
2. open process "xxxx"
3. Press "Validate Process"

Actual results:

no warning for the Task

Expected results:

raise a warning for the Task

Comment 1 Toshiya Kobayashi 2013-08-30 07:04:17 UTC
Created attachment 792045 [details]
repository_export_multiple_connections.zip

Comment 2 Toshiya Kobayashi 2013-08-30 07:05:13 UTC
Created attachment 792048 [details]
validation_brms531.png

Comment 3 Toshiya Kobayashi 2013-08-30 07:15:14 UTC
BPMS 6.0.0 ER2 validation detects the error (message is "Could not parse BPMN2 to RuleFlowProcess.")

So I'm not cloning this BZ to BPMS 6. See validation_bpms600er2.png.

Comment 4 Toshiya Kobayashi 2013-08-30 07:17:08 UTC
Created attachment 792054 [details]
validation_bpms600er2.png

Comment 5 Toshiya Kobayashi 2013-09-05 01:11:14 UTC
Backporting BPMN2SyntaxChecker.checkSyntax() part from this commit seems to fit.

https://github.com/droolsjbpm/jbpm-designer/commit/3b0e035f142bb557f47148a3236de1d67e72d08f

Comment 6 Toshiya Kobayashi 2013-09-05 02:33:36 UTC
Created attachment 793973 [details]
BZ1002877_validate.diff

Attaching a fix proposal.

Comment 7 Toshiya Kobayashi 2013-09-05 02:40:33 UTC
Created attachment 793974 [details]
validation_fix.png

Comment 8 Toshiya Kobayashi 2013-09-05 02:41:53 UTC
BZ1002877_validate.diff was basically taken from the commit 3b0e035f142bb557f47148a3236de1d67e72d08f . But I added e.getMessage() for UI message.

addError(defaultResourceId, "Could not parse BPMN2 to RuleFlowProcess. " + e.getMessage());

In this case, x-mark is put on the Start Node but the message is about a Task Node ("This type of node cannot have more than one incoming connection!"). See validation_fix.png. So it might be a bit confusing to users but I think it's better than nothing. WDYT?

Comment 11 Tihomir Surdilovic 2013-11-20 17:00:35 UTC
RuleFlowProcessValidator errors do not give back specific node ids which we can then trace back to the node ids on the designer canvas. By default Designer attaches all issues for which there is no specific id to the first node it encounters on the canvas. This is different now in 6.x but that is the way it was for 5.3.x

What we can do is fix this specific issue by adding checks to task nodes only in which case we could attach the errors to the specific task nodes, or introduce RuleFlowProcessValidator in which case all errors it may produce will be placed on the first node. 

Let me know which one would be more suitable for the fix.

Thanks.

Comment 12 Tihomir Surdilovic 2013-11-20 17:56:26 UTC
Added commit 3254f31d7fa69906d922238c0ac9a946c0dc1b07
to the guvnor-integration branch which is the community latest of 5.3.x branch.

@Toshiya and Allesandro - please let me know what branch I should move this to for the build.

Thanks.

Comment 13 Toshiya Kobayashi 2013-11-21 05:36:36 UTC
(In reply to Tihomir Surdilovic from comment #11)
> introduce RuleFlowProcessValidator in which case all errors it may produce will be placed on the first node. 

This is preferred because the customer's need is "detect errors as far as possible".

Thanks,

Comment 15 Marek Baluch 2014-02-17 10:21:27 UTC
Verified on BRMS_5.3.1_4.

The validator now correctly displays a warning message and the log contains:

11:19:17,770 WARN  [BPMN2SyntaxChecker] Could not parse to RuleFlowProcess.
java.lang.IllegalArgumentException: This type of node cannot have more than one incoming connection!