<!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;">
jBPM 5 - How to Pass parameters in a WorkItem BPMN2 file
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/scurvo">scurvo</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/583097#583097">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 all again <span> :D </span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I am trying to create a work item that receives certain parameters, and does stuff depending on them.</p><p>Through the examples i created this BPMN2 file:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><?xml version="1.0" encoding="UTF-8"?></p><p><definitions id="Definition"</p><p><span>             targetNamespace="</span><a class="jive-link-external-small" href="http://www.example.org/MinimalExample" target="_blank">http://www.example.org/MinimalExample</a><span>"</span></p><p><span>             typeLanguage="</span><a class="jive-link-external-small" href="http://www.java.com/javaTypes" target="_blank">http://www.java.com/javaTypes</a><span>"</span></p><p><span>             expressionLanguage="</span><a class="jive-link-external-small" href="http://www.mvel.org/2.0" target="_blank">http://www.mvel.org/2.0</a><span>"</span></p><p><span>             xmlns="</span><a class="jive-link-external-small" href="http://www.omg.org/spec/BPMN/20100524/MODEL" target="_blank">http://www.omg.org/spec/BPMN/20100524/MODEL</a><span>"</span></p><p><span>             xmlns:xs="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a><span>"</span></p><p><span>             xs:schemaLocation="</span><a class="jive-link-external-small" href="http://www.omg.org/spec/BPMN/20100524/MODEL" target="_blank">http://www.omg.org/spec/BPMN/20100524/MODEL</a><span> BPMN20.xsd"</span></p><p><span>             xmlns:bpmndi="</span><a class="jive-link-external-small" href="http://www.omg.org/spec/BPMN/20100524/DI" target="_blank">http://www.omg.org/spec/BPMN/20100524/DI</a><span>"</span></p><p><span>             xmlns:dc="</span><a class="jive-link-external-small" href="http://www.omg.org/spec/DD/20100524/DC" target="_blank">http://www.omg.org/spec/DD/20100524/DC</a><span>"</span></p><p><span>             xmlns:di="</span><a class="jive-link-external-small" href="http://www.omg.org/spec/DD/20100524/DI" target="_blank">http://www.omg.org/spec/DD/20100524/DI</a><span>"</span></p><p><span>             xmlns:tns="</span><a class="jive-link-external-small" href="http://www.jboss.org/drools" target="_blank">http://www.jboss.org/drools</a><span>"></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    <itemDefinition id="_sItem" structureRef="java.lang.String"/></p><p>    <itemDefinition id="_int" structureRef="java.lang.Integer"/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    <process id="TestWI" name="Test the WI" ></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>        <!-- process variables --></p><p>        <property id="data_provider_ID" itemSubjectRef="_sItem"/></p><p>        <property id="data_source_ID" itemSubjectRef="_sItem"/></p><p>        <property id="source_url" itemSubjectRef="_sItem"/></p><p>        <property id="source_set" itemSubjectRef="_sItem"/></p><p>        <property id="metadata_format" itemSubjectRef="_sItem"/></p><p>        <property id="record_count" itemSubjectRef="_int"/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>        <startEvent id="_1" name="StartProcess"/></p><p>        <sequenceFlow sourceRef="_1" targetRef="_2"/></p><p>        <task id="_2" name="Harvest" tns:taskName="Harvest" ></p><p>            <ioSpecification></p><p>                <dataInput id="dpID" name="DATA_PROVIDER_ID" /></p><p>                <dataInput id="dsID" name="DATA_SOURCE_ID" /></p><p>                <dataInput id="src_url" name="SOURCE_URL" /></p><p>                <dataInput id="src_set" name="SOURCE_SET" /></p><p>                <dataInput id="mtd_format" name="METADATA_FORMAT" /></p><p>                <dataInput id="rcrd_count" name="RECORD_COUNT" /></p><p>                <inputSet></p><p>                    <dataInputRefs>dpID</dataInputRefs></p><p>                    <dataInputRefs>dsID</dataInputRefs></p><p>                    <dataInputRefs>src_url</dataInputRefs></p><p>                    <dataInputRefs>src_set</dataInputRefs></p><p>                    <dataInputRefs>mtd_format</dataInputRefs></p><p>                    <dataInputRefs>rcrd_count</dataInputRefs></p><p>                </inputSet></p><p>                <outputSet></p><p>                </outputSet></p><p>            </ioSpecification></p><p>            <dataInputAssociation></p><p>                <sourceRef>data_provider_ID</sourceRef></p><p>                <targetRef>dpID</targetRef></p><p>            </dataInputAssociation></p><p>            <dataInputAssociation></p><p>                <sourceRef>data_source_ID</sourceRef></p><p>                <targetRef>dsID</targetRef></p><p>            </dataInputAssociation></p><p>            <dataInputAssociation></p><p>                <sourceRef>source_url</sourceRef></p><p>                <targetRef>src_url</targetRef></p><p>            </dataInputAssociation></p><p>            <dataInputAssociation></p><p>                <sourceRef>source_set</sourceRef></p><p>                <targetRef>src_set</targetRef></p><p>            </dataInputAssociation></p><p>            <dataInputAssociation></p><p>                <sourceRef>metadata_format</sourceRef></p><p>                <targetRef>mtd_format</targetRef></p><p>            </dataInputAssociation></p><p>            <dataInputAssociation></p><p>                <sourceRef>record_count</sourceRef></p><p>                <targetRef>rcrd_count</targetRef></p><p>            </dataInputAssociation></p><p>        </task></p><p>        <sequenceFlow sourceRef="_2" targetRef="_3"/></p><p>        <endEvent id="_3" name="EndProcess"></p><p>            <terminateEventDefinition/></p><p>        </endEvent></p><p>    </process></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p></definitions></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I was able with this to get the parameters i defined in the corresponding work item's handler.</p><p>Although i made it now that i want to have multiple work items like this on a single process i have a para meter problem <span> :( </span>. </p><p>Is it possible to define my parameters right on the bpmn2 file?</p><p>If not, is there a way of getting the ID of the task of a workItem (i wana get that <task id="_2"...)?</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/583097#583097">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>