Bug 825977

Summary: Designer: Editor for Data Assigments generates invalid code
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Sona Mala <smala>
Component: BRM (Guvnor)Assignee: manstis
Status: ASSIGNED --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: BRMS 5.3.0.GACC: 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: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Editor screenshot none

Description Sona Mala 2012-05-29 08:55:54 UTC
Description of problem:
Editor for Data Assigments generates invalid code. When I use Editor for Parameter Mapping, I am not able to save process. When I use just input field and use same code which is used in http://vimeo.com/26126678 (in 7:38), I am able to save process.

Version-Release number of selected component (if applicable):
BRMS-5.3.0 ER8

How reproducible:
Every time

Steps to Reproduce:
1. Start server (default settings)
2. Open Guvnor
3. Create new process
4. Define simple process (Start -> Service Task (Email) -> End)
5. Set process variable (requestEmail, medicineName)
6. Open properties for Service Task
    - set Assigments (text mode): Body=Hi,medicineName->Subject,requestEmail->To,From=sjamboro
    - open Editor (remember setting)
7. Save
8. Open properties for Service Task
    - set Assigments to idle (text mode):Body=,Subject=,To=,From=
    - open Editor and set Editor same like it was in step #6
9. Save

  
Actual results:
I get alert "Validate your process before saving, and view server logs to see error details."
and in Assigments is: Body=HI,Subject->medicineName,To->reqEmail,From=sjamboro

Expected results:
In Assigments: Body=Hi,medicineName->Subject,requestEmail->To,From=sjamboro
And save process without alert.

Additional info:

Comment 2 Tihomir Surdilovic 2012-05-29 13:36:11 UTC
I am unable to reproduce this - can you do it by using the Assignments Editor instead of typing in the string directly into the text input? Typically all of our users would use the Assignments Editor to create assignments for their tasks.

Comment 3 Sona Mala 2012-05-29 13:47:44 UTC
Set Assigments Editor like is on screenshot.

Process Variable: requestEmail, medicineName
ServiceTask: Email

Comment 4 Sona Mala 2012-05-29 13:48:13 UTC
Created attachment 587416 [details]
Editor screenshot

Comment 5 Sona Mala 2012-05-29 13:54:00 UTC
Problem is that after I click button "OK" in Editor and look inside Assigments input, I can see invalid code: TaskName=Email,To->requestEmail,From=,Subject->medicineName


instead of:
TaskName=Email,requestEmail->To,From=,medicineName->Subject

Designer version:
2.2.0-DEV

Comment 6 Tihomir Surdilovic 2012-05-29 14:07:23 UTC
I think I understand the problem now - the editor currently is not that smart to know to switch your left-hand side and right-hand side assignments. if you want to set mappings, you would need to switch the order, for example in the editor map medicineName process var to the From data input and not From data input to the medicineName process var. The order here matters, and the editor is just doing what you tell him to do :) Smarter mapping should be added, but that's for the future I think.

Comment 7 Sona Mala 2012-05-29 14:20:06 UTC
Is there any possibility to choose if I want to write var1->var2 or var2->var1?

Comment 8 Tihomir Surdilovic 2012-05-29 14:22:25 UTC
Currently no and you have to set the "From Object" and "To Object" to reflect exactly what you want. Maybe we could add a "switch order" button there but again this could introduce more bugs for BRMS 5.3, that's why I am inclined to see this done after the product release, but please keep this bug open and write your great ideas on how we can improve this as it really should be improved :)

Comment 9 Sona Mala 2012-05-29 14:32:12 UTC
Ok ... my mistake I saw that variable was at left side and I did not notice Names of Columns. I did not find anythink in documentation about it.

Comment 10 Sona Mala 2012-05-30 08:39:32 UTC
It will be wonderfull, if I find this in documentation.