When you create a BPEL Human Task, the payload type is not specified by default. You can specify a simple type from the drop down on the “Data” menu item on the BPEL Task Editor page.
By default if you have not assigned a menu item then your “payload” element is not defined in your BPEL Task’s Schema. The BPEL Human Task references the “ApproveTaskWorkflowTask” schema, which has an element called “Payload” which is imported from “ApproveTaskPayload.xsd” schema definition file.
When the payload is not defined the structure is show below in the subsequent images…. so in the “ApproveTaskWorkflowTask.xsd” we have an empty payload
…and in the “ApproveTaskPayload.xsd” we have
I created a simple schema for my Approval Process where the top-level element is “TimeSheet” (which as a list of TimeSheetDays, which have details in them). I wanted to use this schema as a payload….
I will use this in the BPEL Human Task by choosing “Other Payload” in my “Data” menu item
Select the schema you want …
Assign a name to refer to this payload type by … you should see the Task -> Payload -> <name-you-gave> as the structure.
End result … your Task has your user defined type for a payload. Now you can add data to this from a BPEL flow or an external call (convert your Human Task to an invoke-able “Composite with Service Bindings” by selecting that option when creating the task).
To use the data you do the following: