Focal Point
[SOLVED] Triggering job from maintain

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4117066766

March 06, 2014, 06:32 AM
Shankar
[SOLVED] Triggering job from maintain
Hi All,
I have a question regarding Maintain. Suppose, there is a button to Initiate a proc . The proc is written in FEX and this proc will call different Unix job and Stored proc to complete its job. This invoked proc takes around 1 hr to complete its processing. My question is, as this process is initiated from maintain form, Will my screen hang till the time of completion of called fex proc OR It will just trigger the proc in background and my maintain code will continue execution thereafter without any interruption?

If it hangs, Can you please let me know the workaround to trigger a fex file in background from maintain without waiting for its completion.

Thanks in advance.

Regards,
Anil

This message has been edited. Last edited by: <Kathryn Henning>,


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
March 06, 2014, 09:48 PM
Shankar
Can somebody reply to this pls?

Thanks.


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
March 07, 2014, 04:22 AM
Alan B
Anil
The best approach, maybe the only one, is to use an ajax request within the javascript and do not wait for a return code, allowing the function to finalise.
Otherwise a call to a trigger function or case will wait for the process to complete.


Alan.
WF 7.705/8.007
March 07, 2014, 04:59 AM
Shankar
Hi Alan,
Thanks for your reply.It would be great if you can give me a sample to call a AJAX request as suggested by you.
I am not aware of AJAX concept at all. This is something new for me and not sure how to proceed with this.

Best Regards,
Anil


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
March 07, 2014, 10:38 AM
Maintain Wizard
Shankar
If the procedure on the server can be run via a URL, you could try using a window.open command from a JS trigger. Basically

window.open(URL);

Where URL is the code string to kick off the procedure on the server. This will open another window, but processing on the current form will not have to wait for control to come back. I am also working on getting you an ajax example, but a simple JavaScript trigger to a URL may be all you need.

Mark
March 10, 2014, 11:01 AM
Maintain Wizard
Maintain can use ajax to accomplish what you want. Ajax allows maintain to
perform an event and not get anything back from it. Here is what you need to
do.

1) Create an HTML object on your form and place this code in it:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js">
This will allow the Maintain form to access the ajax libraries.

2) Now create an event on a button with a JavaScript trigger with this code:

$.ajax({
type: 'GET',
url: 'http://localhost:8080/ibi_apps/WFServlet',
data: 'IBIF_ex=test&IBIAPP_app=test2&RND=' + new Date() });

Note that the URL should point to your server. Here test is the name of the
procedure and test2 is the project where test resides. Please change yours
to the proper path and file. Please note that nothing will happen on the form.
March 11, 2014, 03:45 AM
Shankar
Hi Mark,
When I place a html object with the code to include AJAX library, it misplaces all the components on the form. i.e, All of them changes their intended positions when i run the application. One of the Menu item on the form completely get removed from the form.

Please let me know know the reason for this misbehaviour. Is this some known issue?

Thanks,
Anil


WF 8.1.04,Windows 7,
DataBase: Oracle 11g,Output :Excel,PDF,HTML
March 11, 2014, 07:35 AM
Maintain Wizard
Hi Anil
There needs to be a closing
 </script>  
at the end of the HTML line. Looks like focalpoint took it off. The line should be:

 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> 


Mark