Thanks for your reply. I will try this case.
The use case for me is like - I have created a multi instance user task at one point of time in the BPMN flow. (The multi instance task is controlled by "noOfInstances" variable in BPMN). The requirement is to add new/delete existing assignees of this multi user task. Deletion of an assignee is much easy, as we just complete the task for that user. But add a new assignee and changing the "noOfInstance" variable was not possible (this is my issue).
The issues faced for getting the active context
1) As per my understanding, active context can be obtained if a call back trigger to java happen from BPMN flow (means the task listener / execution listener). This is not possible for me, as i wont be sending any trigger to BPMN flow in my use case explained above
2) Get the active context from java with out any BPMN trigger ? Not sure this is possible or not, Also we are using the spring boot activiti startup dependency, so the engine/configurations are controlled by Spring