<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    registerWorkItemHandler workItemName
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/tob1as">Tobias Wittur</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/621803#621803">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hello,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I was wondering if the workItemName in - <strong>registerWorkItemHandler</strong>(<a class="jive-link-external-small" href="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true">String</a> workItemName, <a class="jive-link-external-small" href="http://docs.jboss.org/jbpm/v5.1/javadocs/org/drools/runtime/process/WorkItemHandler.html">WorkItemHandler</a> handler) in public interface <strong>WorkItemManager</strong> can receive any workItemName.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>E.g. I created a standard service task and tried to register my own handler:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>ksession.getWorkItemManager().registerWorkItemHandler("<span style="color: #ff0000;">Test</span>", new MyOwnServiceHandler());</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>and I get:</p><p><span style="color: #ff0000;">Caused by: org.drools.WorkItemHandlerNotFoundException: Could not find work item handler for <strong>Service Task</strong></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>If I write this, it works: ksession.getWorkItemManager().registerWorkItemHandler("<span style="color: #ff0000;">Service Task</span>", new MyOwnServiceHandler());</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Where exactly is the Service Node linked to Service Task? Shouldn't there be something in the XML?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml">&#160; <span class="jive-xml-tag">&lt;itemDefinition id="_2_InMessageType" structureRef="java.lang.String" /&gt;</span>
&#160; <span class="jive-xml-tag">&lt;message id="_2_InMessage" itemRef="_2_InMessageType" /&gt;</span>

&#160; <span class="jive-xml-tag">&lt;interface id="_2_ServiceInterface" name="com.sample.loyaltyManagementHelloService"&gt;</span>
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;operation id="_2_ServiceOperation" name="hello"&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;inMessageRef&gt;</span>_2_InMessage<span class="jive-xml-tag">&lt;/inMessageRef&gt;</span>
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/operation&gt;</span>
&#160; <span class="jive-xml-tag">&lt;/interface&gt;</span>

&#160;&#160;&#160; <span class="jive-xml-tag">&lt;serviceTask id="_3" name="Hello" operationRef="_2_ServiceOperation" implementation="Other" &gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;ioSpecification&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;dataInput id="_2_param" name="Parameter" /&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;dataOutput id="_2_result" name="Result" /&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;inputSet&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;dataInputRefs&gt;</span>_2_param<span class="jive-xml-tag">&lt;/dataInputRefs&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/inputSet&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;outputSet&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;dataOutputRefs&gt;</span>_2_result<span class="jive-xml-tag">&lt;/dataOutputRefs&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/outputSet&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/ioSpecification&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;dataInputAssociation&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;sourceRef&gt;</span>x<span class="jive-xml-tag">&lt;/sourceRef&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;targetRef&gt;</span>_2_param<span class="jive-xml-tag">&lt;/targetRef&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/dataInputAssociation&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;dataOutputAssociation&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;sourceRef&gt;</span>_2_result<span class="jive-xml-tag">&lt;/sourceRef&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;targetRef&gt;</span>x<span class="jive-xml-tag">&lt;/targetRef&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/dataOutputAssociation&gt;</span>
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/serviceTask&gt;</span>&#160;&#160; 
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Best regards,</p><p>Tobias</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/621803#621803">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>