<!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;">
    Re: Passing work item results to process variables
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/salaboy21">Mauricio Salatino</a> in <i>jBPM</i> - <a href="https://community.jboss.org/message/815842#815842">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 David,</p><p>Did you check the Web Process Designer? That's definitely more updated than the Eclipse Plugin. </p><p>As you mention copying variables from the work item scope to the process scope and vice versa is something vital. You need to understand that for doing that you need to have the correct mappings in the process file and then make sure that your work item is filling the variables that the process is expecting to do the copy. </p><p>So for example let's say that you have a Process Variable called: String Customer_Name;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>At process level you should have the variable defined. In your work item you will need to define the Customer_Name variable as an input variable if you want to display or use the content of the variable (maybe another activity change its value) and as an output variable if you want to override the process variable. These mappings will be something like this:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Customer_Name -&gt; this is the process variable</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Now inside the WorkItem</p><p>dataInputs:</p><p>in_Customer_Name -&gt; This represents the internal Work Item variable, it's not yet mapped to the process variable</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>dataOutputs:</p><p>out_Customer_Name -&gt; This represents the internal Work Item variable that will be copied back to the process, it's not yet mapped to the process variable</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Assignments:</p><p>Customer_Name ---(Mapped to)--&gt; in_Customer_Name&#160;&#160;&#160; -&gt; This will copy the value of the process variable to the work Item in_Customer_Name when the process reach the work item node</p><p>out_Customer_Name ---(Mapped to)--&gt; Customer_Name&#160;&#160; -&gt; This will tell the process to override the process variable called Customer_Name with the value of the internal work item variable called&#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;&#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;&#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; out_Customer_name.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>This mechanism is being defined by the BPMN2 language, and for that reason you need to have that in your xml file. </p><p>Notice that your WorkItemHandler will only work with in_Customer_name and out_Customer_Name, that means that your Map&lt;String, Object&gt; params will need to have those keys or at least the ones defined in the dataOutputs in order to override the Process variables when you complete the WorkItemHandler. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Hope this helps </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Cheers</p></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/815842#815842">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>