Schedule email from FactoryPMI Gateway

With our network architecture, the FactoryPMI Gateway has access to the corporate email server. The FactorySQL database server does not have access to the email server.

I would like to have an email sent at 7:00 AM every day and the contents of that email should be the current value of some items being stored in the FactorySQL database.

I understand that email can be sent using the “sendEmail” function in a FactoryPMI client but we won’t necessarily have a FactoryPMI client running all the time. I also understand that email can be sent from the FactorySQL dataabse server but that server doesn’t have network access to the email server. Do you have any suggestions?

Thank you.

Larry,
I understand your architecture situation. Normally, FactorySQL Alerts are used to send emails. Would your IT department open up a single port (SMTP, port 25) from the FactorySQL machine to the email server?

The best you could do right now with FactoryPMI is to have the client send the daily email. Use a timer global event script to run the code, then a DB SQLTag of a datetime type to record when you last sent the email. That way any open client would send it, but you shouldn’t have a problem with concurrency - especially if your timer is set to check slowly (every 10 minutes or so).

Having a constantly running Jython engine in the Gateway is a feature request that has been around for awhile. I’ll note your interest. Unfortunately the only practical application that I can come up with is scheduling periodic emails or printouts - both of which can be accomplished through the client, as long as it’s logged in, without any user interaction. I like the idea in theory, but it doesn’t seem to be that practical since FactorySQL handles all the alarming and most always running periodic tasks.

Perhaps an easy implementation may be an autologin configuration based on IP address (localhost) and a setting for the service (Gateway) to launch the client locally if it’s not open. An instance of the client may be the best “Jython engine”. I’ll see what the developers think.

Nathan,

Thank you for the information. For now we’ll probably just try to keep a client running on the FactoryPMI gateway.

Did you follow what I was saying about ensuring that the email gets sent once? Alternatively, you could do a check against the computer name or IP address of that client (the Gateway).

Nathan,

I understand. I was planning to conditionally call the email function based on IP address or maybe even develop a separate FactoryPMI application that we would only run on the FactoryPMI gateway.

Thank you.

Cool! I like the idea of a separate application because you could set it up to auto login, then put a shortcut in the startup folder. I recommend creating an HTTP shortcut (Windows->New Shortcut) rather than a Java Web Start shortcut for this application because it tends to be more robust.

I would also recommend using a startup script that verifies that the client for this particular project is your server. Let me know if you would like assistance with that.

Also, you could hide the email-sending project on the gateway by editing the project in the gateway settings and selecting “Hide from launch page”.

That way you wouldn’t be tempting people to launch the project and test your concurrency checking :slight_smile:

Regards,