Bug 768499

Summary: Freemarker Template generator in web designer creates invalid forms
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Babak Mozaffari <bmozaffa>
Component: jBPM 5Assignee: Kris Verlaenen <kverlaen>
Status: VERIFIED --- QA Contact: Jiri Locker <jlocker>
Severity: high Docs Contact:
Priority: unspecified    
Version: BRMS 5.3.0.GACC: lpetrovi, rsynek, rzhang
Target Milestone: ---   
Target Release: BRMS 5.3.0.GA   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Guvnor repository to show fixed version as well as files
none
Incorrect auto-generated task form
none
Fixed task form none

Description Babak Mozaffari 2011-12-16 20:18:06 UTC
Description of problem:
When task and form variables have different names, the freemarket template form generated for a user task references process variables, therefore causing a runtime parsing error.
Furthermore, when a variable is both used for input and output, its value is not provided for users to edit and they are forced to copy and paste it from a table above.


Version-Release number of selected component (if applicable):
dev6


How reproducible:
Consistent


Steps to Reproduce:
1. Create a process with a user task that has different variable names than the process variables
2. Click on the user task and use the toolbar button "Generate Task Form Templates"
3. Run the process and view the task
  
Actual results:
HTTP 500 error, see attached FreemarkerError.jpg


Expected results:
Task form that shows input variables as read-only, has a blank field for typing output variables and shows the value of in/out variables so they may be edited.


Additional info:
Attached is a guvnor repository with a fixed working form. Also see the attached "VariableTask-taskform_wrong.flt" which produces the parsing error versus the fixed "VariableTask-taskform_working.flt" that makes in/out variables editable.

Comment 1 Babak Mozaffari 2011-12-16 20:18:50 UTC
Created attachment 547950 [details]
Guvnor repository to show fixed version as well as files

Comment 2 Babak Mozaffari 2011-12-16 20:19:16 UTC
Created attachment 547951 [details]
Incorrect auto-generated task form

Comment 3 Babak Mozaffari 2011-12-16 20:19:43 UTC
Created attachment 547952 [details]
Fixed task form

Comment 4 Tihomir Surdilovic 2012-01-02 21:08:31 UTC
I need more info on how to reproduce, specifically for step

1. Create a process with a user task that has different variable names than the
process variables

What are the process variables and types defined, and what are the data inputs and outputs and associations defined on the user task?

Thanks.

Comment 5 Tihomir Surdilovic 2012-01-02 21:09:01 UTC
assigning to bmozaffa to provide more info.

Comment 6 Babak Mozaffari 2012-01-02 23:36:54 UTC
Hey Tiho, here is what I'm testing with:

1- Process variable definition: "processVar:String"
2- User Task: "taskVar" for both DataInputSet and DataOutputSet
3- User Task: "processVar<->taskVar" added under Assignments (task name would end up as an association there too so comma separating this one)

At this point, generating task form templates results in the following line, which produces a runtime error:

<label for="name">taskVar</label>
<div class="div_checkbox">${processVar}</div>

Since this is used for the task, it should be ${taskVar} and not processVar which is unavailable at this stage. The mapping should have (and has) already taken place.

Comment 7 Tihomir Surdilovic 2012-01-03 06:23:13 UTC
Resolved and will be available in 2.1 (https://issues.jboss.org/browse/JBPM-3475)

Comment 8 Ryan Zhang 2012-01-09 10:04:13 UTC
5.3 ER2 still contains designer 2.0. So this fix probably is not included in ER2.