Activiti 6 UI: Some form variables not displayed

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2015 07:50 AM
I have a very simple process consisting of start, script task, user task and end.
They are connected in that order.
On the start, there is a form that takes one input, buzzword.
The script task then adds one additional variable 'myVar' using execution.setVariable().
The user task has a form that displays both buzzword and myVar.
The value of buzzword is displayed correctly but the value of myVar is displayed as '(empty)'.
I have checked the database and the variable for myVar is defined correctly.
I have checked the XHR network requests and the value of myVar is correct in this request:
activiti-app/app/rest/task-forms/12550/variables
result:
[javascript]
[
{"id":"myVar","type":"string","value":"250"},
{"id":"initiator","type":"string","value":"1"},
{"id":"buzzword","type":"string","value":"BPMN"}
]
[/javascript]
However in this request:
activiti-app/app/rest/task-forms/12550
The value is 'null'.
result:
[javascript]
{
"id": 3001,
"name": "displayvar",
"processDefinitionId": "process:2:12528",
"processDefinitionKey": "process",
"taskId": "12550",
"taskName": "show data",
"taskDefinitionKey": "sid-F26CF113-14E3-42AB-81DA-C15B6B456BF6",
"fields": [{
"fieldType": "FormFieldRepresentation",
"id": "thevalueofbuzzwordis",
"name": "The Value of Buzzword is",
"type": "readonly",
"value": "BPMN",
"required": false,
"readOnly": false,
"overrideId": false,
"placeholder": null,
"optionType": null,
"hasEmptyValue": null,
"options": null,
"restUrl": null,
"restIdProperty": null,
"restLabelProperty": null,
"params": {
"field": "${buzzword}"
},
"layout": {
"row": -1,
"column": -1,
"colspan": 1
},
"sizeX": 1,
"sizeY": 1,
"row": -1,
"col": -1,
"visibilityCondition": null
},
{
"fieldType": "FormFieldRepresentation",
"id": "thevalueofmyvaris",
"name": "The value of myVar is",
"type": "readonly",
"value": null,
"required": false,
"readOnly": false,
"overrideId": false,
"placeholder": null,
"optionType": null,
"hasEmptyValue": null,
"options": null,
"restUrl": null,
"restIdProperty": null,
"restLabelProperty": null,
"params": {
"field": "${myVar}"
},
"layout": {
"row": -1,
"column": -1,
"colspan": 1
},
"sizeX": 1,
"sizeY": 1,
"row": -1,
"col": -1,
"visibilityCondition": null
},
{
"fieldType": "FormFieldRepresentation",
"id": "thisisatest",
"name": "this is a test",
"type": "text",
"value": null,
"required": false,
"readOnly": false,
"overrideId": false,
"placeholder": "${buzzword} ${myVar}",
"optionType": null,
"hasEmptyValue": null,
"options": null,
"restUrl": null,
"restIdProperty": null,
"restLabelProperty": null,
"layout": {
"row": -1,
"column": -1,
"colspan": 1
},
"sizeX": 1,
"sizeY": 1,
"row": -1,
"col": -1,
"visibilityCondition": null
}],
"outcomes": [],
"gridsterForm": false
}
[/javascript]
They are connected in that order.
On the start, there is a form that takes one input, buzzword.
The script task then adds one additional variable 'myVar' using execution.setVariable().
The user task has a form that displays both buzzword and myVar.
The value of buzzword is displayed correctly but the value of myVar is displayed as '(empty)'.
I have checked the database and the variable for myVar is defined correctly.
I have checked the XHR network requests and the value of myVar is correct in this request:
activiti-app/app/rest/task-forms/12550/variables
result:
[javascript]
[
{"id":"myVar","type":"string","value":"250"},
{"id":"initiator","type":"string","value":"1"},
{"id":"buzzword","type":"string","value":"BPMN"}
]
[/javascript]
However in this request:
activiti-app/app/rest/task-forms/12550
The value is 'null'.
result:
[javascript]
{
"id": 3001,
"name": "displayvar",
"processDefinitionId": "process:2:12528",
"processDefinitionKey": "process",
"taskId": "12550",
"taskName": "show data",
"taskDefinitionKey": "sid-F26CF113-14E3-42AB-81DA-C15B6B456BF6",
"fields": [{
"fieldType": "FormFieldRepresentation",
"id": "thevalueofbuzzwordis",
"name": "The Value of Buzzword is",
"type": "readonly",
"value": "BPMN",
"required": false,
"readOnly": false,
"overrideId": false,
"placeholder": null,
"optionType": null,
"hasEmptyValue": null,
"options": null,
"restUrl": null,
"restIdProperty": null,
"restLabelProperty": null,
"params": {
"field": "${buzzword}"
},
"layout": {
"row": -1,
"column": -1,
"colspan": 1
},
"sizeX": 1,
"sizeY": 1,
"row": -1,
"col": -1,
"visibilityCondition": null
},
{
"fieldType": "FormFieldRepresentation",
"id": "thevalueofmyvaris",
"name": "The value of myVar is",
"type": "readonly",
"value": null,
"required": false,
"readOnly": false,
"overrideId": false,
"placeholder": null,
"optionType": null,
"hasEmptyValue": null,
"options": null,
"restUrl": null,
"restIdProperty": null,
"restLabelProperty": null,
"params": {
"field": "${myVar}"
},
"layout": {
"row": -1,
"column": -1,
"colspan": 1
},
"sizeX": 1,
"sizeY": 1,
"row": -1,
"col": -1,
"visibilityCondition": null
},
{
"fieldType": "FormFieldRepresentation",
"id": "thisisatest",
"name": "this is a test",
"type": "text",
"value": null,
"required": false,
"readOnly": false,
"overrideId": false,
"placeholder": "${buzzword} ${myVar}",
"optionType": null,
"hasEmptyValue": null,
"options": null,
"restUrl": null,
"restIdProperty": null,
"restLabelProperty": null,
"layout": {
"row": -1,
"column": -1,
"colspan": 1
},
"sizeX": 1,
"sizeY": 1,
"row": -1,
"col": -1,
"visibilityCondition": null
}],
"outcomes": [],
"gridsterForm": false
}
[/javascript]
Labels:
- Labels:
-
Archive
6 REPLIES 6

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2015 06:33 AM
Looks like 'activiti-app/app/rest/task-forms/12550' only show values that are in the 'submitted_form' table.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2015 11:23 AM
The taskform rest request is only returning the definition, not the values. Those are correlated with the variables REST call.
Not sure why it doesn't work. Can you export your app and attach it here so we can have a look?
Not sure why it doesn't work. Can you export your app and attach it here so we can have a look?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2015 01:39 AM
I had exactly the same problems which I temporarily solved by setting each variable which I would like to use in the process in start form, even when I don't expect a value to be provided by initiator and I would generate/retrieve the value with some sort of script task. Is it also correct that it is not possible to define data objects for process model like it is done in Activiti Designer (Eclipse)?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2015 05:07 AM
I added the app that you requested.
Just rename to zip
Just rename to zip
varTest.txt.zip
8 KB

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2015 09:22 AM
Bump?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2015 06:46 AM
Ok, thanks for the app zip. That helps a lot!
The problem is that only the label is defined, but the variables are fetched based on id, not the label.
In the very soon to be released 1.4 version we've fixed this by adding a 'variables' property to the script task. This effectively allows you define variables that are set by these tasks, all the following forms, sequence flow, etc. will pick this up, including the Display Value field.
The problem is that only the label is defined, but the variables are fetched based on id, not the label.
In the very soon to be released 1.4 version we've fixed this by adding a 'variables' property to the script task. This effectively allows you define variables that are set by these tasks, all the following forms, sequence flow, etc. will pick this up, including the Display Value field.
