<!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;">
    POJO getters mapped to task parameters
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/eljan">eljan</a> in <i>jBPM</i> - <a href="https://community.jboss.org/message/740507#740507">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>&#160;&#160;&#160; </p><p>I'm using JBPM 5.3 and I want to have a POJO as a process variable. In my process nodes I want to specify a getter method of this POJO as a value for a task's parameter mapping. Is this possible?</p><p>&#160;&#160;&#160; </p><p>I have tried it and with old eclipse plugin it works - the getter method executes and node gets returned value as an input parameter.</p><p>&#160; </p><p>However I get following warnings in the server log:</p><p>(null: 39, 49): cvc-datatype-valid.1.2.1: 'data.getMyValue()' is not a valid value for 'NCName'.</p><p>(null: 39, 49): cvc-type.3.1.3: The value 'data.getMyValue()' of element 'sourceRef' is not valid.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>In bpmn XML I have:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInputAssociation&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;sourceRef&gt;data.getMyValue()&lt;/sourceRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;targetRef&gt;_5_inputInput&lt;/targetRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/dataInputAssociation&gt;</p><p>&#160;&#160; </p><p>When I open this process with the new BPMN 2.0 Eclipse Editor this parameter is not mapped and there doesn't seem to be a way to map it to the getter function. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>In bpmn XML I now have:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160; &lt;dataInputAssociation id="DataInputAssociation_1"&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;targetRef&gt;_5_inputInput&lt;/targetRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160; &lt;/dataInputAssociation&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>When I enter the parameter mapping again in the new editor as an expression with type Java i get following XML:</p><p>&#160; </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;data&lt;/sourceRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;targetRef&gt;_5_inputInput&lt;/targetRef&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;assignment id="Assignment_1"&gt;</p><p><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;from xsi:type="tFormalExpression" id="FormalExpression_2" language="</span><a class="jive-link-external-small" href="http://www.java.com/java" target="_blank">http://www.java.com/java</a><span>"&gt;data.getMyValue()&lt;/from&gt;</span></p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;to xsi:type="tFormalExpression"&gt;_5_inputInput&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 style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p> But when I execute this process, I get following error:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p> ...</p><p>Caused by: javax.xml.xpath.XPathExpressionException</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.compile(XPathImpl.java:402)</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jbpm.bpmn2.xpath.XPATHAssignmentAction.execute(XPATHAssignmentAction.java:41)</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jbpm.workflow.instance.node.WorkItemNodeInstance.handleAssignment(WorkItemNodeInstance.</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; ... 26 more</p><p>Caused by: javax.xml.transform.TransformerException: Could not find function: data.getMyValue</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at com.sun.org.apache.xpath.internal.compiler.XPathParser.error(XPathParser.java:608)</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at com.sun.org.apache.xpath.internal.compiler.XPathParser.FunctionCall(XPathParser.java:1505)</p><p>...</p><p><span>(full stacktrace at </span><a class="jive-link-external-small" href="http://pastie.org/4045564" target="_blank">http://pastie.org/4045564</a><span> )</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160; </p><p>Why did I get the warnings with the old eclipse plugin? </p><p>Is this functonality not supported by BPMN 2.0 and it just happens to work with the old eclipse editor plugin? </p><p>Or is it that the new BPMN 2.0 editor just doesn't support this yet, but will do so in the future?</p><p>Or am I just doing something wrong? <span> :) </span></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/740507#740507">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>