Hello all,
I have a user task and a task listener (event: complete) implemented by a java class.
public class user implements TaskListener {
public void notify(DelegateTask delegateTask) {
//how can I get the process variable "oldCustomer (Boolean)" ??
// based on process variable value, a BPMN error is thrown
if( ... ) {
throw new BpmnError("NotFound");
}
}
}
I would like to know how can I fetch process variables inside the task listener.
My scenario is the following:
I have a user task, where an employee can fill out a form for this task. If the employee checks a checkbox “Customer not found”, a process variable “oldCustomer (Boolean)” is created. Then, before the process execution goes to the next task, I have implemented a task listener (event: complete, implemented by java class), in which I want to fetch the process variable “oldCustomer” that is created from the form submission and based on its value to throw or not a BPMN error.
My questions are the following:
- Is the process variable “oldCustomer” created once the user submits the form or when the user task has been successfully completed?
- If the process variable is created once the user submits the form, how could I fetch this variable from a task listener?
Thank you in advance.