This discussion is archived
12 Replies Latest reply: Nov 24, 2009 1:18 AM by 713492 RSS

how to call concurrent programs from oaf page

712966 Newbie
Currently Being Moderated
Dear all

i need to call concurrent programs from oaf page.user will select the out put type from pick list and one more button should be there RUN if he select type and run the report.

can any one suggest me How Should i call from oaf page to concurrent program



Thanks in Advance
Sreekanth
  • 1. Re: how to call concurrent programs from oaf page
    Gauravv Expert
    Currently Being Moderated
    Hi,

    This is working code for the same:

    Controller Code:

    ForumAMImpl am3 = (ForumAMImpl)pageContext.getApplicationModule(webBean);
    int requestid = (int)am3.submitrequest();
    String url = "OA.jsp?akRegionCode=FNDCPREQDETAILSTOPREGION&akRegionApplicationId=0&REQUESTID="+requestid+"&retainAM=Y&addBreadCrumb=Y";

    pageContext.setForwardURL(url,
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true,
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
    OAWebBeanConstants.IGNORE_MESSAGES);



    AM code


    public int submitrequest()
    {

    try
    {
    OADBTransaction tx = (OADBTransaction)getOADBTransaction();
    java.sql.Connection pConncection = tx.getJdbcConnection();
    ConcurrentRequest cr = new ConcurrentRequest(pConncection);
    String applnName = "PA"; //Application that contains the concurrent program
    String cpName = "SAPE_WITHDRAW_NOMINATION"; //Concurrent program name
    String cpDesc = "To auto withdraw nominations with expired Nomination Period"; // concurrent Program description

    // Pass the Arguments using vector

    Vector cpArgs = new Vector();

    // Calling the Concurrent Program
    int requestId = cr.submitRequest(applnName, cpName, cpDesc, "",false, cpArgs);
    tx.commit();
    System.out.println("Request ID is "+requestId);
    return requestId;
    }
    catch (RequestSubmissionException e)
    {
    OAException oe = new OAException(e.getMessage());
    oe.setApplicationModule(this);
    throw oe;
    }
    }

    Thanks,
    Gaurav

    Edited by: Gauravv on Nov 9, 2009 8:16 PM
  • 2. Re: how to call concurrent programs from oaf page
    712966 Newbie
    Currently Being Moderated
    hi

    i am calling the report from oaf page i am getting error

    Cannot submit concurrent request for program Employee Report-OAF Check if the concurrent program is registered with Application Object Library. Check if you specified the correct application short name for your concurrent program.

    i write the method in am

    public int submitrequest()
    {

    try
    {
    OADBTransaction tx = (OADBTransaction)getOADBTransaction();
    java.sql.Connection pConncection = tx.getJdbcConnection();
    ConcurrentRequest cr = new ConcurrentRequest(pConncection);
    String applnName =
    "XXCRM"; //Application that contains the concurrent program
    String cpName = "Employee Report-OAF"; //Concurrent program name
    String cpDesc =
    "Employee Report-OAF"; // concurrent Program description

    // Pass the Arguments using vector


    Vector cpArgs = new Vector();
    // Calling the Concurrent Program
    int requestId =
    cr.submitRequest(applnName, cpName, cpDesc, null, false, cpArgs);
    tx.commit();
    System.out.println("Request ID is " + requestId);
    return requestId;
    } catch (RequestSubmissionException e)
    {
    OAException oe = new OAException(e.getMessage());
    oe.setApplicationModule(this);
    throw oe;
    }
    }


    in co

    /*If click on run button call to concurrent program*/
    if (pageContext.getParameter("Run") != null)
    {
    EmployeeAMImpl am3 =
    (EmployeeAMImpl)pageContext.getApplicationModule(webBean);
    int requestid = (int)am3.submitrequest();
    System.out.println("The request id is......"+requestid);
    String url = "OA.jsp";
    HashMap parameters = new HashMap();
    parameters.put("akRegionApplicationId", "0");
    parameters.put("akRegionCode", "FNDCPPROGRAMPAGE");
    String id = "" + requestid + "";
    parameters.put("requestMode", "DEFERRED");
    parameters.put("requestId", id);
    pageContext.setForwardURL(url, null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT, null,
    parameters, true,
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
    OAWebBeanConstants.IGNORE_MESSAGES);

    }
  • 3. Re: how to call concurrent programs from oaf page
    PrazzyJay Expert
    Currently Being Moderated
    The cpName should be concurrent program short name.

    --Prasanna                                                                                                                                                                                               
  • 4. Re: how to call concurrent programs from oaf page
    712966 Newbie
    Currently Being Moderated
    hi

    when i click on run button the page is calling to request details page.

    i need to call concurrent program request submisson page


    how is posible.


    Thanks & Regards
    Sreekanth
  • 5. Re: how to call concurrent programs from oaf page
    712966 Newbie
    Currently Being Moderated
    hi

    when i am calling this code in controller

    i am getting this error

    /*If click on run button call to concurrent program*/
    if (pageContext.getParameter("Run") != null)
    {
    EmployeeAMImpl am3 =
    (EmployeeAMImpl)pageContext.getApplicationModule(webBean);
    int requestid = (int)am3.submitrequest();
    System.out.println("The request id is......" + requestid);
    //String url ="OA.jsp?akRegionCode=FNDCPREQDETAILSTOPREGION&akRegionApplicationId=0&REQUESTID={" +
    //"#requestid}&retainAM=Y&addBreadCrumb=Y";
    String url = "OA.jsp";
    HashMap parameters = new HashMap();
    parameters.put("akRegionApplicationId", "0");
    parameters.put("akRegionCode", "FNDCPPROGRAMPAGE");
    String id = "" + requestid + "";
    parameters.put("requestMode", "DEFERRED");
    parameters.put("requestId", id);
    parameters.put("programRegion", "Hide");
    parameters.put("parameterRegion", "Hide");
    parameters.put("scheduleRegion", "Hide");
    parameters.put("notifyRegion", "Hide");
    parameters.put("printRegion", "Hide");

    pageContext.setForwardURL(url, null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT, null,
    parameters, true,
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
    OAWebBeanConstants.IGNORE_MESSAGES);

    }




    Error
    Calling request submission pages with the Program Page hidden requires both ProgramName and ProgramApplName Parameters to be passed.

    Regards
    Sreekanth
  • 6. Re: how to call concurrent programs from oaf page
    PrazzyJay Expert
    Currently Being Moderated
    remove all the optional parameters and just call OA.jsp?akRegionCode=FNDCPREQUESTVIEWREGION&akRegionApplicationId=0


    --Prasanna                                                                                                                                                                                                                                                                       
  • 7. Re: how to call concurrent programs from oaf page
    712966 Newbie
    Currently Being Moderated
    hi

    when i remove all optional parameters

    i am getting this ERROR

    Error
    Method findChildIndex cannot find the child with the given itemName.

    String url = "OA.jsp";
    parameters.put("akRegionApplicationId", "0");
    parameters.put("akRegionCode", "FNDCPREQUESTVIEWREGION");
    //parameters.put("requestMode", "DEFERRED");
    parameters.put("REQUESTID", requestid);
    //parameters.put("programRegion", "Hide");
    //parameters.put("parameterRegion", "Hide");
    //parameters.put("scheduleRegion", "Hide");
    //parameters.put("notifyRegion", "Hide");
    //parameters.put("printRegion", "Hide");
    pageContext.setForwardURL(url, null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT, null,
    parameters, true,
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
    OAWebBeanConstants.IGNORE_MESSAGES);


    Regards
    Sreekanth
  • 8. Re: how to call concurrent programs from oaf page
    PrazzyJay Expert
    Currently Being Moderated
    Call the following URL in setForwardURL()
    OA.jsp?akRegionCode=FNDCPREQUESTVIEWREGION&akRegionApplicationId=0

    http://prasanna-adf.blogspot.com/2008/11/call-concurrent-program-from-oa.html


    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                           
  • 9. Re: how to call concurrent programs from oaf page
    725909 Newbie
    Currently Being Moderated
    hi,

    i m having a concurrent program which has two parameters...1st is a number and other is a Varchar2. So i need to pass these parameters by adding them to a vector to call the concurrent Program..
    I m getting a "ClassCastException" while calling of the Program.

    Can anybody guide me how to add the elements to the vector where 1st is a Number and 2nd is a String ?????/

    try
    {
    OADBTransaction tx = (OADBTransaction)getDBTransaction();
    java.sql.Connection pConncection = tx.getJdbcConnection();
    ConcurrentRequest cr = new ConcurrentRequest(pConncection);
    String applnName = "XXAR"; //Application Short Name that contains the concurrent program
    String cpName = "XXAR0160"; //Concurrent program Short Name
    String cpDesc = "XXAR0160 Customer Interface Program"; // concurrent Program description
    Number seq= tx.getSequenceValue("XXAR_3837_CUST_INTF_STG_SEQ1");
    String debugMode="Y";
    Vector cpParameters = new Vector(2);
    cpParameters.addElement(seq);
    cpParameters.addElement(debugMode);
    int requestId = cr.submitRequest(applnName, cpName, cpDesc, null, false, cpParameters);
    System.out.println(requestId);
    tx.commit();
    }
    catch (RequestSubmissionException e)
    {
    OAException oe = new OAException(e.getMessage());
    oe.setApplicationModule(this);
    throw oe;
    }
  • 10. Re: how to call concurrent programs from oaf page
    713492 Newbie
    Currently Being Moderated
    Dear All,


    i am calling the concurrent program form my OAF page
    using "OA.jsp?akRegionCode=FNDCPREQUESTVIEWREGION&akRegionApplicationId=0&retainAM=Y&addBreadCrumb=Y";
    parameters.put("REQUESTID", requestid);
    pageContext.setForwardURL(url, null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT, null,
    parameters, true,
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
    OAWebBeanConstants.IGNORE_MESSAGES);


    here new requestid is generated means submit the request
    but
    here total requests are opened
    OA.jsp?page=/nals/oracle/apps/xxcrm/empmgmt/webui/EmployeePG&_ti=503573987&oapc=2&oas=hLhbXm1pyMkBc5bSmTLxxw..

    this is the path of that page,

    in this page, 2 images are there,
    Details,Output

    here in output image don't have any action

    how should i see the report results from this page

    pls guide me

    Thanks in advance
  • 11. Re: how to call concurrent programs from oaf page
    Gauravv Expert
    Currently Being Moderated
    Hi,

    From the jdeveloper this error comes.

    Try deploying the page in Application and then run it from there.

    Do let me know.

    Thanks,
    Gaurav
  • 12. Re: how to call concurrent programs from oaf page
    713492 Newbie
    Currently Being Moderated
    Dear All,

    String url="OA.jsp?akRegionCode=FNDCPREQUESTVIEWREGION&akRegionApplicationId=0&retainAM=Y&addBreadCrumb=Y";
    parameters.put("REQUESTID", requestid);
    pageContext.setForwardURL(url, null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT, null,
    parameters, true,
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
    OAWebBeanConstants.IGNORE_MESSAGES);


    instead of FNDCPREQUESTVIEWREGION use "akRegionCode=FNDCPREQUESTVIEWPAGE"

    then its working fine

Legend

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