Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Schedule a Procedure

I have a need to 'modernise' an old process in OI (if possible)
The TL;DR is that I have a stored OI procedure that I want to run periodically (lets say every 15m, 24/7) to process something.
I would like that to be independant of having to have someone stay logged into the OI Application.

This was previously done on the site in question as a web interface (that has long since been deprecated in our 'new' WebApplication). That, however, required someone to always log into the server and make sure this browser page was loaded so that every x timeframe it would make the required OECGI request.

I am wondering if it is possible to get away from this and to somehow setup a Windows schedule to accomplish this?

Comments

  • Does this stored procedure require a UI or event context to run or is it written more as a service and can run stand-alone within an engine?
  • @DonBakke

    It is written as a service so no GUI. It will grab and process something from a external SQL database if entries are there. If not, no worries. If there are errors, they will output to a log file silently.
  • We have a number of sites that use the Windows Task Scheduler for similar purposes. If you want to use OpenInsight, you can create a custom user login or even an inherited application that does exactly what you want.

    A lightweight approach is to use the OEngineServer or the SRP Engine Server. Both have the ability to set a routine to be executed at specific intervals.
  • @DonBakke

    So you are suggesting that if I have the OEServer already running as a service (for web API calls) I could use that?
  • @Opto_Will - Yes. I haven't actually done this with OEngineServer but some of the relevant settings from eserver.cfg are:
    // time (in seconds) to check on idle engines (and to run 'timer proc', if any) IdleCheck=60 // Process to run for mode -1,0,2 at engine startup StartupProc= // Process to run for mode -1,0,2 at engine shutdown ShutdownProc= // Process to run for mode -1,0,2 at 'idle check' TimerProc=
  • @DonBakke.

    I have only ever passed HTML/JSON tvia IIS through to the service for the HTTP Framework to process.
    Looks like I might have to do some reading!
  • I decided to do a little R&D on this as I was curious myself. I learned a few things. Much credit goes to Bryan Shumsky who offered to guide me on various issue.

    First, those settings I previously mentioned work, but they are directly tied to stateless engines that spin up from other calls (such as OECGI calls). Thus, they will not engage simply by starting the OEngineServer.

    I found out that there are other settings better suited to your needs:
    SystemMonitorTime= SystemMonitor=

    SystemMonitorTime works like IdleCheck. Just put the number of seconds you want to the procedure(s) to get called periodically.

    SystemMonitor requires the following syntax:

    < proc name >,< app name >,< user name >,< password >

    If you want more than one procedure, use the above syntax but separate with a semicolon (;).

    One caveat: SystemMonitor relies on phantom processes which spin up their own engines and get shutdown automatically. They have no connection to your web request engines. Also, you cannot put a debug statement in any code. It will cause the process to fail because it is incapable of displaying the debugger.
  • @DonBakke

    That is fantastic! That sounds exactly like what I want.

    I can live with those caveats. It just means I have to write in a little more logging and error trapping than I inherited.
    I am guessing these engines have licence implications?

    Much appreciated the Above and Beyond as always Don!
  • @Opto_Will - I am rather certain these engines will use a license count when engaged, which is why I am sure they terminate ASAP.
  • @DonBakke

    Yes, that would be my assumption too from a logical point of view.

  • @DonBakke

    I have done some testing and your suugesstion will work quite nicely for what I need.

    Much appreciated!
  • Did you have issues with any OI commands that you could not use?
    Maybe hidden gui messages.
  • I'm sure the normal issues that headless engines face are relevant here. Anything that requires event context would not work as expected.
  • I cant see anything and I assume the http_service stuff does not.
Sign In or Register to comment.