Execute 4gl procedure on schedule

I grappled with this issue for months, and was dumbfounded that Epicor has not provided a way to kick off 4GL code on a schedule!

Then I tripped over one possible solution, not ideal (how few are!) but it DOES support the E9 environmental variables.

Here goes ...

When you run a trace in Epicor you see all of those calls to "...BO.ReportMonitor" GetrowsKeepIdletime?

You can attach a directive to that BO method. It will be invoked once a minute or so. From this you can call a 4GL procedure and implement any sort of recurring scheduled tasks you desire. You can tweak the frequency of the calls by modifying the System Monitor Configuration and setting the Normal to the invocation frequency (in milliseconds). I set mine to 120000 to kick off every 2 minutes and use it to check for scanned cartons from our conveyor system.

I attach to the Post-Processing (so as to be outside of any transaction). Here is the ABL Action in "Execute code below":
/* kick off batch job process */
run pny/batchjobs.p (input CUR-COMP, input "TEST") no-error.

Problem is that this would execute for EVERY user. So I added a condition that the method is called by a specific user. For testing I use myself but for production this would be "Administrator" or "Manager" and run in a session on the server.

I saved pny/batchjobs.p into epicor905/pny. It's short ...

/* pny/batchjobs.p - run batch jobs
12.08.2011 CAH: Initial write.
- triggered from reportmonitor getrowskeepidletime ... roughly every 30 seconds.
*/
{core/nonBOBase.i}
{pny/standard.i}

def input param pCo as char no-undo.
def input param pOpt as char no-undo. /* test|prod */

/* Mainline */
if top-debug then run pny/debugmsg.p ("BOJ - Options: " + pOpt).

/* put the batch jobs here */
run pny/test_accusort.p (input "test") no-error.

if top-debug then run pny/debugmsg.p ("EOJ").

run clear-rv.ip.
return.

Pny/Test_accusort.p does my scanner processing: checks for carton scans, full pallets, prints pallet header sheets, marks shipments complete, releases lanes, completes and releases waves, etc.

As we need other "batch" functionality I'll simply add the calls into the "Mainline".
If we need something fancier as to scheduling, we will have to add that, perhaps using UDXX tables to track last run time, or as a scheduling queue, etc.
But for now we are limping, and processing scanner output every 2 minutes.

Hope this helps,
Chris

Christopher Heins
Sr. Progress Programmer/Analyst
[cid:image001.png@01CCED56.8A394080]
Desk# 973-560-5370
Cell# 908-256-3662
Skype: cheins.nj
cheins@...<mailto:cheins@...>


________________________________
NOT INTENDED AS A SUBSTITUTE FOR A WRITING
NOTHING IN THIS E-MAIL, IN ANY E-MAIL THREAD OF WHICH IT MAY BE A PART, OR IN ANY ATTACHMENTS THERETO, SHALL CONSTITUTE A BINDING CONTRACT, OR ANY CONTRACTUAL OBLIGATION BY PNY, OR ANY INTENT TO ENTER INTO ANY BINDING OBLIGATIONS, NOTWITHSTANDING ANY ENACTMENT OF THE UNIFORM ELECTRONIC TRANSACTIONS ACT, THE FEDERAL E-SIGN ACT, OR ANY OTHER STATE OR FEDERAL LAW OF SIMILAR SUBSTANCE OR EFFECT. THIS EMAIL MESSAGE, ITS CONTENTS AND ATTACHMENTS ARE NOT INTENDED TO REPRESENT AN OFFER OR ACCEPTANCE OF AN OFFER TO ENTER INTO A CONTRACT. NOTHING IN THIS E-MAIL, IN ANY E-MAIL THREAD OF WHICH IT MAY BE A PART, OR IN ANY ATTACHMENTS THERETO SHALL ALTER THIS DISCLAIMER.

This e-mail message from PNY Technologies, Inc. is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.


[Non-text portions of this message have been removed]
I have a 4gl procedure that I need to run before our nightly global and MRP run.
So far, I've looked into attaching it to some other scheduled application and trying to schedule the procedure through the system agent using process set maintenance.

The processes (such as MRP / global ) do not appear to trigger BPM's in the same fashion as most interactive applications.
The process set maintenance requires submittal of the application via an application. (which I don't have)

Does anyone have tips on how to run a procedure like a scheduled process? Thanks.
I have some 4GL code that is currently in a BPM that I would like to run on a schedule instead of triggering from a method.
I figured - convert to a procedure (ex. file.p ) and then schedule. The system agent doesn't appear to provide any way of executing a procedure (although there are embedded functions that can be scheduled)
I was next looking into using the window scheduler to run a bat file which would start up Progress and run the designated .p file.

Is anyone else doing this? If so, I would *love* to know how to get this done.
You can run it from the scheduler with mbpro, BUT you have to remove any
references to global variables or it won't work e.g. CUR-COMP
DCD-USERID, CUR-PLANT.

Here is an example we run:



mbpro /epicor/data/epicor905/mfgsys.db -p
ud/scripts/OrderDtl_Zero_UnitPrice.p



we are unix so you path to the db and the bpm might be different, but
this should work as long and your .p has no global variables.



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of jahatcher43
Sent: Thursday, February 16, 2012 3:20 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Execute 4gl procedure on schedule





I have some 4GL code that is currently in a BPM that I would like to run
on a schedule instead of triggering from a method.
I figured - convert to a procedure (ex. file.p ) and then schedule. The
system agent doesn't appear to provide any way of executing a procedure
(although there are embedded functions that can be scheduled)
I was next looking into using the window scheduler to run a bat file
which would start up Progress and run the designated .p file.

Is anyone else doing this? If so, I would *love* to know how to get this
done.





[Non-text portions of this message have been removed]
Hi Mike,



Thanks for the response. I was using prowin32 instead of mbpro. Did
you have any issues with environment variables?



I'm trying to run an update using lib/updatetablebuffer.p and am getting
a file not found. I'm using the -pf option with mbpro. The mfgys.ini
file for the database includes the path for the updatetablebuffer.p
file.



I'm starting to wonder if updating is not supported. I'm on Vantage 8.




John A. Hatcher

Manager of IS

Versa Products Co., Inc.

(201) 843-2400 x4148

(201) 843-2931 fax



[Non-text portions of this message have been removed]