Batch process from GUI application?

Idp

New Member
Hi,
I need some advise on how best to initiate a background process from a GUI application. This process must start same time when the user log into the GUI application and do some checks in the background every 30 minutes and then sleeps. The process must stop only when the user logs out of the application. Any ideas ?
Ian du P.
 
Assuming you are on Windows and a modern version of Progress (you didn't say), the easiest way is to use a Timer OCX (eg. PSTimer), and run your background process persistently when you launch your application.

Then every 30 minutes (you can set your timer to fire at this rate):

RUN StuffToCheck IN BackgroundProcess.p.

The only thing to bear in mind is that StuffToCheck will have control of the thread for the duration, so if it is a lengthy procedure time-wise, you will need to work around that if you do not want the user to notice anything.
 
Start a second progress session in background
Code:
OS-COMMAND NO-WAIT VALUE(PATH/prowin32.exe -b -p prog)
and connect to the GUI application with socket or named pipe
 
Hi buyeye,

What i'm trying to achive is a background process for user event notification. Thus the process will check if popup or email messages are availible for a user every 30 minutes, and then display the popup or email the message.
Also, what will happen to the batch process when the user exit the application ?
 
Hi buyeye,

What i'm trying to achive is a background process for user event notification. Thus the process will check if popup or email messages are availible for a user every 30 minutes, and then display the popup or email the message.
Also, what will happen to the batch process when the user exit the application ?

You still haven't specified your environment.

If all you want to do is 'check for messages', my suggestion above will do exactly that very simply, with out the need to batch out to a seperate session.

If your client process is not on Windows, or you need to run a seperate thread for performance reasons (eg. because the email takes a couple of seconds to send?), I don't think it makes sense to have a seperate 'check emails' session for each user. It would be better to have a single server-side process not associated with any user, which runs all the time, emailing messages as appropriate.
 
Using Progress 91D, the db is running on linux with windows clients. It does make sence to have the email sending process running as batch on the server, but the popup notification needs to happen on client side, seperate from whichever window the user may be using. Hope this makes sense ?
 
Using Progress 91D, the db is running on linux with windows clients. It does make sence to have the email sending process running as batch on the server, but the popup notification needs to happen on client side, seperate from whichever window the user may be using. Hope this makes sense ?

Absolutely.

We have a very similar situation (Windows/Unix/9.1D), with one proviso: Appserver (do you use that?).

Anyway, we use a combination of a Timed process on the client side checking for and displaying popup messages, and a server process sending emails.

The only thing I don't understand from the above is the 'seperate from the Window' bit:

Is the popup supposed to be a seperate windows utility or is a simple dialog box ok?

You seem to be implying the popup message has to be seperate from your Client Progress application, which I'm confused by, although maybe you just mean the message has to be displayed in a seperate window.

Anway, if a dialog box is allowed, the process to Check for Messages client side could be:

1. Drop the PSTimer OCX onto your main app window:
2. Set the interval to 30 minutes (I think the units are in milliseconds)
3. In the Tick Event include something along the lines of:

IF AnyMessages(UserID) THEN RUN DisplayMessages.w which retrieves and displays the message(s) in a dialog box.

This is a simplification off the top of my head - I'm not looking at our actual code, but I'm sure you get the idea.

HTH
 
A quick proof of concept would be to set the interval to 20 seconds, and stick a Message Box, or unconditionally RUN an empty Dialog Box in the tick event, then open a child window in your app between ticks.
 
Back
Top