Metadata-Version: 2.5
Name: trytond_score_monitor
Version: 8.0.0.2
Summary: Score Workflow Engine — Operations Console
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: engine,monitor,operations,recovery,score,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-company<8.1,>=8.0
Requires-Dist: trytond-score<8.1,>=8.0
Requires-Dist: trytond<8.1,>=8.0
Provides-Extra: test
Requires-Dist: trytond-score-task<8.1,>=8.0; extra == 'test'
Requires-Dist: trytond-score-timer<8.1,>=8.0; extra == 'test'
Description-Content-Type: text/x-rst

Score Monitor Module
====================

The ``score_monitor`` module is the operations console of a deployment
that runs the ``score`` workflow engine: it answers the question an
operator opens a console with - is anything wrong right now - and it
offers the tools that fix what it shows.

The engine moves a run and records what it did, but the runtime of a
whole deployment is not a screen: the runs that stopped moving are a
flag a scheduled job writes on the instances, the work the engine has
not performed is a queue of the core, and a run that a guard blocks is a
run that sits still without saying so.  This module is the reading of
all of that in one place, and the four decisions an operator may take
about it - cancel a run that goes nowhere, force a transition the guards
block, replay a deferred item, or replay a failed timer.

Every figure is a query.  The models that carry them declare a
``table_query`` - the idiom of the reporting models of the core - so
trytond reads through them and refuses to write to them, and no counter
is kept beside the runtime that a firing would have to keep in step.
The console is read-only by construction rather than by a rule an
administrator could relax.

The health of a deployment is one line per category.  The counts are
read one category per line rather than one column per count, so that a
client lists them, a client orders them, and a category a submodule adds
is one more line rather than one more column; the lines are the branches
of a ``UNION`` gathered through a common table expression.

A recovery is a decision, and a decision is explained.  Every tool takes
a reason, refuses an empty one, and writes it where the decision is read
afterwards: on the history row of a cancellation, or in the comment of
the firing a forced transition performs.  A bulk recovery runs each item
in a savepoint of the caller's transaction, so that an item the data
refuses does not take the items that follow it with it, and it reports
what it did and what it did not.

``score_task`` and ``score_timer`` are optional dependencies.  The runs
that wait for a person are read from the work items of ``score_task``,
and the timers of a deployment from ``score_timer``, so the category and
the window that read them are registered and loaded only when those
modules are activated; a deployment that runs the engine without them
holds no such work and needs no such screen.
