Standalone Task Use of Variables

Hi!

What exactly are the variables in a standalone task for?

I can create a vanilla usertask and assign it to someone. This someone then can add variables and complete the task.

From the tasklist doc:

Variables can be added and the Task can be completed. Once the task has been completed, the data is flushed to the database and the task is no longer visible in Tasklist.

Well, why add variables, when it is not visible in the tasklist anymore? What is a proper use case for the variables stored in the database?

I hope you can enlighten me … :wink:

The variables are saved in the history, too. You can inspect them here after the task is completed.

Hope this helps,

Ingo

Thank you Ingo.

I also figured out, that the variables are stored in the history table. This is the technical aspect.
It must be lack of imagination, but I cannot think of a useful scenario when to use this feature.

I would at least assume, that the creator of the task defines form fields for the assignee to fill out later.

I could not find a way to define form fields via REST API either.

We actually use this feature directly with the rest API. It’s used in scenarios where tasks are generated for users. But the task is not related to a process. They are just generic stand alone tasks. Variable data is generated for these tasks to store attributes and metadata around the task that is used for presentation and security.

Example: when you log in to your account there is a task that tells you to fill out your profile. Filling out the profile auto completes this task. But if you remove parts of your profile, the task is re-created, thus instructing the user to complete their profile.

Thanks for the example Stephen!

Is the profile data part of the task (as task variable) then or do you use the task only as “marker” that the user profile is incomplete?

In the use case I provided the task is just a marker of a task to be completed. No data is stored in the task

Understood. Thank you!

Note that we use the filters API and the hal+json response type to get the listing of tasks along with task variables. The task variables do hold some data about the owner of the task, and this data is used for further security permission management.