Scenario: Excuting a custom logic in BPM human task before calling the action of BPM services.
Let us think that we want some custom logic to be executed on click of Approve/Reject button in BPM human task.
Solution:
To achieve this, we need to follow the below two steps,
Step 1: Write a managed bean and a submit method and write your custom code first and then the below code to invoke the BPM services.
Step 2: Configure this method as action method in the jspx for the Approve/Reject/Ok button.
Let us think that we want some custom logic to be executed on click of Approve/Reject button in BPM human task.
Solution:
To achieve this, we need to follow the below two steps,
Step 1: Write a managed bean and a submit method and write your custom code first and then the below code to invoke the BPM services.
|
public String submit(){
// Custom Logic goes here.............................
//Invoking BPM Services
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();
return
result;
}
|
text="#{wf:getResourceValue('OK', 'bindings.customActions')}"
disabled="#{!bindings.OK.enabled}"
action="#{pageFlowScope.managedBean.submit}"
partialSubmit="false"
visible="#{wf:isCustomActionAvailable('OK', 'bindings.customActions')}"
id="ctb1">
value="bindings.OK"/>
|
Hi Kamal,
ReplyDeleteThis is exactly what I was looking for. Quick question, which packages / libraries are you importing to make this work? I'm having trouble finding the right "Map" class.
Thanks!
Dave
Hi Dave,
DeleteVery sorry for replying very late, i hope you resolve your issue by now. This uses the basic FacesContext, please find the classes that are imported below,
import java.util.Map;
import javax.faces.context.FacesContext;
import oracle.adf.model.BindingContext;
import oracle.binding.BindingContainer;