[jboss-user] [jBPM] - Re: Using TaskService directly
tlucz
do-not-reply at jboss.com
Thu Oct 25 12:35:22 EDT 2012
tlucz [https://community.jboss.org/people/tlucz] created the discussion
"Re: Using TaskService directly"
To view the discussion, visit: https://community.jboss.org/message/772417#772417
--------------------------------------------------------------
I solved it. Instead of creation
taskSession = taskService.createSession();
in my own LocalHumanTaskHandler's constructor I needed instatiate LocalTaskService:
TaskService taskService = new TaskService(emf, SystemEventListenerFactory.getSystemEventListener());
lts = new LocalTaskService(taskService);
then it is possible to register events:
private void registerTaskEventHandlers() {
TaskEventKey key = new TaskEventKey(TaskCompletedEvent.class, -1);
TaskCompletedHandler eventResponseHandler = new TaskCompletedHandler();
lts.registerForEvent(key, false, eventResponseHandler);
key = new TaskEventKey(TaskFailedEvent.class, -1);
lts.registerForEvent(key, false, eventResponseHandler);
key = new TaskEventKey(TaskSkippedEvent.class, -1);
lts.registerForEvent(key, false, eventResponseHandler);
}
Finally, my HT works correctly and can communicate with process instance.
kr,
Tadeusz
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/772417#772417]
Start a new discussion in jBPM at Community
[https://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/20121025/7c3db159/attachment.html
More information about the jboss-user
mailing list