Feeds:
Posts
Comments

Posts Tagged ‘human task’

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 »

A very simple but frequently asked question is: how use more then 1 human task, of the same type, in one ADF application?

Go to your ViewController project and open the file hwtaskflow.xml

Copy the hwTaskFlow element, and its content, and change the values for: WorkflowName & TaskDefinitionNamespace elements (those are the name & targetNamespace from the Human Task).

  <hwTaskFlow>
      <WorkflowName>OriginHT</WorkflowName>
      <TaskDefinitionNamespace>http://xmlns.oracle.com/OriginHT</TaskDefinitionNamespace>
      <TaskFlowId>OriginHT_TaskFlow</TaskFlowId>
      <TaskFlowFileName>WEB-INF/OriginHT_TF.xml</TaskFlowFileName>
   </hwTaskFlow>
   <hwTaskFlow>
      <WorkflowName>NewHT</WorkflowName>
      <TaskDefinitionNamespace>http://xmlns.oracle.com/NewHT</TaskDefinitionNamespace>
      <TaskFlowId>OriginHT_TaskFlow</TaskFlowId>
      <TaskFlowFileName>WEB-INF/OriginHT_TF.xml</TaskFlowFileName>
   </hwTaskFlow>

Good Luck!

Read Full Post »

In our last EDI project we had to use some Human Tasks and Web Forms for User’s interactions.
For one of the tasks, I had to pass from a bpel process (in the payload) a coded HTML to the ADF form.
On the first try it didn’t work.
After a short check, I found that in order to make it happen, I had to add an attribute (in the field output text) call escape with “false” value.
So, to show HTML on the ADF, just edit the line as follows:

<af:outputText escape=”false” value=”#{bindings.HTML_HEADER.inputValue}” id=”xx1″/>

 

That worked great.

Good Luck!

Read Full Post »