Feeds:
Posts
Comments

Posts Tagged ‘java’

In this post I will explain, how in a simple way you can use managed bean to perform a binding operation.
In case of using ADF for managing Human Task flows (BPM process), you sometimes want to perform post/pre actions to the native operation.
For example: you want the user to press the approve action, and in the background you want to call a Web service for some validations.
Here is how you do it:

  1. Create a bean method by double click the action button, or manually create a class with the required method:beanto copy:
     
    public String approveAction() {
    BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
    OperationBinding validateNameOP = bindings.getOperationBinding("validateName");
    Object resultCommit = validateNameOP.execute();
    if (!validateNameOP.getErrors().isEmpty()) {
    return null;
    }
    
    AttributeBinding status =(AttributeBinding)bindings.get("status");
    if (status.getInputValue().toString().equalsIgnoreCase("Y")){
    OperationBinding operationBinding = bindings.getOperationBinding("APPROVE");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    System.out.println("inside error");
    return null;
    }
    }else{
    return null;
    }
    return "refreshTaskFlow";
    
  2. Declare the bean in the action listener property of the command button:approve-button

That’s it.

Just be sure, that both APPROVE & validateName operations are declared in the binding. Or else you will get nullPointerException.

Good Luck

Read Full Post »

The following is a simple example of using Java Embedding Activity in Bpel 11g.
In this example, I used a simple asynch’ process, and assign the input parameter into the output parameter.
To implement this example you have to:

(more…)

Read Full Post »

When the Java Embedding activity is being used, you sometimes want to print a message that will be displayed in EM.

To do so, use the following expression (inside the Java Embedding Activity):

addAuditTrailEntry(“TEST 123” );

The printed message will be shown in the process flow.

 

 

 

Read Full Post »