[jboss-user] [jBPM] - Could not find work item handler

Tobias Wittur do-not-reply at jboss.com
Wed Aug 10 02:41:04 EDT 2011

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


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/project+structure.PNG  http://community.jboss.org/servlet/JiveServlet/downloadImage/2-620260-16853/244-287/project+structure.PNG 

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();

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.


Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110810/27f49e19/attachment-0001.html 

More information about the jboss-user mailing list