Update process variable inside User task without submitting the task


#1

Hi,

I have a process which contains an user task on which a “Timer Intermediate Catch Event” is attached to. The form of the user task includes a download link which sets the value of a process variable “downloaded” to true as soon as the link was clicked.

This process variable was created in the same form like the following:

var variableManager = camForm.variableManager;
camForm.on('form-loaded', function() {
    variableManager.createVariable({
        name: 'downloaded',
        type: 'Boolean',
        value: false
    });
});

To update the value of the process variable I am using the following code snippet:

variableManager.variableValue('downloaded', true);

Now I would expect these three results:

  1. The user clicked on the download link and completed the task Result: downloaded=true
  2. The user never clicked on the download link and never completed the task, so that the timer event triggered a timeout Result: downloaded=false
  3. The user clicked on the download link but never completed the task so that the timer event triggered a timeout Result: downloaded=true

The first and second case works like expected, but in the third case the value of the process variable is still false. I added an alert to my code to see what the value of the process variable is before and after the update and there it has the correct values.

For me it looks like, that the changes on a process variable during a user task gets only persisted to the process engine if the user completed the task.

Is there a way to get the expected value for the third case? Maybe a method to trigger a store(persist) of the process variables?


#2

Hi @Marvin_Kehr,

What is your use-case for this behavior?

At the moment, submitting intermediate results to the process Engine is not supported by the Forms SDK, but you can create a REST call to manually achieve this.

Best Regards
Martin


#3

Thanks @martin.stamm,

it worked with the manual REST call :slight_smile: