This discussion is archived
5 Replies Latest reply: Feb 13, 2013 3:05 PM by Sudipto Desmukh RSS

ExecuteWithParams - putting attribute values in PageFlowScope?

user757151 Newbie
Currently Being Moderated
I've a task flow that includes an ExecuteWithParams method call activity. Things are set up so it will always return no more than 1 row.

What i need to do is put some of the attribute values in the row returned by the ExecuteWithParams in PageFlowScope params, as these values will be used later in the task flow.

is there a way to have an ExecuteWithParams activity set such params based on the returned row? or is there some other way?


I'm using 11g.

Thanks for your help.
  • 1. Re: ExecuteWithParams - putting attribute values in PageFlowScope?
    Sudipto Desmukh Expert
    Currently Being Moderated
    You can use the return-value property in a method call activity within a taskflow for this purpose
    http://docs.oracle.com/cd/E25178_01/web.1111/b31974/taskflows_activities.htm#autoId16

    Probably return the attribute values you need as a MAp.
  • 2. Re: ExecuteWithParams - putting attribute values in PageFlowScope?
    user757151 Newbie
    Currently Being Moderated
    Thanks for the response. I tried that, but only a null object results as the return value.

    To study what is going on, i defined the pageFlowScope params an object, and then debugged.

    Here's the method call activity definition:
    <method-call id="ExecuteWithParams">
          <method>#{bindings.ExecuteWithParams.execute}</method>
          <return-value id="__142">#{pageFlowScope.p_ExistingDetailsAttrVals}</return-value>
          <outcome id="__20">
            <fixed-outcome>ExecuteWithParams</fixed-outcome>
          </outcome>
        </method-call>
    Here's the task flow param definition:
    <input-parameter-definition id="__91">
          <name id="__90">p_ExistingDetailsAttrVals</name>
          <value>#{pageFlowScope.p_ExistingDetailsAttrVals}</value>
          <class>java.lang.Object</class>
        </input-parameter-definition>
    I debugged in a method in a PageFlowScope bean, but this merely returns a null object:
     Object o = AdfFacesContext.getCurrentInstance().getPageFlowScope().get("p_ExistingDetailsAttrVals}");
    I know that the ExecuteWithParams query results are for one row, so this is not due to the query params not resulting in any query results.

    So, is there something I'm doing wrong?

    Sorry if this seems like a dumb question, but I could not find any significant documentation on ExecuteWithParams - for example, does ExecuteWithParams return anything, or is it merely executing a query a la RowSet.ExecuteQuery(). If it does return, what is the data type? etc.
  • 3. Re: ExecuteWithParams - putting attribute values in PageFlowScope?
    Sudipto Desmukh Expert
    Currently Being Moderated
    You input teh same param to the method and are expecting the same value to be output.
    p_ExistingDetailsAttrVals
    Have a method in an ApplicationModule with a return parameter to whatever you expect , as suggested earlier maybe havea Map with values you expect.
    public Map myMethod(<InputIfAny>){
      Logic
      Map myMap=new HashMap();
      myMap.put(<Key>,<Value>);
      return myMap;
    }
    Then drag and drop this emthod to your taskflow and in the return-value-definition put it in the pageFlowScope.
    You will need to define a pageFlowScope value in your TF as a java.util.Map beforehand.
  • 4. Re: ExecuteWithParams - putting attribute values in PageFlowScope?
    user757151 Newbie
    Currently Being Moderated
    Thanks Sudipto, but I am not sure how it applies to ExecuteWithParams.

    What I ended up doing instead of trying to use ExecuteWithParams is adding a view criteria to the VO with the bind variables as criteria, adding a custom method to the VO's ViewObjectImpl class, and then exposing the method via the client interface. The method executes the query using the view criteria and returns the results as a map. The task flow calls this method and passes in the applicable query params.
  • 5. Re: ExecuteWithParams - putting attribute values in PageFlowScope?
    Sudipto Desmukh Expert
    Currently Being Moderated
    per your first post in this thread
    What i need to do is put some of the attribute values in the row returned by the ExecuteWithParams in PageFlowScope params, as these values will be used later in the task flow.
    You will need a custom method for this purpose , ExecuteWithParams which is ADF Out of the box won't be able to provide this.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points