[jboss-user] [jBPM] - How to get current task in EventListener ?

Jaber C. Mourad do-not-reply at jboss.com
Wed Jun 16 11:18:10 EDT 2010


Jaber C. Mourad [http://community.jboss.org/people/newbeewan] created the discussion

"How to get current task in EventListener ?"

To view the discussion, visit: http://community.jboss.org/message/548295#548295

--------------------------------------------------------------
Hi,

I'm doing some experiments with jbpm 4.4 snapshot.

I have a trouble in an EventListener which was working with jbpm 4.3.

My code :
    @Override
    public void notify(EventListenerExecution execution) throws Exception {
        Task task = taskService.createTaskQuery().processInstanceId(execution.getProcessInstance().getId()).uniqueResult();
        if (task == null) {
            logger.warn("No task found for ProcessInstance {}", execution.getProcessInstance().getId());
        } else {
            logger.trace("task name {} ; assignee ", task.getName(),task.getAssignee());
            execution.createVariable(LAST_TASK_ASSIGNEE, task.getAssignee());
        }
    }


Is there a better way to get the current task in a event listener or it is a bug in the trunk ?

Regards

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/548295#548295]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100616/fc90c2c8/attachment.html 


More information about the jboss-user mailing list