Calling ON DEMAND process for outside APEX

Hi All,
I would like to call an ON DEMAND process from outside APEX (using HttpClient java class). I think i have to use wwv_flow.accept but i'm bit lost on how to specify that i'm calling a process on demand.
Has someone already tried this ? samples or advices would be more then welcome ... The goal behind the scene , would be to have an Apex page acting like a servlet (HTTPClient send a xml request and receive an XML response from the apex page).
Thks.
Thierry

Thierry,
You need to set up the HTTP request as you would if invoking your application+process from a URL, e.g.,
..f?p=100:0:9876543210123456789:APPLICATION_PROCESS=<name of process>
..in which request header the authentication cookie is provided, and in which request the correct session ID is provided. You could alternatively do a POST to wwv_flow.show, bypassing the f procedure, but I don't know if that will save you any steps.
Scott

Similar Messages

  • Possible to download file using ajax on demand process?

    In the past I've used procedures with the wpg_docload.download_file function to download files by granting public to the procedure and executing the download from a report link (such as http://localhost:8080/apex/schema_name.download_blob?file_in=xxx)
    I'd like to move to the download to a link that's called from an ajax called on demand process. Is this possible? I have got the report link calling a javascript function passing the rowid in and running the same download_blob procedure via the on demand process but, whilst the code runs OK it does not return the prompt box for the user to open/save the file. I guess this might be because it's not returning it to the javascript in the proper way but I'm v flaky wrt to ajax.
    var ajaxRequest = new htmldb_Get( null , &APP_ID. , 'APPLICATION_PROCESS=download_blob' , 0);
    var ajaxResult = ajaxRequest.get();
    Thanks
    Simon

    To be honest, it's not a big deal, I wanted to do it this way as we have data stored as BFILES and some of the downloads are so big they take a while to load into a temp_blob and thus I wanted to call it from java script so I could call a loading "div" 1st, so the user does not see the screen hanging. However I've changed the code to load the BFILE into an actual blob 1st (through an ajax process) and then return a link to the screen pointing to an app process which opens the blob.

  • On Demand process get url query string

    Hi,
    When I call On Demand process , is there way inside that process get url query sting or whole url did call On Demand process?
    I did try below but it returns null
    owa_util.get_cgi_env('QUERY_STRING')Regards,
    Jari

    You'd know this better than me - but I seem to recall there are 2 Oracle sessions involved in normal page processing - one for the request and one for the response. wwv_flow.show seems to correspond to the response session, not the request session (that might have the env variables you're looking for). Could that explain what you're seeing?

  • Testcase, how to split up an xml message and call a BPEL process.

    Another question.
    Considering the following XML message.
    <?xml version="1.0" encoding="UTF-8"?>
    <rows>
    <row>
    <id>10</id>
    <naam>A</naam>
    </row>
    <row>
    <id>20</id>
    <naam>B</naam>
    </row>
    </rows>
    An input message can consist of 1 to about 20000 <row></row> elements. I would like to split up this message into individual <row></row> and call a BPEL process for further processing.
    I've tried to use the file adapters feature "Files contain Multiple Messages" Publish Messages in batches of.." This did not work. ( root element expected exceptions ).
    I've also tried to invoke an extra async routing service with a mapping which removes the root element. This also doesn't work as it leaves the following ( incorrect ) xml message at the end.
    <row>
    <id>10</id>
    <naam>A</naam>
    </row>
    <row>
    <id>20</id>
    <naam>B</naam>
    </row>
    Which is logical considering how an XSL transformation works.
    Is there any way to achieve this?
    Any help is appreciated!

    You shoul create a while loop, that loops through XML payload for each row. Than you can process each individual row. See also example:
    C:\orabpel\samples\tutorials\112.Arrays\ArraySample.bpel

  • How can I call a Page Process from the Select statement for Report Page

    I'm able to call a javascript using the below:
    img src="#IMAGE_PREFIX#add2.gif" border="0" alt="Icon 4" onClick="javascript:add_connect1('||CPORT.ID||')"
    But Now,
    I'd like to accomplish (2) New things:
    1. instead of using,....... onClick="javascript:add_connect1,
    I'd like to call a Page Process, onClick=
    2. I'd like to be able to call two different processes onClick.
    a. onClick="javascript:passBack('||ID||')"
    b. onClick= <Please see my question #1 above>
    Can someone please help me with the syntax for this,
    If indeed it can even be done?
    Thanks- Gary

    Greg.
    It seems that my situation is the one you describe in you second paragraph, where you mention:
    you could then add the ID column value as a parameter to the javascript functionBut,
    I do not know how to reference the variable in my javascript nor how to use it in my on-demand process.
    If you can hellp me past this last little bump, then I think I will be able to use these skills in Sooo many different areas of my design.
    Here's what I've got so far:
    A. In the select statement I identify the javascript as:
    onClick="javascript:connect_port('<font color=blue>''||ID||''</font>')";
    B. In my javascript I have this:
    <script language="JavaScript" type="text/javascript">
    function connect_port(ID)
    var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=CONNECT_PORT',0);
    gReturn = get.get();
    get = null;
    </script>
    C. In my on demand function I have this:
    BEGIN
    INSERT INTO CCONNECTIONS_B
    BLDG_ID,CLST_ID,PORT_ID,STRAND_ID
    ) VALUES
    :P2004_BLDG_ID,:P2004_CLST_ID,:P2004_PORT_ID,:P2004_STRAND_ID1
    END;
    You can see that I dont know how to use the value for 'ID' in either the javascript or the On-Process function.
    If you can help me out with this one, Then I can imitate it for the rest.
    -Gary
    Edited by: garyNboston on Apr 3, 2009 6:44 AM
    Edited by: garyNboston on Apr 3, 2009 6:44 AM
    Edited by: garyNboston on Apr 3, 2009 6:45 AM
    Edited by: garyNboston on Apr 3, 2009 6:47 AM

  • Calling an On Demand Process in PL/SQL Region without using AJAX

    Hi!
    I am trying to find a way to call an On demand Process in a PL/SQL Reports Region. The reason is that i need Reportings for about 20 Pages that look like the same but have different parameters. I already have some Processes that return SQL Statements and it works fine. But these Reportings are more complex and it's not possible to return it wirh a SQL Statement.
    I have seen some solutions in this forum that used AJAX to call such a process. The problem is, that I'm not allowed to use AJAX because activeX is diabled. I tried it and it works but i need another way to solve this process call.
    Thanks in advance
    Philipp

    At the moment I cannot say if your link can help. Right now the call of the On demand Process looks like this:
    Inside annonymous PL/SQL Region:
    <script type="text/javascript">
    get = new htmldb_Get(null,'||:APP_ID||'.,'APPLICATION_PROCESS=F_REPORT_NAME',0);
    gReturn = get.get();
    document.write(gReturn);
    </script>

  • Outside Processing for Multiple Work Orders

    I have a request for the following process in 11.5.10.2:
    I have product lines "A", "B", "C" and "D", each with variable demand. Each of these get sent for outside services on a periodic basis.
    Using the OSP functionality in Discrete Manufacturing, we want to do one PO to satisfy the supplier.
    PO#1 may look like:
    - Product A: 500 units
    - Product B: 700 units
    - Product C: 20 units
    - Product D: 1000 units
    PO#2 may look like:
    - Product A: 0 units
    - Product B: 100 units
    - Product C: 50 units
    - Product D: 0 units
    Regardless of the product mix or the number of units being processed, the supplier is going to charge me a flat rate of $1000. I want to burden each of my work orders with its percent contribution to the total PO charge.
    Said another way:
    ($ Flat Rate Charge of PO) / (Total Units of the PO) * (Units on a specific line)
    For PO#1:
    PO#1 may look like:
    - Product A: 500 units = $250
    - Product B: 700 units = $350
    - Product C: 200 units = $100
    - Product D: 1000 units = $500
    - PO total = $1200
    PO#2 may look like:
    - Product A: 0 units = $0
    - Product B: 100 units = $1000
    - Product C: 20 units = $200
    - Product D: 0 units = $0
    - PO total = $1200
    Each product would have a standard OSP lot charge in the router and variances would be driven by the actual PO.
    Is there a way to configure this?

    Hi RajaSekhar,
    You can definitely get the orders & notifications for two shifts. You can do this by adding all different workcenters in the customization in the backend system.
    To do this in the backend system go to Order Processing- and pick the corresponding OrderProcessing Scenario and double click on that- then go to varaint and click on selection report and in that you can add mutiple work centers as many as you need and then save the varaint.
    Similarly change the variant for notification processing profile also.
    After making changes in the backend, do a replication of syncbo' MAM25_090 and MAM25_095 and then do a sync from the client to get the proper data.
    If you have any further doubts please reply back.
    Regards,
    Siva.

  • On-Demand Process Running only for authenticated user

    I have noticed that an on-demand process is running only for authenticated users - for example a download of a document. For public users it doesn't. I remember seeing a similar question related to ajax on demand in this forum but couldn't locate the thread. Does anyone knows why the process is not running for not authenticated user? The result of a download for a public user is a blank page where the authenticated user gets the file by clicking on the same link.
    Thanks in advance,
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

    Hello Denes,
    Please check if the following can help you -
    Re: AJAX on public page
    Re: Calling an application level on-demand process from JavaScript
    Regards,
    Arie.

  • Creating process for multiple Date fields for update or insert in APEX

    hello there,
    could someone please help me?
    i have a form on Apex based on view that is based on three tables and updating and inserting ok using trigger instead of.
    i have a problem now as in my form i have around 75 fileds (items) incuding 30 or more date fields which could be populated or left blank or update later.
    so for each date field i have two boxs; one for date, input as dd/mm/yyyy (text field) and second for time, input as 23:45. All dates will be insert or update manually by user. so as i mentioned not all date fields could be poulated at one stage.
    so i have created some process and validations and all of them work fine but i came accross if date left blank then (:) giving me problem so i have done following further process for each date field. In real table all the date fields have data type date.
    declare
    v_my_var date; -- for first date field
    str_dy VARCHAR2(10);
    dt_indx date;
    str_tm VARCHAR2(20);
    tm_indx date;
    begin
    str_dy := :p4_first_date
    str_tm := str_dy||' '||substr(:p8_first_date_hh,1,2)||':'||substr(:p8_first_date_HH,4,2);
    dt_indx := to_date(str_tm,'DD/MM/YYYY HH24:MI');
    IF str_dy is not null then
    v_my_var :=dt_indx;
    ELSE
    v_my_var := NULL;
    END IF;
    update table 1 set my_date = v_my_var where d_id= :p4_d_id;
    end;
    above code work fine but one date field of course therefore i have to do same code for each date field with changes and initialise variable again and again for each field.
    so i like to ask is there any easy way that is more professional. i was thinking about the procedure and using collection or similar but honestly not much experience on that so could some one please help me?
    I will be very thankful.
    KRgds

    Hi,
    You can do the needful by re-using the code if you can give the item names as P8_DATE1, P8_DATE_hh1, P8_DATE2, P8_DATEhh2 etc..So your item name just differs by a sequence.
    Now you write function which will return desired date value taking above items as input. Pass item names to this function, get session state using APEX_UTIL.GET_SESSION_STATE('item_name') API.
    Now modify you code as
    FOR i IN 1..30
    LOOP
    v_date_array[i] = f_get_date('P8_DATE'||i, 'P8_DATEhh'||i);
    END LOOP;
    ....Now you have all date valus in array. Just write one update as follows
    UPDATE  TABLE1
    SET date1 = my_date_array[1], date2 = my_date_array[2]..
    WHERE ....Hope it helps :)
    Cheers,
    Hari

  • On demand process time limit.

    Hello, I would like to know if Apex has time out limit on "On demand process" ? I have a long running insert query in my on demand process and I was hoping that the process will complete when the query finishes, but it doesn't seem that way. Is the time out for an on demand process the same as the time out time for Apex pages?
    George

    I was hoping that the process will complete when the query finishesWhy should the Ondemand process run after the PLSQL block has completed.
    Do you have some kind of infinite loop happening over the ajax call ? Even so you might face something like "too much recursion" error in Javascript.

  • Passing value to another form with on demand process

    Hi,
    This is my first post and I am an absolute beginner to apex (using 4.1)
    I would like to pass a value to another form, but to no avail.
    I have an on demand process that is being called when a button is clicked (ISSUE)
    This process is being called from P33 and I need the value to go to P33_ST_NUMBER_HOLD
    DECLARE
      v_rownum NUMBER;
    BEGIN
      for i in 1..apex_application.g_f01.count
      loop
        v_rownum := apex_application.g_f01(i);
        apex_debug_message.log_message('row selected: '||v_rownum);
        apex_debug_message.log_message('value: '||apex_application.g_f03(v_rownum));
        htp.p('$x_Value("P17_ST_NUMBER_HOLD",apex_application.g_f03(v_rownum));');
    end loop;
    END;What am I doing wrong?
    Edited by: Hansen_____ on 2012/06/15 1:15 AM

    Hansen_____ wrote:
    htp.p('$x_Value("P17_ST_NUMBER_HOLD",apex_application.g_f03(v_rownum));');This is PL/SQL and you have to use one of these methods to set the item value, But you are using javascript API's in PL/SQL.
    FYI - javascript is a client/browser side and it got nothing to do with PL/SQL
    :P17_ST_NUMBER_HOLD := apex_application.g_f03(v_rownum);
    //OR
    APEX_UTIL.SET_SESSION_STATE('P17_ST_NUMBER_HOLD',apex_application.g_f03(v_rownum));http://docs.oracle.com/cd/E17556_01/doc/apirefs.40/e15519/apex_util.htm#AEAPI181

  • Are On-Demand Processes Conditional?

    Hi,
    Within Apex 4.1.1, when an Application Process is created it states, “Note: Conditions are not used for "on-demand" processes. All conditions for processes that run at the "on-demand" process point must be set by the calling process.” Within Apex 4.2.1 it no longer states this message.
    1.     Does the note mentioned above apply regardless of whether or not you are calling the process from an apex page process (e.g. create process, choose on-demand option) or from an AJAX callback initiated from Javascript. Will the application process condition be ignored in one or both instances?
    2.     Does the above note still apply in 4.2.1?
    Thanks,
    JIM

    Found the answer.... Eventually.....
    http://apex.oracle.com/pls/apex/f?p=38997:8:0::NO
    Going to the above link and looking at the APEX 4.2 Early Adopter Changes
    Feature : APEX 4.2 Early Adopter > APEX 4.2 Other Features > Remove the restriction that on-demand processes can't have a condition or authorization
    Currently on-demand processes don't include the ability to define authorization or conditions. This has been incorporated to provide the same options for on-demand processes as for other components.
    In 4.2 On-demand can now use conditions previously the could not.
    JIM

  • Error while using ajax addParam function in on demand process

    Hi ,
    I am calling an on demand process from a javascript that inserts value from a modal from into a table.
    function f_insert_transaction()
    var ajaxRequest = new htmldb_Get(null, $v('pFlowId'), 'APPLICATION_PROCESS=insert_manual_transaction',73);
              ajaxRequest.addParam('x01', $v('P73_ARRANGEMENT_ID'));
              ajaxRequest.addParam('x02', $v('P73_TRANSACTION_DIALOGID'));
              ajaxRequest.addParam('x03', $v('P73_CUSTOMER_NAME'));
              ajaxRequest.addParam('x04', $v('P73_CUSTOMER_NUMBER'));
    ajaxRequest.addParam('x05', $v('P73_SALES_ORDER'));
    ajaxRequest.addParam('x06', $v('P73_SO_LINE'));
    ajaxRequest.addParam('x07', $v('P73_INVOICE'));
    ajaxRequest.addParam('x08', $v('P73_INVOICE_LINE'));
    ajaxRequest.addParam('x09', $v('P73_ITEM'));
    ajaxRequest.addParam('x10', $v('P73_ITEM_DESC'));
    var ajaxResult = ajaxRequest.get();
    alert(ajaxResult);
    ajaxRequest = null;
    }The insert works fine as long as item names range from x01 - x10.
    When I add the below
    ajaxRequest.addParam('x11', $v('P73_QUANTITY')); The insert stops working, and the alert displays the following error message :
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <HTML><HEAD>
    <TITLE>404 Not Found</TITLE>
    </HEAD><BODY>
    <H1>Not Found</H1>
    The requested URL /pls/dev1/wwv_flow.show was not found on this server.<P>
    <HR>
    <ADDRESS>Oracle-Application-Server-10g/10.1.2.0.0 Oracle-HTTP-Server Server at </ADDRESS>
    </BODY></HTML>
    Appreciate any help in debugging this
    Thanks,
    Dippy
    Edited by: Dippy on Aug 2, 2010 10:14 AM

    Hello:
    You could concatenate the page-item values into a single string where the values are separated from each other by a suitable delimiter ( a colon for example) and set, x01, to this concatenated value. You could then decompose this concatenated string in the ODP used in the AJAX call to obtain the individual values.
    varad

  • How to call a BPEL process from Java ?

    How can I call a BPEL process from Java?
    The Java client should be outside of the PEL engine.
    Does someone have a piece of sample code for
    a "Hello world" java-to-bpel call (+ java client src)?

    http://www.oracle.com/technology/products/ias/bpel/pdf/orabpel-Tutorial7-InvokingBPELProcesses.pdf

  • Apex_util.prepare_url from PL/SQL (outside APEX)

    Hello there,
    I have to create a job that sends emails with a link to a page with SSP actived and that requires authentification.
    I've read those threads from Dan and Omar and I wonder if this is still possible in APEX 4.2.1?
    Re: apex_util.prepare_url outside of ApEx
    Create APEX session context from outside APEX (plsql)
    My procedure generate the link with the checksum, but when I try to access the page I got an error :
    •is_internal_error: true
    •apex_error_code: APEX.SESSION_STATE.SSP_VIOLATION2_FOR_DEVELOPERS
    •error_backtrace: ----- PL/SQL Call Stack -----
      object      line  object
      handle    number  name
    0x69e9c2e8       548  package body APEX_040200.WWV_FLOW_ERROR
    0x69e9c2e8       599  package body APEX_040200.WWV_FLOW_ERROR
    0x69e9c2e8       903  package body APEX_040200.WWV_FLOW_ERROR
    0x6e5ff258      6025  package body APEX_040200.WWV_FLOW
    0x73cbd318       249  procedure APEX_040200.F
    0x6bdb2dd0        31  anonymous blockHere is my proc (code found in Omar's thread).
    Maybe I'm missing something.
    CREATE OR REPLACE procedure testInitApexFromOutside
          ( i_app_id     in number
          , i_page_id      in number
          , i_apex_user    in varchar2
          ) is
        v_cgivar_name  owa.vc_arr;
        v_cgivar_val   owa.vc_arr;
        v_workspace_id NUMBER;
        v_app_id       number;
          BEGIN
        -- set up cgi environment
        htp.init;
        v_cgivar_name(1) := 'REQUEST_PROTOCOL';
        v_cgivar_val(1)  := 'HTTP';
        owa.init_cgi_env
          ( num_params => v_cgivar_name.count
          , param_name => v_cgivar_name
          , param_val  => v_cgivar_val
        -- load apex IDs by application name
        SELECT workspace_id,
               application_id
        INTO v_workspace_id,
             v_app_id
        FROM apex_applications
        WHERE application_id=i_app_id;
        -- set up apex workspace
        wwv_flow_api.set_security_group_id(v_workspace_id);
        -- set up apex session vars
         apex_application.g_instance     := wwv_flow_custom_auth.get_next_session_id;
        apex_application.g_flow_id      := v_app_id;
        apex_application.g_flow_step_id := i_page_id;
        -- "login"
        apex_custom_auth.define_user_session
          ( p_user       => i_apex_user
          , p_session_id => apex_application.g_instance
        wwv_flow_custom_auth_std.post_login
          ( p_uname      => i_apex_user
          , p_session_id => apex_application.g_instance
          , p_flow_page  => apex_application.g_flow_id
                         || ':'
                         || apex_application.g_flow_step_id
          -- set array of protected page IDs for session state protection
         apex_application.g_protected_page_ids(1) := '1500';    -- this establishes page 1500 as an SSP-protected page
        dbms_output.put_line(APEX_UTIL.PREPARE_URL('f?p='||i_app_id||':'||i_page_id||':::NO:1500:P1500_PEV_SEQ_NO:18137',2));
    end testInitApexFromOutside;And the result:
    f?p=128:1500:::NO:1500:P1500_PEV_SEQ_NO:18137&cs=3B3D5905A7DDBCB5520E8F88885169CAC
    Thanks for your help,
    Lucien

    See Re: Link in report ?
    Maarten

Maybe you are looking for

  • Error in Adobe Java Script

    Hi, I am facing one issue while working in Adobe forms. My requriement is as follows. Two Drop down lists are there. Say Z1 and Z2. Z1 will contain three values.( A1, A2, A3). Assume for A1, the corresponding values  in Z2 are (1,2,3,4,5,6,8,10). Ass

  • Editing a song in itunes

    I'm trying to make a play list that is just the first 30 seconds of a few songs. I know how to go in and change when the song starts and when it stops.  My question is do I not get to keep the original version of the song in my library as well? It se

  • Using home wifi to make phone calls

    Please someone - I have been reading info until I can't see! Will someone please give me some step by step instructions as to how to set up a C6 using a SIP client? I've seen almost every phone discussed but the C series. Thanks

  • Number of errors during itunes instillation??

    When installing the newest version of itunes i get this message 'Warning 1909 cannot create shortcut itunes.lnk verify that the destination folder exist and that you can access it'' I have uninstalled and reinstalled itunes several times and deleted

  • Where do i find the "cookies' and how to delete

    how do I access the "cookies' on my computer