JBoss Community

POJO getters mapped to task parameters

created by eljan in jBPM - View the full discussion

Hi

   

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?

   

I have tried it and with old eclipse plugin it works - the getter method executes and node gets returned value as an input parameter.

 

However I get following warnings in the server log:

(null: 39, 49): cvc-datatype-valid.1.2.1: 'data.getMyValue()' is not a valid value for 'NCName'.

(null: 39, 49): cvc-type.3.1.3: The value 'data.getMyValue()' of element 'sourceRef' is not valid.

 

In bpmn XML I have:

 

       <dataInputAssociation>

        <sourceRef>data.getMyValue()</sourceRef>

        <targetRef>_5_inputInput</targetRef>

      </dataInputAssociation>

  

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.

 

In bpmn XML I now have:

 

       <dataInputAssociation id="DataInputAssociation_1">

        <targetRef>_5_inputInput</targetRef>

      </dataInputAssociation>

 

When I enter the parameter mapping again in the new editor as an expression with type Java i get following XML:

 

      <dataInputAssociation id="DataInputAssociation_1">

        <sourceRef>data</sourceRef>

        <targetRef>_5_inputInput</targetRef>

        <assignment id="Assignment_1">

          <from xsi:type="tFormalExpression" id="FormalExpression_2" language="http://www.java.com/java">data.getMyValue()</from>

          <to xsi:type="tFormalExpression">_5_inputInput</to>

        </assignment>

      </dataInputAssociation>

 

But when I execute this process, I get following error:

 

...

Caused by: javax.xml.xpath.XPathExpressionException

        at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.compile(XPathImpl.java:402)

        at org.jbpm.bpmn2.xpath.XPATHAssignmentAction.execute(XPATHAssignmentAction.java:41)

        at org.jbpm.workflow.instance.node.WorkItemNodeInstance.handleAssignment(WorkItemNodeInstance.

        ... 26 more

Caused by: javax.xml.transform.TransformerException: Could not find function: data.getMyValue

        at com.sun.org.apache.xpath.internal.compiler.XPathParser.error(XPathParser.java:608)

        at com.sun.org.apache.xpath.internal.compiler.XPathParser.FunctionCall(XPathParser.java:1505)

...

(full stacktrace at http://pastie.org/4045564 )

 

  

Why did I get the warnings with the old eclipse plugin?

Is this functonality not supported by BPMN 2.0 and it just happens to work with the old eclipse editor plugin?

Or is it that the new BPMN 2.0 editor just doesn't support this yet, but will do so in the future?

Or am I just doing something wrong? :)

Reply to this message by going to Community

Start a new discussion in jBPM at Community