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]
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]