Scenario: I have a simple BPM app that accepts in an order which is approved in parallel by our 2 erstwhile users jcooper and jausten. The users can also update the payload and normally they would have to complete 2 actions --> Save (the changes made) and Approve(the order). Our job is to combine this into 1 button click.
I created the following composite -
Essentially I drop an order into the /in directory. It's picked up by the File Adapter and passed on to the BPM process.
The Human workflow is defined as follows -
I then autogenerate the task form.
Now I want to combine the Save and Approve functionality.
Save is available via the update() operation.
Approve, naturally via the APPROVE() operation.
Now I need to create a new button called ApproveSave with the combined functionality.
1. Drag and Drop the update() and APPROVE operations onto the page.
2. Double-click on one of the buttons to create backing bean and binding code.
3. Double-click on the other button to create the binding code.
4. Drag and drop a Button onto the page, then double-click to create backing bean code.
5. Add the following code ...
6. Delete the other 2 buttons as we no longer need them.
7. Deploy and test. Login as jcooper
8. Edit the Order Status
9. Click the Save/Approve button
10. login as jausten
11. update the Order Status and click the Save/Approve button
12. Validate in em - check outgoing payload from the process.
13. Clean up by deleting the default APPROVE button
You have to be careful here - we want to delete the button but not the bindings.
You can delete it from the Source Code view to preserve the bindings.
However, if you did as I did - deleted it from the structure or design view - then you can simply add the binding again. Go to the taskDetails.jspx and click on the Bindings tab.
Re-deploy and test