Get and change a process variable inside a user task

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Member II

Get and change a process variable inside a user task

I have process variable defined at start of process

partner_Approval  type string

An execution listener is set at the start event.

${execution.setVariable('partner_Approval','Not Started')};

The process variable shows inside a user form when displayed.

I am unable to get the variable and change its value from within the user task.

using the formFieldValueChanged function

if (field.id === 'approved') {
var execution = execution.getVariable("partner_Approval");
var Approval = getFormField(scope, 'approval');
if (Approval.value.id === 'Rejected') {
execution.setVariable(partner_Approval,'Rejected');
console.log(partner_Approval);
}
}

When run, I get a "Cannot read property of 'getVariable' of undefined" error