Metadata-Version: 2.5
Name: trytond_score_timer
Version: 8.0.0.2
Summary: Score Workflow Engine — Timers, Deadlines and SLA
Author: Clemens Hupka
Maintainer-email: Clemens Hupka <clemens.hupka@backend.at>
License-Expression: GPL-3.0-or-later
License-File: COPYRIGHT
License-File: LICENSE
Keywords: deadline,engine,score,sla,timer,tryton,workflow
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Plugins
Classifier: Framework :: Tryton
Classifier: Topic :: Office/Business
Requires-Python: >=3.10
Requires-Dist: trytond-score<8.1,>=8.0
Requires-Dist: trytond<8.1,>=8.0
Provides-Extra: test
Description-Content-Type: text/x-rst

Score Timer Module
==================

The ``score_timer`` module adds time as a first-class trigger of the
``score`` workflow engine.  The engine moves a run when a caller asks it
to - a user, an event, a deferred firing - and nothing of that speaks of
time; this module supplies the missing caller, a timer that fires a
transition, or records that a moment passed, when the moment a
definition asked for arrives.

A timer watches one running instance and carries the moment it is due at
and the transition it fires.  Five kinds are supported.  A *deadline*
fires its transition once the moment passes while the run still stands
in the state the transition goes from; a *scheduled* timer fires it at a
calendar date; a *timeout* fires the transition that cancels or escalates
a stalled run; a *reminder* notifies, may name no transition at all and
may repeat; and an *SLA* timer records the breach of a service level in
the history of the run even when it fires no transition.

The state a timer guards is the state its transition goes from.  A timer
whose run left that state is cancelled rather than fired, because what it
was armed for is over; the cancellation is lazy, so nothing of the engine
has to be extended to keep a timer in line with a state the engine writes
elsewhere.

Nothing of the module starts a thread.  The timers are processed by a job
of ``ir.cron``, which the module ships deactivated, so that a deployment
enables and times it itself.  The job reads the pending timers that are
due, claims each of them in the statement that reads it - so two cron
workers cannot fire the same timer twice - and performs it in a savepoint
of the transaction of the run, so that a timer which cannot be performed
does not hold the timers that follow it.  Every firing is recorded in the
history of the instance with the origin ``cron``, on top of the row the
engine writes for the transition itself.

The batch a run processes is a setting of the configuration of the engine
(``timer_batch``).  The base module stays unaware of this one: it does
not depend on it, a deployment that does not install it never processes a
timer, and the timers a definition declares are read by a deployment that
installs this module.
