Skip to content

Commit adb3077

Browse files
committed
corrected global data access with full path, e.g. data.vacationdays
1 parent 415ed15 commit adb3077

2 files changed

Lines changed: 45 additions & 45 deletions

File tree

content/reference/bpmn/bpmn-user-tasks.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,14 +318,14 @@ The resulting html is:
318318

319319
Addressing global Data Objects in the global Data Store uses the same dot-notation syntax as explained [in Script Tasks](../script-task-api#reading-data-objects), but the modifier `@global.` must be prepended to the _variable-name_ to tell that this is not a process variable.
320320
For example:
321-
- For setting: `<input type="text" name="@global.vacations.remainingDays">`
322-
- For retrieving: `<b>Hello, {%@global.vacations.remainingDays%}</b>`
321+
- For setting: `<input type="text" name="@global.data.vacations.remainingDays">`
322+
- For retrieving: `<b>Hello, {%@global.data.vacations.remainingDays%}</b>`
323323

324-
By default, this notation requests/updates Data Objects in the user section of the user who is currently working on the UserTask. The same behaviour can also be described explicitly with the `@worker.` modifier, e.g. `<b>Hello, {%@global.@worker.vacations.remainingDays%}</b>`.
324+
By default, this notation requests/updates Data Objects in the user section of the user who is currently working on the UserTask. The same behaviour can also be described explicitly with the `@worker.` modifier, e.g. `<b>Hello, {%@global.@worker.data.vacations.remainingDays%}</b>`.
325325

326-
With the modifier `@process-initiator.` it is possible to access the Data Objects of the person who started the process instance, e.g. `<b>Hello, {%@global.@process-initiator.vacations.remainingDays%}</b>`.
326+
With the modifier `@process-initiator.` it is possible to access the Data Objects of the person who started the process instance, e.g. `<b>Hello, {%@global.@process-initiator.data.vacations.remainingDays%}</b>`.
327327

328-
With the `@organization.` modifier it is possible to request Data Objects from the organization, e.g. `<b>Hello, {%@global.@organization.it.incidents.amount%}</b>`.
328+
With the `@organization.` modifier it is possible to request Data Objects from the organization, e.g. `<b>Hello, {%@global.@organization.data.it.incidents.quantity%}</b>`.
329329

330330

331331

content/reference/script-task-api.mdx

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ Global Data Objects from the global Data Store have a more advanced object struc
125125
There are two different functions for reading the global Data Objects: `.getGlobal( ... )` just returns the value as a string or integer and `.getGlobalFull( ... )` returns the full object with all properties.
126126

127127
Global Data Objects also can have nested child objects which are stored in the property `subParameters`.
128-
These child Data Objects can have the same _name_ as their parent object, so addressing a global Variable must be done with the full hierachical path separated by a dot `.`, e.g. `variable.getGlobal("vacation.vacation-days")`.
128+
These child Data Objects can have the same _name_ as their parent object, so addressing a global Variable must be done with the full hierachical path separated by a dot `.`, e.g. `variable.getGlobal("data.vacation.vacation-days")`.
129129

130130
Moreover, global Data Objects are separated into organizational and user data. The former is data belonging to the whole organization space and the latter is data belonging just to a user.
131131
By default, the functions `.getGlobal( ... )` and `.getGlobalFull( ... )` search for a Data Object inside the user section of the user that has started the process instance, i.e. the process initiator.
132-
An explicit way to mark the same request is to use the modifier `@process-initiator.` in front of the variable name, e.g. `variable.getGlobal("@process-initiator.vacations.remainingDays")`.
133-
If you want to request (or update) organizational data, you can either use the functions `.getGlobalOrg( ... )` and `.getGlobalOrgFull( ... )` or you prepend `@organization.` before the variable name, e.g. `variable.getGlobal("@organization.it.incidents.amount")`.
132+
An explicit way to mark the same request is to use the modifier `@process-initiator.` in front of the variable name, e.g. `variable.getGlobal("@process-initiator.data.vacations.remainingDays")`.
133+
If you want to request (or update) organizational data, you can either use the functions `.getGlobalOrg( ... )` and `.getGlobalOrgFull( ... )` or you prepend `@organization.` before the variable name, e.g. `variable.getGlobal("@organization.data.it.incidents.quantity")`.
134134

135135
| Read-API | Access to the process variables. |
136136
| ----------------------------------- | -------------------------------- |
@@ -163,7 +163,7 @@ Within a Script Task, it is only possible to update the `value` property and not
163163
| ----------------------------------- | -------------------------------- |
164164
| `.set( "<var-name>", <var-value> )` | Updates the value of a Variable in the local Script Task scope.|
165165
| `.setProcess( "<var-name>", <var-value> )` | Updates the value of a Variable directly inside the process instance. |
166-
| `.setGlobal( "<var-name>.<child-var-name>", <var-value> )` | Updates `value` of an existing global Data Object directly inside the user space of the _Process Initiator_ in the global Data Store (just `value`, the other attributes are not are not updateable). The modifiers `@organization.` and `@user.` in the front of the variable name can be used to explicitly update a Variable inside the user or organization space. <br/><br/> Throws an _Error_, if the Variable does not yet exist in the global Data Store.<br/> Throws an _Error_, if `<var-value>` is not a simple datatype (e.g. _object_ and _array_ are not allowed). |
166+
| `.setGlobal( "<var-name>.<child-var-name>", <var-value> )` | Updates `value` of an existing global Data Object directly inside the user space of the _Process Initiator_ in the global Data Store (just `value`, the other attributes are not are not updateable). The modifiers `@organization.` and `@process-initiator.` in the front of the variable name can be used to explicitly update a Variable inside the user or organization space. <br/><br/> Throws an _Error_, if the Variable does not yet exist in the global Data Store.<br/> Throws an _Error_, if `<var-value>` is not a simple datatype (e.g. _object_ and _array_ are not allowed). |
167167
| `.setGlobalOrg( "<var-name>.<child-var-name>", <var-value> )` | Updates `value` of an existing global Data Object directly inside the organization space in the global Data Store (just `value`, the other attributes are not are not updateable).<br/><br/> Throws an _Error_, if the Variable does not yet exist in the global Data Store.<br/> Throws an _Error_, if `<var-value>` is not a simple datatype (e.g. _object_ and _array_ are not allowed). |
168168

169169
#### Example Code: Process Instance Data
@@ -199,44 +199,44 @@ log.info('\ngetWithLogsProcess(): ' + JSON.stringify(variable.getWithLogsProcess
199199

200200
#### Example Code: global Data Objects
201201

202-
`@organization.it.incidents.amount` and `@process-initiator.vacations.remainingDays` **must** be predefined in the global Data Store (i.e. im Management System)
202+
`@organization.data.it.incidents.amount` and `@process-initiator.data.vacations.remainingDays` **must** be predefined in the global Data Store (i.e. im Management System)
203203

204204
```js
205-
log.info("\ngetGlobal('vacations.remainingDays'): " + variable.getGlobal('vacations.remainingDays'));
206-
log.info("\ngetGlobal('@process-initiator.vacations.remainingDays'): " + variable.getGlobal('@process-initiator.vacations.remainingDays')); // the same as before
207-
log.info("\ngetGlobalFull('vacations.remainingDays'): " + JSON.stringify(variable.getGlobalFull('vacations.remainingDays'), null, 2)));
208-
log.info("\ngetGlobalFull('@process-initiator.vacations.remainingDays'): " + JSON.stringify(variable.getGlobalFull('@process-initiator.vacations.remainingDays'), null, 2))); // the same as before
209-
210-
log.info('\ngetGlobalOrg('it.incidents.amount'): ' + variable.getGlobalOrg('it.incidents.amount'));
211-
log.info('\ngetGlobal('@organization.it.incidents.amount'): ' + variable.getGlobal('@organization.it.incidents.amount')); // the same as before
212-
log.info('\ngetGlobalOrgFull('it.incidents.amount'): ' + JSON.stringify(variable.getGlobalOrgFull('it.incidents.amount'), null, 2));
213-
log.info('\ngetGlobalFull('@organization.it.incidents.amount'): ' + JSON.stringify(variable.getGlobalFull('@organization.it.incidents.amount'), null, 2)); // the same as before
214-
215-
variable.setGlobal('vacations.remainingDays', 20);
216-
variable.setGlobalOrg('it.incidents.amount', 123);
217-
218-
log.info("\ngetGlobal('vacations.remainingDays'): " + variable.getGlobal('vacations.remainingDays'));
219-
log.info("\ngetGlobal('@process-initiator.vacations.remainingDays'): " + variable.getGlobal('@process-initiator.vacations.remainingDays')); // the same as before
220-
log.info("\ngetGlobalFull('vacations.remainingDays'): " + JSON.stringify(variable.getGlobalFull('vacations.remainingDays'), null, 2)));
221-
log.info("\ngetGlobalFull('@process-initiator.vacations.remainingDays'): " + JSON.stringify(variable.getGlobalFull('@process-initiator.vacations.remainingDays'), null, 2))); // the same as before
222-
223-
log.info('\ngetGlobalOrg('it.incidents.amount'): ' + variable.getGlobalOrg('it.incidents.amount'));
224-
log.info('\ngetGlobal('@organization.it.incidents.amount'): ' + variable.getGlobal('@organization.it.incidents.amount')); // the same as before
225-
log.info('\ngetGlobalOrgFull('it.incidents.amount'): ' + JSON.stringify(variable.getGlobalOrgFull('it.incidents.amount'), null, 2));
226-
log.info('\ngetGlobalFull('@organization.it.incidents.amount'): ' + JSON.stringify(variable.getGlobalFull('@organization.it.incidents.amount'), null, 2)); // the same as before
227-
228-
variable.setGlobal('@process-initiator.vacations.remainingDays', 10);
229-
variable.setGlobal('@organization.it.incidents.amount', 321);
230-
231-
log.info("\ngetGlobal('vacations.remainingDays'): " + variable.getGlobal('vacations.remainingDays'));
232-
log.info("\ngetGlobal('@process-initiator.vacations.remainingDays'): " + variable.getGlobal('@process-initiator.vacations.remainingDays')); // the same as before
233-
log.info("\ngetGlobalFull('vacations.remainingDays'): " + JSON.stringify(variable.getGlobalFull('vacations.remainingDays'), null, 2)));
234-
log.info("\ngetGlobalFull('@process-initiator.vacations.remainingDays'): " + JSON.stringify(variable.getGlobalFull('@process-initiator.vacations.remainingDays'), null, 2))); // the same as before
235-
236-
log.info('\ngetGlobalOrg('it.incidents.amount'): ' + variable.getGlobalOrg('it.incidents.amount'));
237-
log.info('\ngetGlobal('@organization.it.incidents.amount'): ' + variable.getGlobal('@organization.it.incidents.amount')); // the same as before
238-
log.info('\ngetGlobalOrgFull('it.incidents.amount'): ' + JSON.stringify(variable.getGlobalOrgFull('it.incidents.amount'), null, 2));
239-
log.info('\ngetGlobalFull('@organization.it.incidents.amount'): ' + JSON.stringify(variable.getGlobalFull('@organization.it.incidents.amount'), null, 2)); // the same as before
205+
log.info("\ngetGlobal('data.vacations.remainingDays'): " + variable.getGlobal('data.vacations.remainingDays'));
206+
log.info("\ngetGlobal('@process-initiator.data.vacations.remainingDays'): " + variable.getGlobal('@process-initiator.data.vacations.remainingDays')); // the same as before
207+
log.info("\ngetGlobalFull('data.vacations.remainingDays'): " + JSON.stringify(variable.getGlobalFull('data.vacations.remainingDays'), null, 2)));
208+
log.info("\ngetGlobalFull('@process-initiator.data.vacations.remainingDays'): " + JSON.stringify(variable.getGlobalFull('@process-initiator.data.vacations.remainingDays'), null, 2))); // the same as before
209+
210+
log.info('\ngetGlobalOrg('data.it.incidents.amount'): ' + variable.getGlobalOrg('data.it.incidents.amount'));
211+
log.info('\ngetGlobal('@organization.data.it.incidents.amount'): ' + variable.getGlobal('@organization.data.it.incidents.amount')); // the same as before
212+
log.info('\ngetGlobalOrgFull('data.it.incidents.amount'): ' + JSON.stringify(variable.getGlobalOrgFull('data.it.incidents.amount'), null, 2));
213+
log.info('\ngetGlobalFull('@organization.data.it.incidents.amount'): ' + JSON.stringify(variable.getGlobalFull('@organization.data.it.incidents.amount'), null, 2)); // the same as before
214+
215+
variable.setGlobal('data.vacations.remainingDays', 20);
216+
variable.setGlobalOrg('data.it.incidents.amount', 123);
217+
218+
log.info("\ngetGlobal('data.vacations.remainingDays'): " + variable.getGlobal('data.vacations.remainingDays'));
219+
log.info("\ngetGlobal('@process-initiator.data.vacations.remainingDays'): " + variable.getGlobal('@process-initiator.data.vacations.remainingDays')); // the same as before
220+
log.info("\ngetGlobalFull('data.vacations.remainingDays'): " + JSON.stringify(variable.getGlobalFull('data.vacations.remainingDays'), null, 2)));
221+
log.info("\ngetGlobalFull('@process-initiator.data.vacations.remainingDays'): " + JSON.stringify(variable.getGlobalFull('@process-initiator.data.vacations.remainingDays'), null, 2))); // the same as before
222+
223+
log.info('\ngetGlobalOrg('data.it.incidents.amount'): ' + variable.getGlobalOrg('data.it.incidents.amount'));
224+
log.info('\ngetGlobal('@organization.data.it.incidents.amount'): ' + variable.getGlobal('@organization.data.it.incidents.amount')); // the same as before
225+
log.info('\ngetGlobalOrgFull('data.it.incidents.amount'): ' + JSON.stringify(variable.getGlobalOrgFull('data.it.incidents.amount'), null, 2));
226+
log.info('\ngetGlobalFull('@organization.data.it.incidents.amount'): ' + JSON.stringify(variable.getGlobalFull('@organization.data.it.incidents.amount'), null, 2)); // the same as before
227+
228+
variable.setGlobal('@process-initiator.data.vacations.remainingDays', 10);
229+
variable.setGlobal('@organization.data.it.incidents.amount', 321);
230+
231+
log.info("\ngetGlobal('data.vacations.remainingDays'): " + variable.getGlobal('data.vacations.remainingDays'));
232+
log.info("\ngetGlobal('@process-initiator.data.vacations.remainingDays'): " + variable.getGlobal('@process-initiator.data.vacations.remainingDays')); // the same as before
233+
log.info("\ngetGlobalFull('data.vacations.remainingDays'): " + JSON.stringify(variable.getGlobalFull('data.vacations.remainingDays'), null, 2)));
234+
log.info("\ngetGlobalFull('@process-initiator.data.vacations.remainingDays'): " + JSON.stringify(variable.getGlobalFull('@process-initiator.data.vacations.remainingDays'), null, 2))); // the same as before
235+
236+
log.info('\ngetGlobalOrg('data.it.incidents.amount'): ' + variable.getGlobalOrg('data.it.incidents.amount'));
237+
log.info('\ngetGlobal('@organization.data.it.incidents.amount'): ' + variable.getGlobal('@organization.data.it.incidents.amount')); // the same as before
238+
log.info('\ngetGlobalOrgFull('data.it.incidents.amount'): ' + JSON.stringify(variable.getGlobalOrgFull('data.it.incidents.amount'), null, 2));
239+
log.info('\ngetGlobalFull('@organization.data.it.incidents.amount'): ' + JSON.stringify(variable.getGlobalFull('@organization.data.it.incidents.amount'), null, 2)); // the same as before
240240
```
241241

242242

0 commit comments

Comments
 (0)