Page 1 of 1

Kill job after closing navigator

Posted: Wed Jun 18, 2014 5:20 am
by infgge00
Hi! I would like to know, how to kill the current job when I launch profound session and I close navigator.

At the moment, the current process is waiting for a response and I would like to kill then after closing navigator.

Sorry for my English!!

Re: Kill job after closing navigator

Posted: Wed Jun 18, 2014 9:12 am
by dieter
Hi,
what do you mean by "closing navigator"? Do you mean "closing the emulation"? I think if you close the profound session there should not be left an interactive session job.

Dieter

Re: Kill job after closing navigator

Posted: Wed Jun 18, 2014 9:16 am
by Scott Klement
You can end your Rich Display file application simply by ending your RPG program, as normal. (*INLR = *ON, Return.)

However, i'm not sure how to tell when the user launches navigator. Is it launched from within your PUI screen? Then you could potentially do it with some JavaScript... but, if it's just launched independently, I don't see how you can tell your program that it has been launched

Re: Kill job after closing navigator

Posted: Wed Jun 18, 2014 11:16 am
by infgge00
I´ve explained too bad.

When I start a profound session and it produces and exception not handled, There is a message waiting for response in the job.
well, I would like to kill this instance when I close the navigator (Chrome in this case), because the final users are used to close navigator when an exception occurs, but the thread is waiting for response the error message.

I must take some English classes, I know haha. Thanks for your replies!!

Re: Kill job after closing navigator

Posted: Wed Jun 18, 2014 11:57 am
by Scott Klement
Oh, I see.. when an exception occurs, you want the job to end when you close the web browser.

Where I live, we don't call web browsers "navigator", so I didn't understand what you meant. I thought you meant IBM's tools (IBM i Navigator)

That aside, your English is easy to understand.

Re: Kill job after closing navigator

Posted: Wed Jun 18, 2014 12:24 pm
by infgge00
That´s it Scott!! I want to end job when I close the web browser even though an exception occurs.

Re: Kill job after closing navigator

Posted: Wed Jun 18, 2014 1:55 pm
by Scott Klement
No, there's no way (that I know of) for Profound UI to automatically end these jobs.

So, I would suggest writing a program (can be an RPG, or maybe even a CL) that monitors for all exceptions, and when it receives an exception dumps the job log, etc. Maybe sends a message, or an e-mail, to whomever is in charge of maintaining your application.

That way, if an error occurs, it'll always be caught. There should be no need for Profound UI to handle it.

For example:

Code: Select all

    CALL PGM(THE-REAL-PGM)
   MONMSG MSGID(CPF0000) EXEC(DO)
     DSPJOBLOG OUTPUT(*PRINT)
     SNDMSG MSG('Error calling THEPGM') TOUSR(QSYSOPR)
  ENDDO
Have your PUI session call a program like that.