Bug 858222

Summary: Designer: Validation failed if import BPMN2 process into wrong package
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Sona Mala <smala>
Component: BRM (Guvnor)Assignee: manstis
Status: VERIFIED --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: BRMS 5.3.1CC: kverlaen, manstis
Target Milestone: ER2   
Target Release: BRMS 5.3.1 GA   
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:
Embargoed:
Attachments:
Description Flags
Simple BPMN process none

Description Sona Mala 2012-09-18 10:56:37 UTC
Created attachment 613970 [details]
Simple BPMN process

Description of problem:
If source code of BPMN2 process contains different package than is asset package then validation failed.

Version-Release number of selected component (if applicable):
BRMS 5.3.1 ER1

How reproducible:
Every time

Steps to Reproduce:
1. Create new package "pkg1"
2. Create new BPMN2 process in package "pkg1"
3. Import BPMN2 process into asset. It is attached.
4. Click on view PNG 
5. Validate
  
Actual results:
Package name is different in assets metadata and in process metadata.
Validation failed. An error message is "Process package name is not valid".

There exists workaround:
  - change package name in a text editor before you import it.
  - change package name in designer properties view

Expected results:
Automatic conversion of package name from process package to asset package.
Same package name in assets metadata and in process metadata.

Additional info:

Comment 1 manstis 2012-09-19 07:58:02 UTC
org.drools.guvnor.server.contenthandler.BPMN2ProcessHandler.onAttachmentAdded should already update the BPMN2 process's package name. Tiho, would you mind confirming this bug?

Comment 2 Tihomir Surdilovic 2012-09-25 22:46:45 UTC
When importing the BPMN2 from within Designer the package name is not updated. 

Currently users get notified two ways:

1) From visual validation (Process package name is not valid)

2) When building a package (unable to parse xml : Exception class org.drools.RuntimeDroolsException : invalid package name).

We can go two ways here: a) say these two errors shown to user are enough to prompt them to change the package name. b) Have designer "fix" the package name during the import process.

From the bug report the expected outcome is automatic conversion. Will look into that.

Thanks.

Comment 3 Tihomir Surdilovic 2012-09-26 04:16:56 UTC
Fixed in Designe master and 2.3.x prod branch. Designer will now check the package name of the importing bpmn2 and compare it to the package name the user is importing the bpmn2 into. If they don't match, Designer will update the package name to make sure they are the same. Process name is not looked at.

Comment 4 Sona Mala 2012-10-16 13:33:33 UTC
Verified for BRMS 5.3.1 ER3, designer 2.3.1-dev