Tobias Wittur [
http://community.jboss.org/people/tob1as] created the discussion
"Could not find work item handler"
To view the discussion, visit:
http://community.jboss.org/message/620260#620260
--------------------------------------------------------------
Hi,
I am trying to send a message through an intermediate message throw event. However, I ve
got troubles registering a work item handler for this.
I had a look at the test case in the junit example package
testMessageIntermediateThrow().
I copied the Meta-Inf folder in my own project and created my own workItemHandler. I
basically just copied the intermediateEvent xml into my bpmn file.
http://community.jboss.org/servlet/JiveServlet/showImage/2-620260-16853/p...
http://community.jboss.org/servlet/JiveServlet/downloadImage/2-620260-168...
The error I get is:
Caused by: java.lang.RuntimeException: unable to execute Action
Caused by: org.drools.WorkItemHandlerNotFoundException: Could not find work item handler
for Send Task
Send Task was the old workItemHandler (in the example), the new one would be
MyServiceTaskHandler:
Under Eclipse -> Properties, Action for this intermediateThrowEvent I found this:
org.drools.process.instance.impl.WorkItemImpl workItem = new
org.drools.process.instance.impl.WorkItemImpl();
workItem.setName("Send Task");
If I change this to:
org.drools.process.instance.impl.WorkItemImpl workItem = new
org.drools.process.instance.impl.WorkItemImpl();
workItem.setName("MyServiceTaskHandler");
It changes it back immediately. So where exactly is that fetched
This is the work definition:
import org.drools.process.core.datatype.impl.type.ObjectDataType;
import org.drools.process.core.datatype.impl.type.StringDataType;
[
[
name : MyServiceTask,
parameters : [
Message : new StringDataType()
],
displayName : MyServiceTask,
icon : icons/arrowright.GIF
]
]
This the java in my processTest:
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("StartProcessWithMessage.bpmn2"),
ResourceType.BPMN2);
KnowledgeBase kbase = kbuilder.newKnowledgeBase();
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
ksession.getWorkItemManager().registerWorkItemHandler("MyServiceTask", new
MyServiceTaskHandler());
Thx for your help.
Tobi
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/620260#620260]
Start a new discussion in jBPM at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]