Many a times, for reporting or other purposes, we need to populate the data the wftask table(directly mapped to human task in composite) with some custom data.
This custom data can be data from the payload or any other data that is present in the composite.
Updating the wftask table with the composite data can avoid writing bpel apis and a query suffices in this case.
How to do it, is probability what you are interested in. This is done by a simple assignment in the human task.
- Expand your human task in the composite. You should see a construct like 'taskName_AssignTAskAttributes'
2. This is where you need to assign the variables. You can do it in design editor, or can copy the following lines in BPEL file.
<copy>
<from variable="inputVariable" part="payload"
query="/client:process/client:EntityKey"/>
<to variable="initiateTaskInput" part="payload"
query="/taskservice:initiateTask/task:task/task:customAttributes/task:customAttributeString1"/>
</copy>
<copy>
<from variable="inputVariable" part="payload"
query="/client:process/client:BeneficiaryLogin"/>
<to variable="initiateTaskInput" part="payload"
query="/taskservice:initiateTask/task:task/task:customAttributes/task:customAttributeString2"/>
</copy>
You might want to edit the data in from and to depending on your exact requirement.
3. Now, once you deploy and test the composite. You will see the two columns 'customAttributeString1' and 'customAttributeString2' populated in your wftask table.