When you create new Oracle BPM Application and generate human task page with payload, BPM automatically will generate human task operations like Approve, Reject, OK, ....
Sometime developer need to execute some code before calling operation Approve or Reject so you need to override operation Approve or Reject. To do so follow these steps:
1- Bind approve button action to method in backbean
2- In the approval action back bean method write this:
be sure that the button in the page has actionListener="#{invokeActionBean.setOperation}" and has attribute
You can do same steps in any other operations like Reject, Ok, ....
Sometime developer need to execute some code before calling operation Approve or Reject so you need to override operation Approve or Reject. To do so follow these steps:
1- Bind approve button action to method in backbean
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<af:commandToolbarButton actionListener="#{invokeActionBean.setOperation}" | |
text="#{wf:getResourceValue('APPROVE', 'bindings.customActions')}" | |
disabled="#{!bindings.APPROVE.enabled}" | |
partialSubmit="false" | |
visible="#{wf:isCustomActionAvailable('APPROVE', 'bindings.customActions')}" | |
id="ctb1" | |
action="#{myBean.approveAction}"> | |
<f:attribute name="DC_OPERATION_BINDING" value="bindings.APPROVE"/> | |
</af:commandToolbarButton> |
2- In the approval action back bean method write this:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String approveAction() | |
{ | |
try | |
{ | |
// write code here before execute approval action | |
Map map = FacesContext.getCurrentInstance().getExternalContext().getRequestMap(); | |
oracle.bpel.services.workflow.worklist.adf.InvokeActionBean invokeActionBean = (oracle.bpel.services.workflow.worklist.adf.InvokeActionBean) map.get("invokeActionBean"); | |
String result = invokeActionBean.invokeOperation(); | |
// write code here after execute approval action | |
return result; | |
} | |
catch (Exception e) | |
{ | |
// TODO: Add catch code | |
e.printStackTrace(); | |
} | |
return null; | |
} |
be sure that the button in the page has actionListener="#{invokeActionBean.setOperation}" and has attribute
You can do same steps in any other operations like Reject, Ok, ....