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