Sergey Kornilov [
https://community.jboss.org/people/kornilovs] created the discussion
"Re: Register more than one WorkItemHandler"
To view the discussion, visit:
https://community.jboss.org/message/810979#810979
--------------------------------------------------------------
I add new WorkItemHandler to WorkDefinitions and create process with it
[
"name" : "CustomHandler",
"parameters" : [
"Message" : new StringDataType()
],
"displayName" : "CustomHandler",
"icon" : ""
]
https://community.jboss.org/servlet/JiveServlet/showImage/2-810979-20693/...
https://community.jboss.org/servlet/JiveServlet/downloadImage/2-810979-20...
create new class
import org.drools.process.instance.WorkItemHandler;
class CustomWorkItemHandler implements WorkItemHandler{
@Override
public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
// TODO Auto-generated method stub
System.out.println("****************************
CustomWorkItemHandler executeWorkItem"+ workItem.getProcessInstanceId());
}
@Override
public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {
// TODO Auto-generated method stub
System.out.println("****************************
CustomWorkItemHandler abortWorkItem" + workItem.getProcessInstanceId());
}
}
register WorkItemHandler
ksession.getWorkItemManager().registerWorkItemHandler("CustomHandler", new
CustomWorkItemHandler());
run process and get result
19:00:18,103 INFO [stdout] (http--0.0.0.0-8080-34) ****************************
CustomWorkItemHandler executeWorkItem170
you have some error when register your custom email handler?
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/810979#810979]
Start a new discussion in jBPM at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]