Problem/Motivation

A node's timeout deadline can be written two ways: a duration, measured from the moment the token parks, or an until, an absolute moment given as a literal date or as the name of a process variable.

The variable form resolves at park time, so the lookup is already dynamic, but the value is only as fresh as the last step that wrote it. A model whose deadline belongs to a live subject - a basket window, a hold, a reservation someone can extend - therefore has to put a variables step on every path that reaches the waiting step, purely so the deadline is true when it parks. The workflow ends up carrying steps that exist to keep a number current rather than to say anything about the process.

The second half of the problem is what happens when the subject moves its deadline after the token has parked. The token wakes at the moment it recorded, the timeout action finds nothing to do, and because an until is a single absolute moment the sweep does not re-arm it. The step is then parked with no deadline at all for the rest of its life: it has stopped observing the thing it was waiting on, and nothing says so.

Proposed resolution

Add a deadline provider plugin type, asked at park time with the instance, the token and the node, and answering a timestamp or nothing. The modeler's Deadline choice gains a third option beside Relative and Absolute, and a node names its provider under timeout as deadline: my_subject_deadline, beside the action it already names.

Because it is asked rather than read, it is also askable again: the sweep can re-arm a computed deadline, so a subject that moved its own gets a live deadline instead of none, and the one-shot behaviour above stops being something each consumer has to document its way around.

The variable form should stay. A genuinely static date, or one another step deliberately computed, is still best expressed as a variable; the plugin is for a deadline that belongs to a subject the run does not own.

Remaining tasks

  • The plugin type, its manager and attribute, and the branch in the deadline calculation.
  • Re-arming a computed deadline, which the sweep currently does only for a park-anchored duration.
  • The modeler form, and the schema for the new key.
  • Documentation and tests, including a deadline that moves after the token parks.

Issue fork orchestra-3615634

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mably created an issue. See original summary.

mably’s picture

Issue summary: View changes

  • mably committed 1df3c914 on 1.x
    feat: #3615634 Let a node's deadline be computed by a plugin, not only...
mably’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.