<!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="https://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;">
    Facing an error while using service task for web service
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/snowstormuser">snowstorm tech</a> in <i>jBPM</i> - <a href="https://community.jboss.org/message/795331#795331">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hi,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I am facing an error while execuation of the example from this link.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><blockquote class="jive-quote"><p><a class="jive-link-external-small" href="https://github.com/mswiderski/jbpm-examples/blob/master/jbpm-ws-sample/" rel="nofollow" target="_blank">https://github.com/mswiderski/jbpm-examples/blob/master/jbpm-ws-sample/</a></p></blockquote><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>here i'm provding the <strong>bpmn file</strong>, <strong>java code</strong> and <strong>error</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The web service that i used is:-<strong><br/></strong></p><blockquote class="jive-quote"><p><span style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; background-color: #ffffff;"><a class="jive-link-external-small" href="http://schemas.xmlsoap.org/wsdl/" rel="nofollow" target="_blank">http://schemas.xmlsoap.org/wsdl/</a><span>" location="</span><a class="jive-link-external-small" href="http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL" rel="nofollow" target="_blank">http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL</a><span>" namespace="</span><a class="jive-link-external-small" href="http://ws.cdyne.com/WeatherWS/" rel="nofollow" target="_blank">http://ws.cdyne.com/WeatherWS/</a></span></p></blockquote><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>And i also used the class which are genrated for the webservice above specified in my project class path.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>bpmn file:-</strong></p><p><strong><br/></strong></p><blockquote class="jive-quote"><p>&lt;?xml version="1.0" encoding="UTF-8"?&gt; </p><p>&lt;definitions id="Definition"</p><p><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; targetNamespace="</span><a class="jive-link-external-small" href="http://www.example.org/MinimalExample" rel="nofollow" target="_blank">http://www.example.org/MinimalExample</a><span>"</span></p><p><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; typeLanguage="</span><a class="jive-link-external-small" href="http://www.java.com/javaTypes" rel="nofollow" target="_blank">http://www.java.com/javaTypes</a><span>"</span></p><p><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; expressionLanguage="</span><a class="jive-link-external-small" href="http://www.mvel.org/2.0" rel="nofollow" target="_blank">http://www.mvel.org/2.0</a><span>"</span></p><p><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xmlns="</span><a class="jive-link-external-small" href="http://www.omg.org/spec/BPMN/20100524/MODEL" rel="nofollow" target="_blank">http://www.omg.org/spec/BPMN/20100524/MODEL</a><span>"</span></p><p><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xmlns:xsi="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema-instance" rel="nofollow" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a><span>"</span></p><p><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xsi:schemaLocation="</span><a class="jive-link-external-small" href="http://www.omg.org/spec/BPMN/20100524/MODEL" rel="nofollow" target="_blank">http://www.omg.org/spec/BPMN/20100524/MODEL</a><span> BPMN20.xsd"</span></p><p><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xmlns:g="</span><a class="jive-link-external-small" href="http://www.jboss.org/drools/flow/gpd" rel="nofollow" target="_blank">http://www.jboss.org/drools/flow/gpd</a><span>"</span></p><p><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xmlns:bpmndi="</span><a class="jive-link-external-small" href="http://www.omg.org/spec/BPMN/20100524/DI" rel="nofollow" target="_blank">http://www.omg.org/spec/BPMN/20100524/DI</a><span>"</span></p><p><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xmlns:dc="</span><a class="jive-link-external-small" href="http://www.omg.org/spec/DD/20100524/DC" rel="nofollow" target="_blank">http://www.omg.org/spec/DD/20100524/DC</a><span>"</span></p><p><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xmlns:di="</span><a class="jive-link-external-small" href="http://www.omg.org/spec/DD/20100524/DI" rel="nofollow" target="_blank">http://www.omg.org/spec/DD/20100524/DI</a><span>"</span></p><p><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xmlns:tns="</span><a class="jive-link-external-small" href="http://www.jboss.org/drools" rel="nofollow" target="_blank">http://www.jboss.org/drools</a><span>"&gt;</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span>&#160; &lt;import importType="</span><a class="jive-link-external-small" href="http://schemas.xmlsoap.org/wsdl/" rel="nofollow" target="_blank">http://schemas.xmlsoap.org/wsdl/</a><span>" location="</span><a class="jive-link-external-small" href="http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL" rel="nofollow" target="_blank">http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL</a><span>" namespace="</span><a class="jive-link-external-small" href="http://ws.cdyne.com/WeatherWS/" rel="nofollow" target="_blank">http://ws.cdyne.com/WeatherWS/</a><span>"/&gt;</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; &lt;itemDefinition id="_sItem"/&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; &lt;itemDefinition id="_listItem" structureRef="java.util.Collection"/&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; &lt;itemDefinition id="_listItemOut" structureRef="java.util.Collection"/&gt;</p><p>&#160; &lt;itemDefinition id="_map" structureRef="java.util.Map"/&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; &lt;itemDefinition id="_2-2-4-itemItem" /&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; &lt;itemDefinition id="_5-listItem" /&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; &lt;itemDefinition id="_2_multiInstanceItemType" /&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; &lt;itemDefinition id="_2_multiInstanceItemOutType"/&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; &lt;itemDefinition id="_2-2-4_InMessageType" /&gt;</p><p>&#160; &lt;message id="_2-2-4_InMessage" itemRef="_2-2-4_InMessageType" /&gt;</p><p>&#160; &lt;interface id="_2-2-4_ServiceInterface" name="" implementationRef="WeatherSoap"&gt;</p><p>&#160;&#160;&#160; &lt;operation id="_2-2-4_ServiceOperation" implementationRef="GetCityWeatherByZIP" name=""&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;inMessageRef&gt;_2-2-4_InMessage&lt;/inMessageRef&gt;</p><p>&#160;&#160;&#160; &lt;/operation&gt;</p><p>&#160; &lt;/interface&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; &lt;process processType="Private" isExecutable="true" id="WeatherWSServiceProcess" name="WeatherWSServiceProcess" tns:packageName="defaultPackage"&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; &lt;!-- process variables --&gt;</p><p>&#160;&#160;&#160; &lt;property id="list" itemSubjectRef="_listItem"/&gt;</p><p>&#160;&#160;&#160; &lt;property id="listOut" itemSubjectRef="_listItemOut"/&gt;</p><p>&#160;&#160;&#160; &lt;property id="mode" itemSubjectRef="_sItem"/&gt;</p><p>&#160;&#160;&#160; &lt;property id="map" itemSubjectRef="_map"/&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; &lt;!-- nodes --&gt;</p><p>&#160;&#160;&#160; &lt;startEvent id="_1" name="StartProcess" &gt;</p><p>&#160;&#160;&#160; &lt;/startEvent&gt;</p><p><span>&#160;&#160;&#160;&#160; &lt;scriptTask id="_21" name="Prepare input" scriptFormat="</span><a class="jive-link-external-small" href="http://www.java.com/java" rel="nofollow" target="_blank">http://www.java.com/java</a><span>" &gt;</span></p><p>&#160;&#160;&#160;&#160;&#160; &lt;script&gt;</p><p>&#160;&#160;&#160;&#160;&#160; System.out.println("Get zip code result is " + map);</p><p>&#160;&#160;&#160;&#160;&#160; list =&#160; new java.util.ArrayList(map.values());</p><p>&#160;&#160;&#160;&#160;&#160; list.remove("Complete");</p><p>&#160;&#160;&#160;&#160;&#160; listOut =&#160; new java.util.ArrayList();</p><p>&#160;&#160;&#160;&#160;&#160; kcontext.setVariable("list", list);</p><p>&#160;&#160;&#160;&#160;&#160; kcontext.setVariable("listOut", listOut);</p><p>&#160;&#160;&#160;&#160; &lt;/script&gt;</p><p>&#160;&#160;&#160; &lt;/scriptTask&gt;</p><p>&#160;&#160;&#160; &lt;serviceTask id="_2" name="Get weather forecast" operationRef="_2-2-4_ServiceOperation" implementation="##WebService" &gt;</p><p>&#160;&#160;&#160; &lt;extensionElements&gt;</p><p><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;tns:onEntry-script scriptFormat="</span><a class="jive-link-external-small" href="http://www.java.com/java" rel="nofollow" target="_blank">http://www.java.com/java</a><span>"&gt;</span></p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;script&gt;System.out.println("WS1");&lt;/script&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/tns:onEntry-script&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;tns:onExit-script&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;script&gt;System.out.println("WS2");&lt;/script&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/tns:onExit-script&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/extensionElements&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;ioSpecification&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInput id="_2-2-4_param" name="Parameter" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInput id="DataInput_1" name="mode"/&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInput id="_2_listInput" name="list"/&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataOutput id="_2_listOutOutput" name="listOut"/&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataOutput id="_2-2-4_result" name="Result" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;inputSet&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInputRefs&gt;_2-2-4_param&lt;/dataInputRefs&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInputRefs&gt;DataInput_1&lt;/dataInputRefs&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/inputSet&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;outputSet&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataOutputRefs&gt;_2_listOutOutput&lt;/dataOutputRefs&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/outputSet&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/ioSpecification&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;targetRef&gt;_2-2-4_param&lt;/targetRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;assignment&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;from xsi:type="tFormalExpression"&gt;#{item}&lt;/from&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;to xsi:type="tFormalExpression"&gt;_2-2-4_param&lt;/to&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/assignment&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;sourceRef&gt;mode&lt;/sourceRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;targetRef&gt;DataInput_1&lt;/targetRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;dataInputAssociation id="DataInputAssociation_1"&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;sourceRef&gt;list&lt;/sourceRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;targetRef&gt;_2_listInput&lt;/targetRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;dataOutputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;sourceRef&gt;_2-2-4_result&lt;/sourceRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;targetRef&gt;itemOut&lt;/targetRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/dataOutputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;multiInstanceLoopCharacteristics&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;loopDataInputRef&gt;_2_input&lt;/loopDataInputRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;loopDataOutputRef&gt;_2_listOutOutput&lt;/loopDataOutputRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;inputDataItem id="item" itemSubjectRef="_2_multiInstanceItemType"/&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;outputDataItem id="itemOut" itemSubjectRef="_2_multiInstanceItemOutType"/&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/multiInstanceLoopCharacteristics&gt;</p><p>&#160;&#160;&#160; &lt;/serviceTask&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; &lt;scriptTask id="_3" name="Log result" &gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;script&gt;System.out.println("Service result " + listOut);&lt;/script&gt;</p><p>&#160;&#160;&#160; &lt;/scriptTask&gt;</p><p>&#160;&#160;&#160; &lt;endEvent id="_4" name="EndProcess" &gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;terminateEventDefinition/&gt;</p><p>&#160;&#160;&#160; &lt;/endEvent&gt;</p><p>&#160;&#160;&#160; &lt;userTask id="_5" name="Get zip codes" &gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;ioSpecification&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInput id="_2_CommentInput" name="Comment" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInput id="_2_SkippableInput" name="Skippable" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInput id="_2_TaskNameInput" name="TaskName" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInput id="_2_GroupIdInput" name="GroupId" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInput id="_2_PriorityInput" name="Priority" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataOutput id="_2_ResultOutput" name="Result" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;inputSet&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInputRefs&gt;_2_CommentInput&lt;/dataInputRefs&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInputRefs&gt;_2_SkippableInput&lt;/dataInputRefs&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInputRefs&gt;_2_TaskNameInput&lt;/dataInputRefs&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInputRefs&gt;_2_GroupIdInput&lt;/dataInputRefs&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInputRefs&gt;_2_PriorityInput&lt;/dataInputRefs&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/inputSet&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;outputSet&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataOutputRefs&gt;_2_ResultOutput&lt;/dataOutputRefs&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/outputSet&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/ioSpecification&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;targetRef&gt;_2_CommentInput&lt;/targetRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;assignment&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;from xsi:type="tFormalExpression"&gt;&lt;/from&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;to xsi:type="tFormalExpression"&gt;_2_CommentInput&lt;/to&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/assignment&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;targetRef&gt;_2_SkippableInput&lt;/targetRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;assignment&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;from xsi:type="tFormalExpression"&gt;false&lt;/from&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;to xsi:type="tFormalExpression"&gt;_2_SkippableInput&lt;/to&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/assignment&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;targetRef&gt;_2_TaskNameInput&lt;/targetRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;assignment&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;from xsi:type="tFormalExpression"&gt;firstTask&lt;/from&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;to xsi:type="tFormalExpression"&gt;_2_TaskNameInput&lt;/to&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/assignment&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;targetRef&gt;_2_GroupIdInput&lt;/targetRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;assignment&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;from xsi:type="tFormalExpression"&gt;&lt;/from&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;to xsi:type="tFormalExpression"&gt;_2_GroupIdInput&lt;/to&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/assignment&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;targetRef&gt;_2_PriorityInput&lt;/targetRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;assignment&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;from xsi:type="tFormalExpression"&gt;&lt;/from&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;to xsi:type="tFormalExpression"&gt;_2_PriorityInput&lt;/to&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/assignment&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;dataOutputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;sourceRef&gt;_2_ResultOutput&lt;/sourceRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;targetRef&gt;map&lt;/targetRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/dataOutputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;potentialOwner&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;resourceAssignmentExpression&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;formalExpression&gt;john&lt;/formalExpression&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/resourceAssignmentExpression&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/potentialOwner&gt;</p><p>&#160;&#160;&#160; &lt;/userTask&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; &lt;userTask id="_6" name="Show forecast" &gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;ioSpecification&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInput id="_4_outputInput" name="output" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInput id="_4_CommentInput" name="Comment" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInput id="_4_SkippableInput" name="Skippable" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInput id="_4_TaskNameInput" name="TaskName" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInput id="_4_GroupIdInput" name="GroupId" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInput id="_4_PriorityInput" name="Priority" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;inputSet&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInputRefs&gt;_4_outputInput&lt;/dataInputRefs&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInputRefs&gt;_4_CommentInput&lt;/dataInputRefs&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInputRefs&gt;_4_SkippableInput&lt;/dataInputRefs&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInputRefs&gt;_4_TaskNameInput&lt;/dataInputRefs&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInputRefs&gt;_4_GroupIdInput&lt;/dataInputRefs&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInputRefs&gt;_4_PriorityInput&lt;/dataInputRefs&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/inputSet&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;outputSet&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/outputSet&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/ioSpecification&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;sourceRef&gt;listOut&lt;/sourceRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;targetRef&gt;_4_outputInput&lt;/targetRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;targetRef&gt;_4_CommentInput&lt;/targetRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;assignment&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;from xsi:type="tFormalExpression"&gt;&lt;/from&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;to xsi:type="tFormalExpression"&gt;_4_CommentInput&lt;/to&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/assignment&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;targetRef&gt;_4_SkippableInput&lt;/targetRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;assignment&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;from xsi:type="tFormalExpression"&gt;false&lt;/from&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;to xsi:type="tFormalExpression"&gt;_4_SkippableInput&lt;/to&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/assignment&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;targetRef&gt;_4_TaskNameInput&lt;/targetRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;assignment&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;from xsi:type="tFormalExpression"&gt;secondTask&lt;/from&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;to xsi:type="tFormalExpression"&gt;_4_TaskNameInput&lt;/to&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/assignment&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;targetRef&gt;_4_GroupIdInput&lt;/targetRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;assignment&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;from xsi:type="tFormalExpression"&gt;&lt;/from&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;to xsi:type="tFormalExpression"&gt;_4_GroupIdInput&lt;/to&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/assignment&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;targetRef&gt;_4_PriorityInput&lt;/targetRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;assignment&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;from xsi:type="tFormalExpression"&gt;&lt;/from&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;to xsi:type="tFormalExpression"&gt;_4_PriorityInput&lt;/to&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/assignment&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;potentialOwner&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;resourceAssignmentExpression&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;formalExpression&gt;john&lt;/formalExpression&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/resourceAssignmentExpression&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/potentialOwner&gt;</p><p>&#160;&#160;&#160; &lt;/userTask&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; &lt;!-- connections --&gt;</p><p>&#160;&#160;&#160; &lt;sequenceFlow id="_21-_2" sourceRef="_21" targetRef="_2" /&gt;</p><p>&#160;&#160;&#160; &lt;sequenceFlow id="_2-_3" sourceRef="_2" targetRef="_3" /&gt;</p><p>&#160;&#160;&#160; &lt;sequenceFlow id="_3-_6" sourceRef="_3" targetRef="_6" /&gt;</p><p>&#160;&#160;&#160; &lt;sequenceFlow id="_1-_5" sourceRef="_1" targetRef="_5" /&gt;</p><p>&#160;&#160;&#160; &lt;sequenceFlow id="_5-_21" sourceRef="_5" targetRef="_21" /&gt;</p><p>&#160;&#160;&#160; &lt;sequenceFlow id="_6-_4" sourceRef="_6" targetRef="_4" /&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; &lt;/process&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; &lt;bpmndi:BPMNDiagram&gt;</p><p>&#160;&#160;&#160; &lt;bpmndi:BPMNPlane bpmnElement="WeatherWSServiceProcess" &gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;bpmndi:BPMNShape bpmnElement="_1" &gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dc:Bounds x="16" y="67" width="48" height="48" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/bpmndi:BPMNShape&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;bpmndi:BPMNShape bpmnElement="_2" &gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dc:Bounds x="228" y="16" width="200" height="150" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/bpmndi:BPMNShape&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;bpmndi:BPMNShape bpmnElement="_21" &gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dc:Bounds x="128" y="26" width="200" height="150" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/bpmndi:BPMNShape&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;bpmndi:BPMNShape bpmnElement="_3" &gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dc:Bounds x="460" y="67" width="92" height="48" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/bpmndi:BPMNShape&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;bpmndi:BPMNShape bpmnElement="_4" &gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dc:Bounds x="584" y="67" width="48" height="48" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/bpmndi:BPMNShape&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;bpmndi:BPMNShape bpmnElement="_5" &gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dc:Bounds x="96" y="67" width="100" height="48" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/bpmndi:BPMNShape&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;bpmndi:BPMNShape bpmnElement="_6" &gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dc:Bounds x="96" y="67" width="140" height="148" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/bpmndi:BPMNShape&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;bpmndi:BPMNEdge bpmnElement="_21-_2" &gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint x="140" y="50" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint x="144" y="117" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/bpmndi:BPMNEdge&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;bpmndi:BPMNEdge bpmnElement="_2-_3" &gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint x="42" y="49" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint x="140" y="50" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/bpmndi:BPMNEdge&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;bpmndi:BPMNEdge bpmnElement="_3-_6" &gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint x="146" y="91" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint x="328" y="91" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/bpmndi:BPMNEdge&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;bpmndi:BPMNEdge bpmnElement="_1-_5" &gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint x="328" y="91" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint x="506" y="91" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/bpmndi:BPMNEdge&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;bpmndi:BPMNEdge bpmnElement="_5-_21" &gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint x="506" y="91" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint x="608" y="91" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/bpmndi:BPMNEdge&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;bpmndi:BPMNEdge bpmnElement="_6-_4" &gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint x="40" y="91" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint x="146" y="91" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/bpmndi:BPMNEdge&gt;</p><p>&#160;&#160;&#160; &lt;/bpmndi:BPMNPlane&gt;</p><p>&#160; &lt;/bpmndi:BPMNDiagram&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;/definitions&gt;</p></blockquote><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>Java code:-</strong></p><p><strong><br/></strong></p><blockquote class="jive-quote"><p>import java.util.*;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>import javax.xml.ws.Endpoint;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>import org.drools.KnowledgeBase;</p><p>import org.drools.builder.KnowledgeBuilder;</p><p>import org.drools.builder.KnowledgeBuilderFactory;</p><p>import org.drools.builder.ResourceType;</p><p>import org.drools.definition.process.Connection;</p><p>import org.drools.definition.process.Node;</p><p>import org.drools.io.ResourceFactory;</p><p>import org.drools.runtime.StatefulKnowledgeSession;</p><p>import org.drools.runtime.process.NodeInstance;</p><p>import org.drools.runtime.process.WorkItem;</p><p>import org.drools.runtime.process.WorkItemHandler;</p><p>import org.drools.runtime.process.WorkItemManager;</p><p>import org.jbpm.bpmn2.handler.ServiceTaskHandler;</p><p>import org.jbpm.process.instance.ProcessInstance;</p><p>import org.jbpm.process.workitem.wsht.CommandBasedWSHumanTaskHandler;</p><p>import org.jbpm.task.service.TaskClientHandler;</p><p>import org.jbpm.workflow.core.node.HumanTaskNode;</p><p>import org.jbpm.workflow.instance.WorkflowProcessInstance;</p><p>import org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>public class ProcessMain {</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; public static void main(String[] args) throws Exception {</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; KnowledgeBase kbase = readKnowledgeBase();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; TestWorkItemHandler htHandler = new TestWorkItemHandler();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ksession.getWorkItemManager().registerWorkItemHandler("Service Task", new ServiceTaskHandler());</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ksession.getWorkItemManager().registerWorkItemHandler("Human Task", htHandler);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Map&lt;String, Object&gt; params = new HashMap&lt;String, Object&gt;();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; params.put("mode", "async");</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; WorkflowProcessInstance processInstance = (WorkflowProcessInstance) ksession.startProcess("WeatherWSServiceProcess", params);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; params = new HashMap&lt;String, Object&gt;();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; params.put("r1", "14025");</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; HashMap&lt;String, Object&gt; results = new HashMap&lt;String, Object&gt;();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; results.put("Result", params);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ksession.getWorkItemManager().completeWorkItem(htHandler.getWorkItem().getId(), results);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Thread.sleep(5000);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ksession.getWorkItemManager().completeWorkItem(htHandler.getWorkItem().getId(), null);</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; static class TestWorkItemHandler implements WorkItemHandler {</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; private static TestWorkItemHandler INSTANCE = new TestWorkItemHandler();</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; private WorkItem workItem;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; private WorkItem aborted;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; public static TestWorkItemHandler getInstance() {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return INSTANCE;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; this.workItem = workItem;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; public void abortWorkItem(WorkItem workItem, WorkItemManager manager) {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; this.aborted = workItem;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; public WorkItem getWorkItem() {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; WorkItem result = workItem;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; workItem = null;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return result;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; public WorkItem getAbortedWorkItem() {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; WorkItem result = aborted;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; aborted = null;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return result;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></blockquote><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>Error:-</strong></p><p><strong><br/></strong></p><blockquote class="jive-quote"><p>Get zip code result is {r1=14025}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>java.lang.ClassNotFoundException: </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></blockquote></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/795331#795331">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="https://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>