Bug 1179075

Summary: Modeler automatically change an input charactor to '_'
Product: [Retired] JBoss BPMS Platform 6 Reporter: Hisao Furuichi <hfuruich>
Component: Eclipse ToolingAssignee: Kris Verlaenen <kverlaen>
Status: VERIFIED --- QA Contact: Jozef Marko <jomarko>
Severity: high Docs Contact:
Priority: high    
Version: 6.0.3CC: bpms-support, jomarko, ksuzumur, kverlaen
Target Milestone: ---   
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: ---

Description Hisao Furuichi 2015-01-06 07:05:21 UTC
Description of problem:
Modeler automatically changes an input character to '_' 

Steps to Reproduce:
1. Create a new business process using a modeler
2. open "properties" for the business process
3. enter "-testName" in "Data Items" -> "Global List for Process" -> "Global Variable Details"/"Variable Details" -> "Name" text field

Actual results:
'-' character will be automatically replaced with '_'(under score)

Expected results:
User can input any characters as what they types. If there is a validation function, please show error messages on "Problems" window.

Additional info:
I tested with "web designer" comes with BPMS 6.0.3: 
- there is no automatic input character modification
- If I input '-' as the first letter for a global variable name and save it, validation error[1] will display on the problems window

[1]
[ERR 102] Line 2:14 mismatched input '-' in global

Comment 1 Hisao Furuichi 2015-01-06 07:11:06 UTC
If there is a regular expression for "Name" text field, please let me know. I'll guide to our customer as an workaround. (User can input letters by following the regular expression)

Thx

Comment 2 Kris Verlaenen 2015-01-06 20:31:12 UTC
Since global names and variable names are used as parameter names in generated code, they should use the same rules as Java parameter names, so start with a letter or _ and then letters, numbers or _.

Bob, would it be possible to validate this in the properties editor?

Comment 3 Robert (Bob) Brodt 2015-01-06 21:59:36 UTC
This is tricky because global and variable names are also used as the BPMN2 element IDs, which are used to identify references to these objects. If the user enters an invalid ID the link is essentially broken and the file becomes corrupt.

Validation is OK, as long the user corrects the problem before closing the editor. If the file is saved with an invalid ID, it is basically hosed. The only way I can think of to prevent this is to force IDs to always be valid.

Note that there is still an issue with creating duplicate IDs; for example I can imagine a scenario where more than one Task defines a data output parameter named "Result". This is strictly not valid BPMN because multiple data output objects will have the same ID. Since the XML loader uses these IDs to resolve object references, there's no guarantee that the correct objects will be resolved.

Comment 4 Robert (Bob) Brodt 2015-01-26 20:34:41 UTC
When attempting to insert an invalid character into the ID field, an error message is displayed in the Status Bar (at bottom of Eclipse Workbench window) and the character is ignored.

Fixed in community build for Luna 1.1.1.201501262023

Comment 5 Hisao Furuichi 2015-02-04 08:40:05 UTC
Hi, bob.

I test the fix using luna 4.4.1 with modeler(for luna 1.1.1.201501282123), and want to share my test result with you.

[OK test]
1: open modeler and access Properties -> DataItems -> LocalVariablesList
2: click "+" and access LocalVariableDetails -> Name
3: delete default characters, and enter a-
result: message is displayed in the Status Bar (at bottom of Eclipse Workbench window)

[fail test]
1: open modeler and access Properties -> DataItems -> LocalVariablesList
2: click "+" and access LocalVariableDetails -> Name
3: On the text editor(different program), type a- and copy "a-" using Ctl+c
3: delete default characters, and paste copied characters by using Ctl+v
result: "a_" is entered to the field without any error message. // invalid character '-' is replaced with '_'

I did "Ctl+c and Ctl+v test" for Properties -> Process -> Id too. In the attribute, error message is displayed in the Status bar. // This is expected behavior.

Could you check my test result please?

Comment 6 Robert (Bob) Brodt 2015-02-09 19:02:27 UTC
Yes, looks like copy/paste of a string with invalid characters was causing problems.

Fixed in Luna build 1.1.2.201502091842
download.eclipse.org/bpmn2-modeler/updates/luna/1.1.2/

Fixed in Kepler build 1.0.4.201502091849
download.eclipse.org/bpmn2-modeler/updates/kepler/1.0.4/

Comment 8 Jozef Marko 2015-02-13 09:39:33 UTC
Not included in jbds-8.0.2.GA_jbdsis-8.0.0.CR2

Comment 10 Jozef Marko 2015-04-02 11:13:37 UTC
Verified on jbds-8.1.0.CR1_jbdsis-8.0.1.CR1 - BPMN2 Modeler 1.1.2.Final