cancel
Showing results for 
Search instead for 
Did you mean: 

how can i get the value of the bpm-comment of each task.

wajdi_ghribi
Champ in-the-making
Champ in-the-making
Hi,
I used this instructions to store bpm_bomment in the complete script of a three tasks properties:

execution.setVariable('bpm_comment', task.getVariable('bpm_comment'));";
task.setVariable('bpm_comment', execution.getVariable('bpm_comment'));";
…..

but when i try to get the value of the bpm_comment using the task id i always get the last value of the bpm-comment!
Any help please?
5 REPLIES 5

afaust
Legendary Innovator
Legendary Innovator
Hello,

the script you are using is unnecessary and actively messes up the data structure in your workflow. The bpm_comment should typically only be maintained on the task and not moved to the execution. When you access the task properties via the WorkflowService using the task ID, you should always get the bpm:comment for the task you requested - perhaps you are accessing the properties of the workflow path, which is always the set of variables set on the execution and thus always contains the most recent value of bpm_comment set by your script.

Regards
Axel

wajdi_ghribi
Champ in-the-making
Champ in-the-making
Thanks for response,
How can i get the bpm_comment of each task in client-side javascript if i have the id of the task ?
i have found this :
workflow.getTask(taskId).getProperties()["bpm:comment"];

but object workflow is unknown in client-side javascript.

wajdi_ghribi
Champ in-the-making
Champ in-the-making
In fact i used only


task.setVariable('bpm_comment', execution.getVariable('bpm_comment'));";

and when i used:
workflow.getTask(taskId).getProperties()["bpm:comment"];

to get the bpm_comment , i always get the most recent value of it ?

khoer52
Champ in-the-making
Champ in-the-making
Hi wajdi.ghribi!

I'm trying workflow.getTask(taskId).getProperties()["bpm:comment"];
but javascript error with variable taskId. How i can declare the taskId?

mitpatoliya
Star Collaborator
Star Collaborator
You have two different type of variables in workflow i.e. Task variables and Workflow properties.Then one which you are trying to access is task variable and it's scope is limited to particular task only.