Define global process variable and display it in a form

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2014 06:52 AM
Hello,
is it possible to declare a global process variable in the Activiti Designer and later on, fill that varibale through a web service task to display the value in a form in the Activiti Explorer?
Which steps would be necessary?
Thanks and best regards
Ben
is it possible to declare a global process variable in the Activiti Designer and later on, fill that varibale through a web service task to display the value in a form in the Activiti Explorer?
Which steps would be necessary?
Thanks and best regards
Ben
Labels:
- Labels:
-
Archive
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2014 04:50 AM
A way to do this is by creating a script-task at the beginning of the process. in the designer, you can actually call one ore more "execution.setVariable('theVar', 'initialValue'). Later on, you can update the variable using explorer or any other way you want.
If you're on the latest Activiti-release, the recommended way is is using the http://www.activiti.org/userguide/#dataobjects for this, which can have an initial value now…
If you're on the latest Activiti-release, the recommended way is is using the http://www.activiti.org/userguide/#dataobjects for this, which can have an initial value now…

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2014 04:58 AM
Thanks for your answer. Ok, but where can I define such a data object? We would like to define the process variables in the Activiti Designer. Is this possible?
So the procedure would be:
1.) Define all dataobjects we need
2.) During the process, fill in or update the values via web services (Java Delegate? Service Task?)
3.) Later on, define a form with a field linked to this data object (is this possible)?
In the end, the form will be displayed including the data objects with the values from the web services.
Did I understand you right?
Thanks and best regards
Ben
So the procedure would be:
1.) Define all dataobjects we need
2.) During the process, fill in or update the values via web services (Java Delegate? Service Task?)
3.) Later on, define a form with a field linked to this data object (is this possible)?
In the end, the form will be displayed including the data objects with the values from the web services.
Did I understand you right?
Thanks and best regards
Ben
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2014 05:11 AM
The data-object values can be set in XML (see user guide). When the process starts, a variable is stored with that value defined in there. Variable name is based on the data object id. So later on in your process, you can access the value using that variable name (eg. through API, using expressions in BPMN, using javadelegate, …). Not sure the data-objects are supported yet in the Designer UI.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2014 06:48 AM
Thanks for your answer,
when defining those objects in the .bpmn-file, must they be defined on a special position within the file?
Thanks and best regards
Ben
when defining those objects in the .bpmn-file, must they be defined on a special position within the file?
Thanks and best regards
Ben
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2014 05:50 AM
They must be placed under the process tag:
