AnsweredAssumed Answered

Immutable process instance variables

Question asked by slickrobert on Apr 29, 2016
Latest reply on May 3, 2016 by jbarrez
Hi, I was wondering if there were any suggestions for ways to implement immutable process instance variables using Activiti Engine and the Activiti REST API.

I am designing a process where process instance variables are set upon creation for an initial "approval request" and these variables must not be changed by downstream tasks. To my knowledge, process instance variables can be overridden at any point in time by the REST API. I have been thinking about the best ways to enforce immutability of these variables, but I wanted to see if there were other options, and perhaps guidance for option 2.

1. Create custom endpoints for process instance creation, task approval, for this particular process definition. This would allow me to restrict or validate user input for downstream tasks.
2. Create a task listener that will check if an existing process variable has been changed, and "reject" the task from completing the task – though I am not sure how to implement this option. Can the listeners autowire beans?

Any guidance is appreciated.