NonBlocking_With_Callback

Can anyone please provide a clear explanation/Usage of the
Function "NonBlocking_With_Callback" in the WebUtil_Host package?
I looked at the WebUtil online documentation. It has very little
information on its usage.
It would be great if someone who has used it could give an example.

Hello,
Yes, it is a user-defined form-level trigger.
Francois

Similar Messages

  • Webutil_host.blocking /nonblocking_with_callback problem

    I have a word document stored in the database. I want to open it in Word, edit it, save then store it back in the database.
    I thought that by using webutil_host.blocking, it would wait until I'd saved the document before continuing, but it doesn't.
    I've tried the following code:
    ret_code := WEBUTIL_HOST.Blocking('C:\Program Files\Microsoft Office\Office10\WINWORD.exe '|| doc_name ) ;
    and also:
         cmd := 'cmd /c start "" /WAIT "' || doc_name || '"' ;
         ret_code := WEBUTIL_HOST.Blocking( cmd );
    but neither work - the code following (to save back into the database) executes immediately and doesn't wait until I've quit Word.
    I've also tried using nonblocking_with_callback with a callback trigger, but the trigger is executed immediately while my Word doc is still open!
    Can anyone help?

    Hello,
    Yes, it is a user-defined form-level trigger.
    Francois

  • FUNCTIONS NonBlocking & NonBlocking_With_Callback

    Hi there,
    I have a problem i can not solve by my own. I need help please!!
    I need to open a PDF file from my aplication, and it will open if the path of Windows (cmd \ path) has the AcroRd32.exe on it. If the user has it configured on his computer like that, i would like to use the first function, and if not, the NonBlocking_with_callback so i can put on the HOST_CALLBACK Trigger a message telling the user to configure his Windows Path manually, to open the file.
    The point is that using only the first function i cannot find a way to open a message to the user to indicate him to configure his computer if it needs it, and using the second one the trigger comes out even if it needs it or not.
    In a thread before (How to get the Windows Path i try to get the windows path to know if the user's computer needed to be configured or not, so i could put a message without any problem, but as the thread say, I cannot find the way to do it.
    Please, tell me something... I am starting to have a headache.
    Message was edited by:
    abladb

    This is what i was looking for. This works!!!. Thanx for reading anyways.
    declare
    p_modo Varchar2(50);
    p_aplicacion varchar2(50) := 'AcroRd32';
    fname VARCHAR2(200); -- = absolute rute of the file
    pid WEBUTIL_HOST.PROCESS_ID;
    begin
    l_cadena := 'CMD /C ' || p_aplicacion || ' ' || fname;
    IF p_modo = 'NONBLOCKING_WITH_CALLBACK' THEN
    pid := WEBUTIL_HOST.NONBLOCKING_WITH_CALLBACK(l_cadena, 'HOST_CALLBACK');
    -- Nota: HOST_CALLBACK es un trigger que tendremos que tener definido en el form.
    Synchronize;
              DECLARE
              v_error_salida WEBUTIL_HOST.output_array;
              BEGIN
              v_error_salida := WEBUTIL_HOST.Get_Standard_Error(pid);
              message(v_error_salida(1));
    Synchronize;
              message('Puede que sea necesario configurar su equipo. Consulte la ayuda de nuestra aplicación (?).');
              EXCEPTION
              When Others Then
              -- Cuando no existen errores en el proceso activo, la variable v_error_salida no va informada,
              -- produciendose un error al ser llamada en Pon_Nota(v_error_salida(1));
              Null;
              END;

  • Issue with nonblocking_with_callback

    I am trying to open www.google.com from the form. I used WEBUTIL_HOST.nonblocking_with_callback( 'cmd /c start "/wait" http://www.google.com', 'callback' ).
    created callback trigger in form level. when the google.com is open, the item should be inactive and when i close the browser the item should be active. to make the item active i wrote the code in callback trigger.
    but my issue is when i run the form and click on the url, it opens in the webpage and immediately the item gets inactive and then active. it is not waiting for the webpage to get close.
    this is the code i used in callback trigger
    declare
         ur item;
         process webutil_host.PROCESS_ID;
    begin
         process := webutil_host.get_callback_process;
         webutil_host.release_process(process);
         if not webutil_host.id_null(process) then
              --webutil_host.terminate_process(process);
              ur :=find_item('hyperlink.button');
              set_item_property(ur, enabled, property_true);
         end if;
    end;
    waiting for some help.
    Thanks

    yeah I am able to block the form when working on notepad, adobe and word doc by using the below code
    CLIENT_HOST('CMD /C NOTEPAD '||fname);
    CLIENT_HOST('cmd /c "c:/web_util[1].pdf"');
    but unable to block the form when working on IE using CLIENT_HOST( 'cmd /C "C:/Program Files/Internet Explorer/iexplore.exe" http://www.google.com');
    I am using oralce forms 10.1.2.3 and IE8.
    Hope I get the answer from someone.
    Thanks.

  • WebUtil.NonBlocking_with_Callback

    Is there any documentation with examples of how to use WebUtil.NonBlocking_with_Callback? I have tried creating a local variable of type "process_id", that didn't compile. What kind of callback trigger does this refer to? Is this a user-defined form-level trigger? I am using WebUtil successfully in other areas by guessing how to use it, but I am stumped here. Thanks, in advance.

    Hello,
    Yes, it is a user-defined form-level trigger.
    Francois

  • Webutil CLIENT_HOST problem

    Hi,
    I am trying to use Webutil_host.NonBlocking_With_Callback.
    When I invoke a txt document via notepad, it works fine but not for doc file
    This is for Notepad:
    V_PROCESS_ID := WebUtil_Host.NonBlocking_With_Callback('NOTEPAD '||C:\Test.txt, 'CALL_BACK');
    This works absolutely fine,it opens the txt file and my code in Call_Back trigger gets fired when I close the 'Notepad Application'
    But when I want to open word doc I cannot use above code. so I have to use
    v_cmd := 'cmd /c C:\Test.doc';
    V_PROCESS_ID := WebUtil_Host.NonBlocking_With_Callback(v_cmd , 'CALL_BACK');
    This works fine upto opening the document, but also immediately fires the code in Call_Back trigger not waiting for the 'Word Application' to be closed.
    Is there a way to get around this???

    Hi Manohar.
    Could you please post the text of the metalink note 290130.1 for someone that has not access to metalink???
    Thanks,
    Fabrizio

  • PARALLEL WORK IN AN OPENED WORD DOCUMENT AND FORMS 9i

    Hello,
    Our customer want to have an enhanced integration of the Forms application and
    MS Word. Currently, he opens an existing Word-file from a Forms form, MS Word
    opens, he edits the Word file, closes it, and goes back to the Forms
    application.
    The point is, that while the Word file is being opened, he wants to be able to
    go back to the Forms application do some necessary things, and then go back to
    MS Word where his word file is "waiting". Actually, he needs the possibility to
    switch between Forms 9i application and MS Word.
    The integration with MS Word is being done using WebUtil 1.0.6. The call to MS
    Word is done using WEBUTIL_HOST.blocking. I also tried to call MS Word using
    CLIENT_OLE2-Procedures but again I'm not able to go back to the Forms
    application.
    Is it somehow possible or is there any workaround how to enable the "parallel"
    work in Forms application and MS Word?
    Thank,
    Dimce

    Hi Dimce,
    Okay. approach in the right direction. In order to get forms to wait executing the trigger code while in non-blocking mode, create a callback scenario. This is out-of-the-box webutil functionality (please read the webutil manual for details).
    In short,
    1) create a callback trigger at forms level
    2) move all code that fires after you call MS Word to the call back trigger. This code is then executed whenever MS Word is calling back to forms.
    3) use webutil_host.nonblocking_with_callback instead.
    Regards,
    Harm

  • OPENING AND GETTING MS WORD ACTIVE DOCUMENT THROUGH CLIENT_OLE2

    I am opening a word document through webutil host command. Now I need to get the active document of the opened word file.
    How it is possible?. Since I need to fire Callback trigger 'MY_TRIGGER' I can not define 'Word.Application' and get the
    'ACTIVEDOCUMENT'.
    DECLARE
    PID WEBUTIL_HOST.PROCESS_ID;
    app CLIENT_ole2.OBJ_TYPE;
    ADOC CLIENT_ole2.OBJ_TYPE;
    BEGIN
    PID := WEBUTIL_HOST.NonBlocking_With_Callback('D:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE C:\MYWORD.DOC','MY_TRIGGER');
    --APP := CLIENT_OLE2.CREATE_OBJ('WORD.APPLICATION');     
    --ADOC := CLIENT_OLE2.INVOKE_OBJ(APP,'ACTIVEDOCUMENT');          
    END;

    hi
    i did not get u very well but i am trying to help u.what do u want to achieve?
    check this code.
    DECLARE
    app CLIENT_OLE2.OBJ_TYPE;
    docs CLIENT_OLE2.OBJ_TYPE;
    doc CLIENT_OLE2.OBJ_TYPE;
    selection CLIENT_OLE2.OBJ_TYPE;
    args CLIENT_OLE2.LIST_TYPE;
    BEGIN
    -- create a new document
    app := CLIENT_OLE2.CREATE_OBJ('Word.Application');
    CLIENT_OLE2.SET_PROPERTY(app,'Visible',1);
    docs := CLIENT_OLE2.GET_OBJ_PROPERTY(app, 'Documents');
    doc := CLIENT_OLE2.INVOKE_OBJ(docs, 'add');
    selection := CLIENT_OLE2.GET_OBJ_PROPERTY(app, 'Selection');
    -- insert data into new document from long item
    CLIENT_OLE2.SET_PROPERTY(selection, 'Text', :long_item);
    -- save document as example.doc
    args := CLIENT_OLE2.CREATE_ARGLIST;
    CLIENT_OLE2.ADD_ARG(args, 'c:\temp\example.doc');
    CLIENT_OLE2.INVOKE(doc, 'SaveAs', args);
    CLIENT_OLE2.DESTROY_ARGLIST(args);
    -- close example.doc
    args := CLIENT_OLE2.CREATE_ARGLIST;
    CLIENT_OLE2.ADD_ARG(args, 0);
    CLIENT_OLE2.INVOKE(doc, 'Close', args);
    CLIENT_OLE2.DESTROY_ARGLIST(args);
    CLIENT_OLE2.RELEASE_OBJ(selection);
    CLIENT_OLE2.RELEASE_OBJ(doc);
    CLIENT_OLE2.RELEASE_OBJ(docs);
    -- exit MSWord
    CLIENT_OLE2.INVOKE(app,'Quit');
    END;sarah

  • WebUtil: CLIENT_HOST arg #2

    According to the PROCEDURE BODY of CLIENT_HOST WebUtil's attached library, there is a second argument (KWD in number).
    Does anyone know what this does? The Oracle documentation I have seen does not address this argument.
    Also: Is there a way to launch a client-side application asynchronously so that the user does not have to exit the client app in order to free-up the oracle screen which launched it?
    Thanks for any insight.

    Hello,
    The Webutil HOST package contains all you need:
      FUNCTION  Host(cmd in VARCHAR2) return PLS_INTEGER;
      PROCEDURE Host(cmd in VARCHAR2);    
      FUNCTION  Blocking(cmd in VARCHAR2) return PROCESS_ID; 
      PROCEDURE Blocking(cmd in VARCHAR2);  
      FUNCTION  NonBlocking(cmd in VARCHAR2)return PROCESS_ID;
      PROCEDURE NonBlocking(cmd in VARCHAR2);
      FUNCTION  NonBlocking_With_Callback(cmd in VARCHAR2, callbackTrigger in VARCHAR2)return PROCESS_ID;As you can see, it contains a NonBlocking function ;o)
    Francois

  • Options for Client_host

    Hi,
    Do anyone have a link which can show what are all the parameters (or options) that can be used along with client_host and webutil_host
    Regards

    All is written in the webutil.pll itself:
    PROCEDURE CLIENT_HOST(syscmd Varchar2, kwd Number default NULL) IS
    * CLIENT_HOST
    *   This procedure duplicates the action of the HOST Built-in, except that it
    *   operates on the client (browser) tier rather than the Applcation server tier. 
    *   Existing HOST code  can be re-directed to run on the client simply by
    *   prefixing all the calls with "CLIENT_"
    *   The oracle.forms.webutil.host.HostFunctions bean is needed in your
    *   Form to use these functions
    *   Note 1) This version (like client server) is Blocking and will prevent
    *   re-draw of the Forms Screen whilst the Host command is active
    *   Note 2) The kwd argument (e.g. NO_SCREEN etc) is ignored
    *   For more flexible "Host" commands see the WEBUTIL_HOST package
    *   That has facilities for Asynchronous callbacks and return codes
    * Version 1.0.0
    * Change History
    *   1.0.0 DRMILLS 03/JAN/2003 - Creation
    BEGIN
         -- simply call through the to WEBUTIL_HOST.HOST() Function
      if WEBUTIL_HOST.HOST(syscmd) <> 0 then
           raise form_trigger_failure;
      end if;
    END CLIENT_HOST;
    PACKAGE WEBUTIL_HOST IS
    * WEBUTIL_HOST
    *   This Package contains routines to execute "host" commands on the client
    *   Calls may be blocking or asynchronous and if aysnchronous may have a
    *   callback mode e.g. You fire off the process on the client and when it
    *   has finished a user named trigger will execute
    * Version 1.0.2
    * Change History
    *   1.0.0 DRMILLS 27/JAN/2003 - Creation
    *   1.0.1 DRMILLS 01/MAR/2003 - Slight API changes
    *   1.0.2 DRMILLS 17/MAY/2003 - Added call to WebUtil_Core.Init
       * Types
       * PROCESS_ID is a type to represent a process so that you can do
       * things like get the return code and error output and also kill it
      type PROCESS_ID is record (handle PLS_INTEGER);
       * OUTPUT_ARRAY is used to return the Standard Out and Standard Error output
       * from a host command - each line of the output will appear as a member of this array
      type OUTPUT_ARRAY is table of VARCHAR2(256 char) index by binary_integer;
       * Functions
       * HOST function is closest to the old client/server Host.
       * It blocks the Forms client until the host call is finished.
       * This version returns with the return code from the client
      FUNCTION  Host(cmd in VARCHAR2) return PLS_INTEGER;
       * HOST function is closest to the old client/server Host.
       * It blocks the Forms client until the host call is finished.
       * This version returns nothing
      PROCEDURE Host(cmd in VARCHAR2);    
       * Blocking like the Host function blocks the client until
       * it is finished.  However it returns the process id rather
       * than the return code.
      FUNCTION  Blocking(cmd in VARCHAR2) return PROCESS_ID; 
       * This version of Blocking is identical to the HOST Procedure
      PROCEDURE Blocking(cmd in VARCHAR2);  
       * NonBlocking executes a Host command and returns
       * to the Form, allowing PL/SQL to continue at the same time that
       * the command is running on the client.
       * The process id is returned so that you can:
       * 1) Get the Return code from the Process once it's finished
       * 2) Get the console output and error output
       * 3) Kill the Process you started
       * NOTE: It is important to call Release_Process(processId) when
       * You have finished with this process ID - this will release
       * resources in the client (but will not kill the program that
       * you started - use Terminate_Process() for that)
      FUNCTION  NonBlocking(cmd in VARCHAR2)return PROCESS_ID;
       * The Procedure version of NonBlocking executes a Host command
       * and returns to the Form, allowing PL/SQL to continue at the
       * same time that the command is running on the client.
       * In this case the process id is not returned and the client
       * side objects are automatically cleaned up for you.
      PROCEDURE NonBlocking(cmd in VARCHAR2);
       * NonBlocking_With_Callback executes a Host command and returns
       * to the Form, allowing PL/SQL to continue at the same time that
       * the command is running on the client.
       * The difference between this call and NonBlocking is that you
       * can supply the name of a User Defined trigger which WebUtil
       * will automatically call as soon as the process you've started
       * has ended.
       * The process id is returned so that you can:
       * 1) Get the Return code from the Process once it's finished
       * 2) Get the console output and error output
       * 3) Kill the Process you started
       * NOTE: It is important to call Release_Process(processId) when
       * You have finished with this process ID - this will release
       * resources in the client (but will not kill the program that
       * you started - use Terminate_Process() for that)
       * Only call ReleaseProcess in this case *After* the callback
       * trigger has been called.
      FUNCTION  NonBlocking_With_Callback(cmd in VARCHAR2, callbackTrigger in VARCHAR2)return PROCESS_ID;
       * Given a Valid process id that you've gotten from
       * NonBlocking() or NonBlockingWithCallback() you can terminate
       * the client program that you are running.
      PROCEDURE Terminate_Process(process in PROCESS_ID);
       * Get the return code from a given process
      FUNCTION  Get_Return_Code(process in PROCESS_ID) return PLS_INTEGER;
       * Get the console output from a given process
      FUNCTION  Get_Standard_Output(process in PROCESS_ID) return OUTPUT_ARRAY;
       * Get the error output from a given process
      FUNCTION  Get_Standard_Error(process in PROCESS_ID) return OUTPUT_ARRAY;
       * Clean up the resources allocated to a particular Process
       * on the client
      PROCEDURE Release_Process(process in out PROCESS_ID); 
       * Get the ID of the process that has just finished.
       * This call is only valid for use in a callback trigger
       * that has been set up and called through NonBlockingWithCallback()
      FUNCTION  Get_Callback_Process return PROCESS_ID; 
       * Test to see if this Process ID is null
      FUNCTION  ID_NULL(process PROCESS_ID) return BOOLEAN;
       * Test to see if two Process IDs represent the same process
      FUNCTION  EQUALS(process_1 PROCESS_ID, process_2 PROCESS_ID) return BOOLEAN; 
    END WEBUTIL_HOST;Francois

  • Problems with Webutil Client_Host

    Hi,
    We are working on Forms10g on Win XP Environment. I have installed Webutil on m/c. On When Button Pressed trigger I am trying to use Client_Host command to execute a batch file. Upon hitting the button it displays message saying " Please Acknowledge " and then it displays Error Message " 40735:WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-06503". Any help in this regard is highly appreciated.
    Regards

    ORA-06503: PL/SQL: Function returned without value
    Cause: A call to a PL/SQL function completed, but no RETURN statement
    was executed.
    Just a wild guess, but maybe this will help:
    DECLARE
    pid WEBUTIL_HOST.PROCESS_ID;
    BEGIN
    pid := WEBUTIL_HOST.NONBLOCKING_WITH_CALLBACK('CMD /C NOTEPAD '||fname,'HOST_CALLBACK');
    END;

  • Update Forms after word document is saved

    Hi,
    I am opening word doc using Webutil, now I want to update the forms when the user saves that document, and also pass the focus back to the application
    How can this be achieved?
    Cheers
    Prasad.

    Ok, I figured out from Webutil doc, how to use NonBlocking_With_Callback..
    Now the problem is the call_back trigger works fine when I invoke a txt document via notepad but not fordoc file
    This is for Notepad:
    V_PROCESS_ID := WebUtil_Host.NonBlocking_With_Callback('NOTEPAD '||C:\Test.txt, 'CALL_BACK');
    This works absolutely fine,it opens the txt file and my code in Call_Back trigger gets fired when I close the 'Notepad Application'
    But when I want to open word doc I cannot use above code. so I have to use
    v_cmd := 'cmd /c C:\Test.doc';
    V_PROCESS_ID := WebUtil_Host.NonBlocking_With_Callback(v_cmd , 'CALL_BACK');
    This works fine upto opening the document, but also immediately fires the code in Call_Back trigger not waiting for the 'Word Application' to be closed.
    Is there a way to get around this???

  • Forms 10g, SqlLoader and client_host

    Hi,
    I am starting Sql Loader from Forms 10g by using client_host(sqlldr.exe userid=..). The Sql Loader works fine, data is loaded to ORACLE tables but the application fails to go back to the Forms code and execute the rest. I have also tried to call a batch file by using client_host but the problem persists, the SqlLoader works fine but the rest of the forms code is not run.
    Thanks for suggestions,
    Deniz

    As said that would be exactly for that purpose. When you call applications in blocking mode which prevents the forms applet from sending a heartbeat for a certain amount of time the forms runtime will assume the forms applet is dead and will exit. nonblocking_with_callback will return control immediately and call a user defined trigger after the application has ended. Just create a user defined trigger with the code you want to execute after SQL*Loader is finished. Pass the name of that trigger to non_blocking_with_callback, and your problem should vanish ;)
    cheers

  • Problem using CLIENT_HOST from webforms.

    Greetings,
    I am trying to use CLIENT_HOST to open up ie and display an .htm page. When the form gets to the client_host call it displays a Please Acknowledge message, I click okay then shows an error FRM-40735 WHEN-MOUSE-DOUBLECLICK trigger raised unhandled condition exception ORA-06503. This exception says a function failed to return a value. I used messages to walk through the form so I know the error pops when the client_host is issued. I have tried moving several incarnations of the call listed below. I've searched several forums but although I saw several similar threads could not find one that outlined the problem or found a solution. Any direction or help would be greatly appreciated.
    DECLARE
         file_loc VARCHAR2(100);
         pid WEBUTIL_HOST.PROCESS_ID;
    BEGIN
         file_loc := '''cmd /c START "C:\Program Files\Internet Explorer\iexplore.exe" "K:\COMMON\ITS\RPM.htm"''';
    -- CLIENT_HOST('cmd /c START "C:\Program Files\Internet Explorer\iexplore.exe" ');
    -- CLIENT_HOST('cmd /c START C:\Program Files\Internet Explorer\iexplore.exe ');
    message('file_loc set');
    message('file_loc set');
    CLIENT_HOST(file_loc);
    -- pid := WEBUTIL_HOST.NONBLOCKING_WITH_CALLBACK('CMD /C START "C:\Program Files\Internet Explorer\iexplore.exe" '||file_loc,'HOST_CALLBACK');
    END;
    The lines commented out are some of the things I have tried that did not work. Also the string I am setting file_loc to works on the cmd line.
    Thanks for any help provided, and Happy Thanksgiving!
    Andrew

    Thanks for the suggestion, that was a variant I hadn't tried but same result. Please Acknowledge pop up then an ora-06503.
    Interestingly this time I repeated the action without closing the test form first and got a WebUtil error.
    WebUtil Error: oracle.forms.webutil.host.Host bean not found. WEBUTIL_HOST.Execute will not work. I will not scour forums for this error as well, but perhaps a library isn't attached correctly? I added the webutil library and it seemed to find it and compile fine. I did remove the path when attaching.
    If anyone understands the root cause of these or has found a solution I'd greatly appreciate the help. Thanks!

  • Thank You - WebUtil

    Duncan,
    First I would like to say Thanks, for you and your team for developing webutil, it is a blessing in disguise for me. I have been trying to figure out how to create a web form that will allow the user to ftp a file to our file server. After beating my head with trying different ways to accomplish a form that would be very user friendly while not having the server hosed down via memory. Taking time to go to the June conference and learning about webutil, well let's just say - webutil has made it possible. So, many, many thanks!
    Of course, there is a couple questions for all of the WEBUTIL gurus:
    Is it possible to show the progress bar while the file is being ftp'd? I am using client_host to acitvate the ftp command.
    Is their a way to hide/minimize the windows cmd box? I see the NO_SCREEN option isn't valid per doc.
    To validate the file transfer was successfully, I get the filesize from the client and once the file is ftp'd I will grab the filesize on the server. Is there somekind of call/proc that will let me know my host command was successful?
    Thanks,
    Mary Santry

    1) Progress Bar - if you make the host asynchronous with callback you can at least show some sort of Working indicator - I don't think you can do a progress bar as such as that would need communication between the upload program and the form. It's possible to do but not with WebUtil - you'd need a bespoke FTP bean for that
    2)You can try calling a .PIF file which starts the comd shell minimised
    3) Use WEBUTIL_HOST. NonBlocking_With_Callback() as I suggested for (1). Then when the host cammand finishes a trigger will be called in the form and you can use the GET_RETURN_CODE and GET_STANDARD_ERRROR / OUTPUT functions to check the status of the job.

Maybe you are looking for