[jboss-user] [jBPM] - Re: Unclear on how to get a Process param into my WorkItem

Demian Calcaprina do-not-reply at jboss.com
Wed Aug 10 14:12:03 EDT 2011


Demian Calcaprina [http://community.jboss.org/people/calca] created the discussion

"Re: Unclear on how to get a Process param into my WorkItem"

To view the discussion, visit: http://community.jboss.org/message/620447#620447

--------------------------------------------------------------
Yes, you define the item type:
<itemDefinition id="_myVariableItem" structureRef="com.MyVariableClass" />

Then, define the process variables:
  <property id="myVariable" itemSubjectRef="_myVariableItem"/>

And then you declare it as inputs or outputs of the nodes that will needs it for input, needs to modify it (will be output), or both:

<task ...
<dataInput id="_17_myVariableInput" name="*myVariable*" /> -> this is the name that will be used inside the work item handler.
..
<inputSet>
 ...
          <dataInputRefs>_17_myVariableInput</dataInputRefs>
...
</inputSet>
<dataInputAssociation>
        <sourceRef>*myVariable*</sourceRef> -> this is the name of the process variable
        <targetRef>_17_myVariableInput</targetRef>
      </dataInputAssociation>

And for output:

<dataOutput id="_17_myVariableOutput" name="*myVariable*" /> -> name that will be passed in the key of the .completeWorkItem result map.
...
<outputSet>
          <dataOutputRefs>_17_myVariableOutput</dataOutputRefs>
</outputSet>
...
<dataOutputAssociation>
        <sourceRef>_17_myVariableOutput</sourceRef>
        <targetRef>*myVariable*</targetRef> -> here we assign the internal variable to process variable
      </dataOutputAssociation>

I usually make it writing bpmn file, and not eclipse, but I think that should work with Parameter Mapping.

Regards,

Demian
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/620447#620447]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110810/15b1b167/attachment.html 


More information about the jboss-user mailing list