Reputation: 127
We need to update Task ID in jBPM User Task Entry Script into a process variable. Any idea how is it possible in jBPM 6.2.0
Upvotes: 0
Views: 1298
Reputation: 678
Unfortunately it won't be possible in the EntryScript, as the task would not have been created at that point, and hence the Task ID would not have been generated yet. However, depending on exactly why and where you would like to retrieve the task from, you could consider the following approach which does not require a process variable to store the task ID at all:
A second approach would be to register a TaskLifeCycleEventListener and override afterTaskAdded, but then you do not have easy access to the ProcessInstance we could pose a challenge.
A third approach would be to implement your own HumanTask WorkItemHandler, but that seems a bit hard handed for the requirement at hand.
Let me know if the first approach does not work and we can explore one of the other two approaches.
Upvotes: 2