-
1. Re: Access process instance variable from TaskEventListener
swiderski.maciej Mar 25, 2015 12:43 PM (in response to jimmy001)you should not attempt to access process variables from within task listener. You should only rely on what variables given task instance has to avoid any tight coupling and inconsistent state. So make sure you pass process variables to the task and then you will not need to look up process instance.
HTH
-
2. Re: Access process instance variable from TaskEventListener
jimmy001 Mar 26, 2015 5:19 AM (in response to swiderski.maciej)Well, ok.
I would like to add one additional value too ALL tasks, when they are created (the concrete value is different from task to task).I replaced org.jbpm.services.task.impl.model.TaskImpl by my own class in the persistence.xml
What would you suggest to accomplish this?
A second point: How is it possible to get access to the task variables in the taskevent listner?
List<Comment> comments = userTaskService.getCommentsByTaskId(event.getTask().getId());
results in :
[org.jbpm.services.task.persistence.TaskTransactionInterceptor] (default task-25) Could not commit session: org.jbpm.services.api.TaskNotFoundException: Task with id 84 was not found.
Thx.