Protheus Scheduler
Distinguishes scheduling from the routine doing the work.
Overview
TOTVS describes Manager for generation/queue, Agent for distribution and Execute for invoking the routine; Execute consumes a license during execution. Schedule controls timing, while routine code determines memory/performance. Verify company, branch, parameters, identity, recurrence and monitoring for the installed scheduler generation. Plan overlapping/repeated runs, cancellation and recovery without reopening a Schedule-provided environment. The example illustrates memory-only deduplication and creates no scheduled task. (Sources: refs. 1–2.)
Commented example
#Include "Protheus.ch"
User Function Ed642()
Local aCompleted := {}
Local cKey := "COMPANY_BRANCH_PROCESS_20261027"
// Local example: neither distributed locking nor persistent tracking.
If AScan(aCompleted,cKey) == 0
AAdd(aCompleted,cKey)
EndIf
ConOut(Len(aCompleted))
Return NilLocal list with one item. Real retries need persistent tracking and concurrency coordination. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- Use Schedule-compatible routines and monitor failures. Do not generalize Workflow P10 setup to current schedulers.
- Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.