Wednesday, May 4, 2011

BPM ADF Form--> streamlining Save/Approve actions

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

7 comments:

HusainD said...

Niall,
The issue with adding these custom buttons is that they are not available in the default dropdown in Webcenter task list. Hence a user can potentially just click on approve and it would not save anything.
This issue is more prominent when the approve action must return a mandatory output variable back to the process.

Thanks,
Husain

Niall Commiskey said...

Hi Husain,

point taken, let's see what we can do about this...

webuser said...

Hello,

I have also a custom button that should submit the task. But before that I need to show the user a dialog to get some data and only then submit the task.

- so when the user clicks the button, a dialog/popup is shown.

- the user enter de data and click the ok button of the dialog.

- the dialog/popup closes and the task is submitted

Can you help me on achiving this?

thank you

fwu

Niall Commiskey said...

I suggest you do the following -
create your task form and then, in the ADF project, create a new task flow to implement the extra functionality you require. This task flow is a bounded task flow using page fragements. Once you've created the new task flow then drop it on your taskDetails.jspx as a Region.

hope this helps
Niall C.

Anonymous said...

Hi Niall,

I'm trying to create human task based on human task flow. If I generate auto generate page wizard from human task it will also generate the SUBMIT button.

In my idea, I want submit the button and also input data to the database using ADF BC data control in the same time. So the data will record in the database and the flow also continue to the next flow/participant.

I'm following this url https://forums.oracle.com/forums/thread.jspa?threadID=1106693

But I'm still not understand

Do you have any suggestion or idea for this ??

Thank you ..

Tommy's Blog said...

Hi Niall,

I'm trying to create human task based on human task flow. If I generate auto generate page wizard from human task it will also generate the SUBMIT button.

In my idea, I want submit the button and also input data to the database using ADF BC data control in the same time. So the data will record in the database and the flow also continue to the next flow/participant.

I'm following this url https://forums.oracle.com/forums/thread.jspa?threadID=1106693

But I'm still not understand

Do you have any suggestion or idea for this ??

Thank you ..

Niall Commiskey said...

Hi Tommy,

here is an alternative approach based on a simple scenario of order approval. An order enters the system - it is immediately written to the DB using the DB Adapter. We only pass on the Primary Key to the BPM process. For order Approval etc. we pull the required data from the DB into the process.

Would this suffice?

Niall C.