Class MetaWorkflowRunController

java.lang.Object
com.axelor.meta.web.MetaWorkflowRunController

public class MetaWorkflowRunController extends Object
The actions behind the run viewer.

A run points at its record polymorphically (model + recordId), so — exactly as MetaWorkflowTaskController does — every action here re-checks read access on the record itself rather than trusting what the caller sent. The client picks the run id; the server decides whether that run's record may be seen at all.

Two doors lead here and both come through these checks: the record form, which asks what has run on the record in front of it, and an administrator opening a run directly by id from the run list. One view, two ways in, one set of rules.

  • Constructor Details

    • MetaWorkflowRunController

      public MetaWorkflowRunController()
  • Method Details

    • runsForRecord

      public void runsForRecord(ActionRequest request, ActionResponse response)
      Every run recorded for one record, newest first — what the run selector lists.

      An unreadable or absent record yields an empty list rather than an error: this feeds a picker, and a picker that throws tells the caller something a picker should not.

    • runCountForRecord

      public void runCountForRecord(ActionRequest request, ActionResponse response)
      How many runs one record has, which is what decides whether the form shows the button at all, and whether a background node on it has yet to finish, which the button shows as pending.

      An unreadable record counts zero rather than refusing: refusing would say that runs exist.

    • graphAndOverlay

      public void graphAndOverlay(ActionRequest request, ActionResponse response)
      One run, drawn: the definition's shape and everywhere the run has been or is stopped.

      The run id comes from the client, so the record behind the resolved run is re-checked before anything is returned — a missing run and an unreadable one are the same empty answer. What detail comes back is decided here too, from the caller's own rights: see adminTier().

    • openViewer

      public void openViewer(ActionRequest request, ActionResponse response)
      Open the viewer for a record — the record form's toolbar button.

      No run id: the view asks for the record's runs and offers them, because from a record the question is "what has happened here", not "show me run 4411".

    • openRun

      public void openRun(ActionRequest request, ActionResponse response)
      Open the viewer on one named run — the other door.

      Reached from the run list and, later, the operations console, where the run is what the administrator already has in front of them and the record is incidental. Same custom view, same access checks when it asks for its data; only the way in differs.

    • cancelRun

      public void cancelRun(ActionRequest request, ActionResponse response)
      Cancel one parked run from its form: the same teardown as the mover's Cancel, without going through the definition. Gated on the same right as the mover, write access to MetaWorkflow.

      Only a waiting run is taken; one an approver or a timer resumed in the meantime is reported rather than torn down mid-walk.