On-Demand process: Return status?

I have a ODP that is called as a application process from an instance of the htmldb_Get object.
The ODP returns the standard output using htp.p that is injected into the DOM of the calling page as appropriate.
Along with this, I also need to return a "return status" that would determine further execution in the calling function. 0 for no errors, 1 for error and so on.
I guess this is where it makes sense to return a structured output from the ODP using either XML or JSON, right? The output stream or "payload" could contain the real output that is consumed by the calling process and the out-of-band status code that I need.
What is the most elegant, "infrastructure" way to do this sort of thing?
Are there readymade JSON encoders for PL/SQL that can be used here?
Thanks

Vikas,
I have not tried the package available at:
http://reseau.erasme.org/Librairie-JSON
Regards
Roelie

Similar Messages

  • Process Flow - External process - Return status

    Did any one know how to capture or get the return value when executing a shell script thru Process flow - User defined - External process?
    This is the scenario.
    OWB Server on UNIX. Version-10.2, Database-9i
    I am executing a simple "whoami" command thru the user-defined process.
    How do I capture the return value?
    One of my shell script returns a value. Based on this return value I have to send a page or schedule a dependency job on successful completion.
    Thanks.

    To add a parameter to the process flow, you will have to add a parameter to the start activity in the activity view (lower left corner of the process flow editor), by clicking the Add button.
    You can then pass this parameter to the other activity by using the parameter binding - click on the BINDING column of the activity parameter you want to pass it to and select the parameter added to the start activity in the previous step from the drop down list.
    When the PF is run, the user will be prompted for a parameter, then it will be passed to the next activity.
    Regards:
    Igor

  • Payment Process Request Status Report - Add Invoice Distribution Section

    Hi,
    I posted this in the E-Business Financial forum, but I think this is the right forum to seek for an answer to my question.
    In R12.1.3, I need to add Invoice Distribution details into "Payment Process Request Status Report" report. I know that function "Get_Docline_Ext_Agg" in package "IBY_FD_EXTRACT_EXT_PUB" needs to be extended, but I do not know how to do it when it involves adding a new level of records into the XML, assuming that an invoice line can have multiple distribution entries, the function return could not simply be an aggregate value but instead needs to be a collection of records, so I can loop throug them in the RTF tempalte using for-each statement.
    Please let me know if this makes sense and/or if you had to deal with a similar issue.
    Thanks,
    Sinan

    Hi,
    Is this the right forum to post this question?
    I would appreciate any comments.
    Thanks,
    Sinan

  • Process Chain Status is Red even though all processes are successful.

    I implement ABAP Code by using standard function module "RSPC_CHAIN_START" for execute process chain and return status of process chain after execute completely as following code:
    Execute Process Chain
    CALL FUNCTION 'RSPC_CHAIN_START'
      EXPORTING
        I_CHAIN             = I_CHAIN
        I_SYNCHRONOUS       = I_SYNCHRONOUS
    IMPORTING
       E_LOGID             = P_LOGID.
      If sy-subrc = 0.
        gt_status = 's'.
        WHILE gt_status = 's'.
    Get Status of Process Chain
          CALL FUNCTION 'RSPC_API_CHAIN_GET_STATUS'
          EXPORTING
          i_chain              = I_CHAIN
          i_logid              = P_LOGID
         IMPORTING
          E_STATUS             = gt_status
          E_MESSAGE            = P_MESSAGE.
    Status G or F - Report that the Chain is Successfully Completed.
    Status A - The chain is Currently running
    Status R or X - Report that the chain has ended with Errors.
        CASE gt_status.
        WHEN 'A'.
    Process chain is running
          gt_status = 's'.
          P_MESSAGE = ''.
        WHEN OTHERS.
    Process chain is completed
          exit.
        ENDCASE.
        IF gt_status = 's'.
           WAIT UP TO 2 SECONDS.
        ENDIF.
    ENDWHILE.
    Display Message
      IF gt_status = 'G' or gt_status = 'F'.
        MESSAGE i162(00) WITH P_MESSAGE.
      Else.
        MESSAGE e162(00) WITH P_MESSAGE.
      ENDIF.
      ENDIF.
    From above code, when execute this function module, sometimes status of process chain is shown as canceled 'X', therefore, output of this function module is shown as "The process chain is canceled". When monitor process chain in RSPC log view, the process chain status is also shown as canceled 'X' and status of all process in process is green, however, after wait for a while, the status changed from canceled 'X' to successful 'G'.
    Why did the status of process chain show as canceled 'X' even though finally process chain status is successful ? If I want to check status of process chain after execute completely, which status should to check in ABAP code?
    Regards,
    Pui

    Using that FM.. u will be providing the Instance and Variant of the failed process.. and hence the reload will start from the failed process but not the entire chain...
    In general the process status shud finish then or based on the link combination  the change from one process to other will happen...
    try to maintain a wait time between the process atleast 2 to 4 secs..
    thanks
    hope this helps..

  • 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>

  • 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.

  • PL/SQL process returning message with more than 4000 chars

    In our apex application we are using a pl/sql process returning a message.
    This message should be shown to the user.
    Our problem is now, that the application items in APEX seem to be limited to 4000 chars and the message can be longer.
    We are also not able to use a collection, because we can't print the content of a collection in the "Process Success Message".
    Here is the content of a page process which is running on page load after header:
    Name - Type:     PL/SQL anonymous block
    Source - Process: :AI_TEST := p0001_pkg.get_text;
    Messages - Process Success Message: &AI_TEST.
    Image from process [https://twitter.com/OliverLemm/status/324058809138032640/photo/1/large]
    If the page is called the result is this error message:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    Technical Info (only visible for developers)
    is_internal_error: false
    ora_sqlcode: -6502
    ora_sqlerrm: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    component.type: APEX_APPLICATION_PAGE_PROCESS
    component.id: 16433072916569237418
    component.name: get_text
    error_backtrace:
    ORA-06512: at "APEX_040200.WWV_FLOW_PROCESS", line 100
    ORA-06512: at "APEX_040200.WWV_FLOW_PROCESS", line 141
    Edited by: Oliver L on 16.04.2013 09:17

    no an item like P0_TEST on page 0 / global page also does not help.
    But the error is not the application item / page item it's the problem that the "Process Success Message" can't handle more than 4000 chars.
    I tried to paste a string into the process success message, but the error "Error processing row. ORA-01461: can bind a LONG value only for insert into a LONG column" occured even when i filled the textarea and saved the process.
    So there's no problem with the application item or page item.
    Edited by: Oliver L on 16.04.2013 10:00

  • On Demand Process - Special Characters

    I have an on demand process (ODP) that I use to populate items in a page with. I followed the examples from Denis Kubrik and others on the OTN. The problem I have run into is data with ampersands. I know that there a special characters that need to be escaped in XML documents. I have used the replace function in the SQL Query to change '&' into '&amp;'. However, the process still seems to die. I am using the testing capability documented here.
    When I run the ODP that does not return the ampersand all is well, I see the XML document. When I retrieve a row with the ampersand I see:
    "Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    The operation completed successfully. Error processing resource 'http://test:7734/pls/apex/f?p=128:0:8491..."
    When I run the SQL code from SQL developer using output I see a valid XML document.
    Does anyone have any insight to this?
    Thanks!

    DECLARE
    v_first_name VARCHAR2 (50);
    v_last_name VARCHAR2 (50);
    v_title VARCHAR2 (50);
    v_phone VARCHAR2 (25);
    v_email VARCHAR2 (50);
    v_dept VARCHAR2 (200);
    BEGIN
    FOR c IN (select first_name, last_name, nyc_title, desk_phone_number, email_address, kronos_badge_number, employee_id, replace(department_name,'&','&amp;') department_name
    from anc_employees_v
    where employee_id = TO_NUMBER (v('EMPLOYEE_ID')))
    LOOP
    v_first_name := c.first_name;
    v_last_name := c.last_name;
    v_title := c.nyc_title;
    v_phone := c.desk_phone_number;
    v_email := c.email_address;
    v_dept := c.department_name;
    END LOOP;
    OWA_UTIL.mime_header ('text/xml', FALSE);
    HTP.p ('Cache-Control: no-cache');
    HTP.p ('Pragma: no-cache');
    OWA_UTIL.http_header_close;
    HTP.prn ('<body>');
    HTP.prn ('<desc>this xml genericly sets multiple items</desc>');
    HTP.prn ('<item id="P16_FIRST_NAME">' || UPPER(v_first_name) || '</item>');
    HTP.prn ('<item id="P16_LAST_NAME">' || UPPER(v_last_name) || '</item>');
    HTP.prn ('<item id="P16_TITLE">' || v_title || '</item>');
    HTP.prn ('<item id="P16_PHONE">' || v_phone || '</item>');
    HTP.prn ('<item id="P16_EMAIL">' || UPPER(v_email) || '</item>');
    HTP.prn ('<item id="P16_DEPARTMENT_ID">' || UPPER(v_dept) || '</item>');
    HTP.prn ('</body>');
    EXCEPTION
    WHEN OTHERS THEN
    OWA_UTIL.mime_header ('text/xml', FALSE);
    HTP.p ('Cache-Control: no-cache');
    HTP.p ('Pragma: no-cache');
    OWA_UTIL.http_header_close;
    HTP.prn ('<body>');
    HTP.prn ('<desc>GET_EMPLOYEE_DATA</desc>');
    HTP.prn ('<item id="P16_ERROR">' || SQLERRM || '</item>');
    HTP.prn ('</body>');
    END;

  • Problem with simple on demand process

    hi
    my on demand process
    declare
    art char := 'GT';
    begin date := '01.01.2006';
    end date := '31.01.2006';
    v_count number;
    begin
    select wvfk.fu_working_days(ART,begin,end)
    into v_count
    from dual;
    end;
    and that's the call
    function test()
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,'APPLICATION_PROCESS=WORKING_DAYS',0);
    gReturn = get.get();
    alert(gReturn);
    but the alert return nothing
    what is wrong

    So what is your on demand process supposed to return? You are returning a value from
    dual into a variable and the process is returning no value. How about having
    HTP.prn (v_count);
    in your on demand process. Debug it using SQL Workshop and see what you get.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • On demand process problem

    Hi,
    i wanted to creat in my aplication a process "on demand " to make the download of a file stored in my bd, but when i try to creat process the xe assistent returns this error:
    To create an on-demand page process, at least one application level process must be created with the type 'ON-DEMAND'.
    What does it meen?
    Thank's in advance

    Hi Pepe,
    This is a ordering issue,
    The steps are:
    1. Create the Application Level On-Demand process,
    then
    2. Create the page that will invoke the On-Demand process.
    Check out the APEX User Guide (Chapter 4). This is one area that seems to be well documented.
    Hope this helps
    Patrick

  • On-demand process query works only on some columns

    I've run into what seems a strange problem. I have an on-demand process that queries the DB and returns a populated select list, which I've successfully used in several places. The query used returns values as it should when I query the DB directly. Within my process however, it returns no rows. I know the process works because if I replace the query that i need, with one on another column in same table, my select list populates. There are several other columns that also don't work, though there is no pattern in terms of data type, size, etc, that I can see, except that the non-working columns are rather far down a list of over 30 columns for that table.
    Here is the process text:
    begin
    owa_util.mime_header('text/xml', FALSE );
    htp.p('Cache-Control: no-cache');
    htp.p('Pragma: no-cache');
    owa_util.http_header_close;
    htp.prn('<select>');
    for rec in (select distinct op_comm d, op_comm r from CPUJAN2006
    where upper(stream) = upper(:P100_TEMP_STREAM))
    loop
    htp.prn('<option value="' || rec.r || '">' || rec.d || '</option>');
    end loop;
    htp.prn('</select>');
    end;
    As mentioned, I can use this select statement directly on the DB and I can replace it in the process, with something like "select db_version from CPUJAN2006" and that works. Any ideas why this would not work on certain columns - could it have anything to do with number of columns in the table or column size?
    Any advice appreciated. Thanks,
    Michelle

    I can and will if this doensn't clarify. I've narrowed down problem to specific records returned from the process query.
    The text entries populating the select list sometimes contain the char '&'. When I get rid of these, my select lists look fine. The select list is populated with following bit:
    htp.prn('<option value="' || rec.d || '">' || rec.r || '</option>');
    I am thinking the & in some rec.d entries is interpreted as something other than text. I cannot change these text values in the DB, because they are fed from another DB. Can I somehow tell the process to view speacial characters as text?

  • 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?

  • On demand process linked to a POP UP LOV - help

    Hi,
    I am trying to set an application item to the return value of a pop up lov that has a display value and a return value. The display value is a text item and the return value is a number id. I need the id for an on demand process.
    When I look at the session state for the application item and the page item for the pop up it shows the display value and not the numeric id.
    thanks.
    Edited by: DragonLady on May 19, 2010 9:23 PM

    Anyone?

  • 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

  • R12 Payment Process Request Status Report adding extra columns to XML data.

    In 11i, we had modified the Preliminary Payment Report to include extra columns ( invoice distributions). In r12 , that report is obsolete and Oracle introduced a new report "Payment Process Request Status Report". This request uses BI Publisher to generate the final report output. I am unable to modify the template since the XML output of the report does not
    contain the invoice distribution account data. We need to know how can we modify the XML data to include the extra columns.
    For Funds Disbursement Process ( Payment Instruction File) , Oracle provides IBY_FD_EXTRACT_EXT_PUB extensibility package to construct custom XML element structure that can be added to the payment XML extract generated by Oracle Payments. Do we have something similar for this report ? Are there any other options available ?
    Thanks

    Hi
    The same package "IBY_FD_EXTRACT_EXT_PUB" works for payment process request status report also. Please add the logic to get the distribution data in this package and you will see the new XML tags in this report also.
    Hope this helps.
    Vinit

Maybe you are looking for