Custom java code to access Oracle BPM 11g Button actions ( Submit , Cancel, withdraw, suspend , escalate )
Use following piece of java code in your application to perform any BPM related pre-defined button actions . Depending upon the type of button, change the button name which highlighted in red Color
import oracle.adf.model.OperationBinding;
import oracle.adf.model.binding.DCBindingContainer;
import oracle.adf.model.binding.DCIteratorBinding;
import oracle.binding.BindingContainer;
public void exitBPMWorkflow(){
String returnMessage = null;
try {
DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
OperationBinding operationBinding = (OperationBinding)bindings.getOperationBinding("SUBMIT");
Map paramsMap = operationBinding.getParamsMap();
paramsMap.put("DC_OPERATION_BINDING", "bindings.SUBMIT");
operationBinding.execute();
List errorsOnSubmit = operationBinding.getErrors();
if (errorsOnSubmit == null || errorsOnSubmit.isEmpty()) {
returnMessage = "closeTaskFlow";
FacesContext facesContext = FacesContext.getCurrentInstance();
ExtendedRenderKitService service = Service.getRenderKitService(facesContext, ExtendedRenderKitService.class);
service.addScript(facesContext, "window.opener = self;window.close();");
}
} catch (Exception e) {
}
}
Use following piece of java code in your application to perform any BPM related pre-defined button actions . Depending upon the type of button, change the button name which highlighted in red Color
import oracle.adf.model.OperationBinding;
import oracle.adf.model.binding.DCBindingContainer;
import oracle.adf.model.binding.DCIteratorBinding;
import oracle.binding.BindingContainer;
public void exitBPMWorkflow(){
String returnMessage = null;
try {
DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
OperationBinding operationBinding = (OperationBinding)bindings.getOperationBinding("SUBMIT");
Map paramsMap = operationBinding.getParamsMap();
paramsMap.put("DC_OPERATION_BINDING", "bindings.SUBMIT");
operationBinding.execute();
List errorsOnSubmit = operationBinding.getErrors();
if (errorsOnSubmit == null || errorsOnSubmit.isEmpty()) {
returnMessage = "closeTaskFlow";
FacesContext facesContext = FacesContext.getCurrentInstance();
ExtendedRenderKitService service = Service.getRenderKitService(facesContext, ExtendedRenderKitService.class);
service.addScript(facesContext, "window.opener = self;window.close();");
}
} catch (Exception e) {
}
}
operationBinding.execute();
ReplyDeleteThis line is throwing missing argument exception. Please advice.