Actions

The named packages of labels, reports, Logic actions and database rows a run emits at Start or at Completion, their commands, the marker mappings of a label, the columns of a database row, and how a procedure selects them.

View as Markdown

An action is a named package of paperwork a run emits: inside it, one command per emission, each saying what comes out (a label, a report, a run of a Logic action or a row in a factory database), when (at Start or at Completion), with which template of the station library, which Logic action or which database table and, at Completion, for which verdicts. A procedure selects whole actions, so a package written once serves every procedure that emits it, and correcting a command is one edit instead of one per procedure. Actions live under Process > Models > model > Setup > Actions. Creating them, removing them and editing an action's name, its commands and their mappings are all gated by the same Edit recipes & evaluations permission, and the pages say so ("Changing actions needs the “Edit recipes & evaluations” permission.").

The Actions folder

Selecting the Actions row opens a page unlike the other folders of Setup: a list of the model's actions beside the one picked in it, because an action is read against its siblings. The list's order is the order every procedure emits the actions in, so the row verbs move an action and never a command. The page loads the two station libraries (label templates and report layouts) to judge readiness; when one cannot be loaded, a banner says "Global label templates could not be loaded: …" or "Global reports could not be loaded: …".

Column What it shows
# The action's place in the list.
Name Editable in place, committed when you leave the cell. A blank name is refused with "An action needs an operational name."
Commands How many commands, then what they emit: "0 · None yet", or "2 · Label at Start, Label and report at Completion", with "Logic action at Completion" (or "2 Logic actions at Start") for the Logic action commands and "Database row at Completion" (or "2 database rows at Start") for the Database row commands. The tooltip lists them one per line, as Label at Completion · <template>, a Logic action command with the action's name, or "no Logic action" while none is picked, and a Database row command with <table> through <device>, or "no table" while none is picked.
State Ready, or Review when the action or any of its commands is short of something.
Row actions Move action up, Move action down, Remove action (danger ink; asks "Delete action": "This removes the action and its commands.").

The column beside the list is headed Action and shows the picked action's Name (editable here too), its Commands as read-only lines with a Ready / Review pill each ("The commands are edited on this action's own page in the column, in this order."), and a Needs review banner listing everything that is short. With no action, the list says "No actions. Add one when a procedure of this model should emit labels or reports, run Logic actions or write database rows."; with none picked, the column says "Select an action to read what it emits. Its commands are edited on its own page in the column."

Command What it does Greyed when (situation) Not drawn when (role)
Action (detail bar, folder selected; right-click Add action) Adds Action <n> (the first number no action of the model already uses), empty, at the end of the list, and picks it in the column, scrolled into view. Any unit holds a run, or the runtime is stopped. Without Edit recipes & evaluations.
Move up / Move down / Remove action (row actions) Reorder or delete. Without Manage process, under the engineering lock, or while the runtime is stopped (a press reports the reason in the action feed). Always drawn.

The action's page

Selecting an action in the tree opens it: the header with the action's name and a pill counting its commands, the permission and library banners, an Action card with the Name field (committed on blur; blank refused), and the Commands list beside the command picked in it.

Command What it does Greyed when (situation) Not drawn when (role)
Command (detail bar, action selected; right-click Add command) Adds a command born as a Label at Completion for OK runs with no template yet, at the end of the list, and picks it in the column, scrolled into view. Any unit holds a run, or the runtime is stopped. Without Edit recipes & evaluations.
Remove action (danger cluster; right-click; the X on the folder page's card) Deletes the action and its commands after "Delete action". Every procedure that selected it stops emitting it. Same. Without Edit recipes & evaluations.

The Commands list

Column What it shows
# The command's place in the action, which is its emission order inside the action.
Emits Label, Report, Logic action or Database row.
Trigger Start or Completion.
Template or action One picker over four lists: a label row offers the label templates ("(select template)"), a report row the report layouts ("(select report)"), a Logic action row the station's Logic actions ("(select Logic action)"), each under its folders as the Logic tree files it, a disabled one marked "<name> (disabled)", and a database row the Connector's Database devices ("(select Database device)"). A reference the list no longer holds keeps its place, disabled, as "Missing template · <id>", "Missing report · <id>", "Missing Logic action · <id>" or "Missing device · <id>", so a degraded command does not read as an unconfigured one.
Verdicts "Not used at start" for a Start command; otherwise the ticked verdicts ("OK, NOK") or "None selected".
Markers "Not used by a report", "Not used by a Logic action"; for a label: "No template", "Template missing", "No commands" (the template has no printer commands yet), "Unreadable", "Fixed, no markers", or "<bound> of <total> bound"; for a database row, the columns that have a value: "No table" or "<n> of <total> columns".
State Ready or Review.
Row actions Move command up, Move command down, Remove command ("Delete command": "This removes the command from the action.").

With no command the list says "No commands. Add one when this action should emit a label or a report."; with none picked the column says "Select a command to edit all of it in one place. Add one from the bar above when this action should emit a label or a report."

The command in full

The column opens the picked command, headed Command <n> · <Kind> at <Trigger>. It shows only the fields the chosen kind owns.

Field What it is Values / default Effect (the line under the field)
Emits What the command puts out. Label / Report / Logic action / Database row; Label at creation. "Prints a tag from a command template, on the queue the Unit picks for labels at this moment.", "Publishes the run's PDF from a report in the station library.", "Runs a Logic action of the station, on the Logic actions lane." or "Adds one row to a table of a factory database, through a Database device of the Connector." Changing the kind reseats the verdict filter on the new kind's default (Label: OK; Report, Logic action and Database row: every verdict).
Trigger At which point of a run it comes out. Start / Completion; Completion at creation. Label at Start: "Generated the moment the run starts, before any result exists."; label at Completion: "Generated when the run ends, for the terminal verdicts ticked below."; report at Start: "Published the moment the run starts, so the sections with nothing recorded yet are left out."; report at Completion: "Published when the run ends, for the terminal verdicts ticked below."; Logic action at Start: "Queued the moment the run starts. The run does not wait for it."; Logic action at Completion: "Runs once the run is saved, for the terminal verdicts ticked below, and reads the run that ended in LastRun."; database row at Start: "Written the moment the run starts, from the metadata it froze. The run does not wait for the database."; database row at Completion: "Written once the run is saved, for the terminal verdicts ticked below, from the run that ended. The run does not wait for the database."
Logic action (Logic action commands) The action of the station's Logic the command runs. "(select Logic action)" or an action; none at creation. Legend: "The Logic action this command runs. It is named by identity, so renaming the action keeps it here." Effect: "Choose an action: until then this command runs nothing.", "The referenced Logic action no longer exists: this command runs nothing.", "Runs <action> on the Logic actions lane." or "<action> is disabled: each time this command fires, the action refuses to run and records why."
Report (report commands) The layout of the station library the PDF is published with. "(select report)" or a layout; none at creation. "No PDF is published.", "The referenced report is not in the library.", "Publishes a PDF when a run starts." / "… when a run finishes.", with "and sends it to this command's printer queue on the Unit." when printing is on.
Report printing: Print automatically (shown once a layout resolves) Whether the published PDF is also sent to the unit's report queue for this trigger. Off at creation. Legend: "The PDF is published either way, at this command's point of the run. Printing decides only whether it is also sent to a queue." On: "The PDF also goes to this command's printer queue on the Unit. Pick that queue on the Printers screen." Off: "The PDF is published to the reports folder and goes no further."
Report copy: Keep it in the run (shown once a layout resolves) Whether the finished PDF is stored inside the run file, so a resend reissues those exact bytes after the layout is edited or deleted. Off at creation. Legend: "What the run keeps of the document, which is what a resend submits later." On: "Each run carries the finished PDF, a few hundred KB, and a resend submits that exact document." Off: "Each run points at the published PDF, so a later render is what a resend submits."
Global template (label commands) The label template of the station library the command prints, whose markers it binds below. "(select template)" or a template; none at creation. Picking one creates a mapping row for every marker the template declares that the command does not map yet. "Choose a template: its markers are what this command fills in.", "The referenced template is no longer in the library.", "This template has no printer commands yet, so there is nothing to send.", "The markers of this template cannot be read.", "No markers: every matching run sends the same bytes. The Unit picks the printer queue.", or "<n> markers, each bound below to one value frozen for this run. The Unit picks the printer queue."
Emit for terminal verdict (Completion only) Which terminal verdicts activate the command. Four boxes: OK, NOK, Indeterminate, No verdict. A label starts on OK alone; a report starts with all four, because a procedure that judges nothing ends on no verdict and must still produce its document, and so does a Logic action, because a run sent on to another system must not skip a failed piece without anyone saying so (the script can read the verdict itself). The command fires only for a run ending on a ticked verdict. A Start command has no verdict yet and reads no filter.

A Needs review banner under the fields lists everything the command is short of (see Readiness below).

The queue a printed document goes to is not a field of the command: it is resolved by the command's kind and trigger through the unit's four printer slots, so two commands of the same combination share the printer deliberately. See Printers. A Logic action command prints nothing and has no slot.

Logic action commands

A Logic action command is the hook a run leaves for whoever programs the station: at a boundary it runs one action of the Logic, which may send the run to another system through any driver, light a lamp or reset a counter. The action is picked by identity, so renaming it on the Logic page changes nothing here; its own editor lists this command in its Used by card.

Aspect At Start At Completion
When it runs Queued on the Logic actions lane the moment the run starts, ahead of the labels and reports of the same moment. Once the run is saved and the unit's LastRun holds it.
What the run waits for Nothing: the run goes on whether the action is slow, refused or fails. Nothing: the run has already ended.
Which runs fire it Every run that starts. Every run that ends on a ticked verdict, except a run that ends Failed, which fires nothing.
What the action reads of the run Procedure.Metadata.<Field>, the values the starting run froze. LastRun.*: the run's identity, status, verdict, instants, metadata and the result of every criterion.

Several Logic action commands of one moment run one after another, in the emission order below, and none is skipped because an earlier one is still running: every run gets its own. What a run does to the action is said on the action's page: its LAST RUN rail names the run as Process · <unit> · <action>, with the error and the refused writes when there were any, and the journal keeps them; nothing is written into the run file. An action deleted since the command was configured is skipped and a warning is journaled; a disabled one refuses to run and records why.

Database row commands

A Database row command adds one row to a table of a factory database, the traceability table an MES already keeps: the serial, the verdict and the measured values of the piece, under the column names that table already has. The row goes through a device of the Database driver on the Connector page, which holds the connection and the sign-in, so the command names no server and stores no password. The table already exists: the station never creates one or changes one, it adds rows to it.

Field What it is Values / default Effect (the line under the field)
Database device The device the row goes through. "(select Database device)" or a Database device of the Connector; none at creation. Legend: "The Database device of the Connector the row goes through. It holds the connection and the sign-in, so none is typed here." Effect: "Choose a device: until then this command writes nothing.", "The referenced device no longer exists: this command writes nothing." or "Writes through <device>."
Database table The table the row is added to. "(select table)" or a table the device's database holds, read through the device while the command is open: base tables only, under their schema where the connection does not read that schema by default. A table the database no longer lists keeps its place, disabled, as "<table> (not in the database)". Legend: "The table the row is added to. It already exists in the database: the station never creates one." Effect: "Choose a table: its columns are read from the database." until one is picked. Picking a table reads its columns.

While the tables are read the line under the picker says "Reading the tables of the database…"; when they cannot be read it says why ("The tables of <device> could not be read: <cause>"), and a database holding more than 500 says "The database holds more tables than the list shows: the first 500 are listed." A database row is born, like a report, answering to every terminal verdict.

Under the fields, Table columns lists one row per column of the table, in the table's order, each with its type as the database spells it and, where the table refuses a row without a value in it (the column takes no empty value, has no default and is not an identity, auto-increment or computed column), the pill Required by the table. Each column takes a Value; a column left to the database is left out of the row, so the database fills it with its own default.

Value At Start At Completion Travels as
(left to the database) Yes Yes Nothing: the column is not named in the row
Fixed text, typed in Text to write Yes Yes Text, the same in every row
Metadata · Catalogue field, with Catalogue metadata Yes Yes Text: the value the run froze for that field
Run · Identifier, Procedure · Name, Unit · Name, Unit · Code, Run · Terminal state, Run · Verdict No Yes Text (Completed or Aborted; Ok, Nok, Indeterminate or None)
Run · Started at, Run · Finished at No Yes Date and time, in the station's local time
Run · Duration (seconds) No Yes Number
Run · Cycles, Run · Failed cycles No Yes Whole number
Criterion · Outcome, Criterion · Limits, with Criterion No Yes Text
Criterion · Passed No Yes True or false
Criterion · Measured value, Criterion · Lowest value, Criterion · Highest value, Criterion · Worst excursion No Yes Number
Criterion · Failed cycles No Yes Whole number

The values at Completion are the ones the unit's LastRun serves the Logic, a criterion folded over every cycle it was judged in; a field the run did not ask for, and a criterion it did not judge, give no value (NULL). Read the columns again, on the head of the list, reads the table's columns from the database again: a column keeps the value it was given, a new one joins the list with none, and one the table no longer has leaves it.

Aspect At Start At Completion
When the row goes out The moment the run starts, from the metadata the run froze. Once the run is saved and the unit's LastRun holds it.
What the run waits for Nothing: the row waits on the device's own queue and the run goes on. Nothing: the run has already ended.
Which runs write it Every run that starts. Every run that ends on a ticked verdict, except a run that ends Failed, which writes nothing.

The row is one INSERT naming the columns that have a value, every value a parameter of its own type and never text written into the statement, so a serial holding quotes or words of SQL is stored as the text it is. The database converts each value to its column's type as it converts any value. A database that refuses the row, does not answer within the driver's 10 seconds or cannot be reached only warns: the run is not affected, the journal records the refusal, and the run's record keeps the row with the refusal and its reason in the Database rows dossier of Histories. Nothing is kept to be sent later; Send again there sends the same values by hand. Several database rows of one moment go one after another, in the emission order below.

What a database row command is short of joins the list under Readiness below, in the order it is repaired: "Choose a Database device.", "The Database device it names no longer exists.", "The device it names, <device>, is not a Database device.", "Choose a table.", "Give at least one column a value: a row with no column is not written.", "<column> is required by the table and has no value.", "<column>: this value does not exist yet at Start; only a metadata field or a fixed text does.", "<column>: select a field of this model's metadata catalogue." and "<column>: select a criterion from one of this model's evaluations." What only the database can say is read while the command is open on this page, and joins the same list there: "The table <table> is no longer in the database.", "<column> is no longer a column of the table. Read the columns again.", "The table has columns this command has not read yet: <columns>. Read the columns again." and "The table could not be read from the database: <cause>". A procedure that selects the action says what it lacks for a column: "Column <column> reads a metadata field this Procedure does not prompt. Tick it in Metadata above.", "Column <column> reads a criterion result, and this Procedure judges by no evaluation." or "Column <column> reads a criterion this Procedure's evaluation does not declare."

Markers

Markers are the {{NAME}} fields a label template leaves for the run to fill in, so this section is drawn for a label command and for nothing else. Its state follows the template:

State What the section shows
No template chosen "Choose a template to map its markers." With stored mappings from an earlier template: "Stored mappings are preserved while the template is missing." and their marker names.
The template is gone from the library "Template unavailable", with the same preserved list.
The template has no printer commands A banner: "“<template>” has no printer commands yet: there is nothing to send and no marker to map until they are written or imported under Templates ▸ Labels."
The markers cannot be read A banner "Markers from “<template>” cannot be read: <error>", and "Stored mappings preserved. Repair or replace the template before changing these bindings."
The template has no marker "Fixed template. This template has no markers and sends the same bytes for every matching run."
Markers found One row per marker, headed by the marker and a Mapped / Required pill, with the fields below.
Field What it is Values / default
Frozen value source The one run value substituted into the marker. "(not mapped)" plus the sources of the table below. A Start command lists only the sources available at Start; a Completion command lists them all. "Metadata · Catalogue field" appears only when the model's metadata catalogue has fields, and the criterion sources only when some evaluation of the model declares a criterion. A source the current trigger cannot answer keeps its place, disabled, as "… (unavailable for this command)". Changing the source clears the field, cycle and formatting chosen for the previous one.
Catalogue metadata (Metadata source) Which field of the model's catalogue. "(select catalogue metadata)", "Missing field · <id>" for a field that is gone, then every field as "<name> · text / number / sequential".
Criterion (criterion sources) Which criterion of which evaluation of the model. "(select criterion)", "Missing criterion · <id>", then every criterion as "<evaluation> · <criterion or Criterion n> · <channel>".
Cycle (0-based) (criterion sources) Which cycle's result. Never implied: it must be typed. 0 up to the largest cycle count any procedure of the model runs, minus one; placeholder "required". A number outside that range is refused under the field.
Value format (date and time sources) How the instant is written. As recorded (default), Station date, Station time, Station date and time, ISO 8601.
Decimal places (numeric sources, and a numeric metadata field) A fixed number of decimals. 0 to 9; placeholder "automatic" (the station's own preference).
Clear invalid formatting A button drawn when a mapping carries formatting its source cannot use (decimals on a date, a date format on a number, either on a text). Resets the offending field.

The sources, in the order the picker lists them:

Source Available at Start Kind
Metadata · Catalogue field Yes Text, or a number for a numeric field
Model · Name, Model · Revision, Unit · Name, Unit · Code, Procedure · Name, Procedure · Code, Run · Identifier Yes Text
Run · Started at Yes Date and time
Run · State (at Start) / Run · Terminal state (at Completion) Yes Text
Run · Finished at No Date and time
Run · Duration (seconds) No Number
Run · Verdict, Run · Termination reason No Text
Criterion · Name, Channel, Limits, Severity, Outcome, Error, Affected channels No Text
Criterion · Window started at, Window closed at No Date and time
Criterion · Samples evaluated, Samples out, Samples unavailable, Samples invalid, Worst excursion No Number

Under the marker rows, Removed markers lists the mappings stored for markers the current template no longer declares ("<n> stale"; "These mappings no longer exist in the selected template and must be removed."), each with Remove stale marker mapping.

Readiness

The Ready / Review pills on both pages, and the rows the Validation page lists, come from one judgement. An action with no command is short of one: "Add a command: this action emits nothing yet." A command is short of, in the order it is repaired:

  • "Select at least one completion verdict." (a Completion command with no verdict ticked)
  • "Choose a report." / "The selected report no longer exists."
  • "Choose a Logic action." / "The Logic action it names no longer exists." / "The Logic action it names is disabled, so it is refused each time it fires."
  • "Choose a label template." / "The template was cleared or deleted; stored mappings are preserved." / "The selected global template no longer exists."
  • "The selected template has no printer commands yet; write or import them before a run reaches this command."
  • "Template markers cannot be read: <error>"
  • "{{M}} needs a source." / "{{M}} is mapped more than once."
  • "{{M}}: choose a source", "this source is not available at Start", "select a field of this model's metadata catalogue", "select a criterion from one of this model's evaluations", "set an explicit zero-based cycle from 0 to <n>", "remove decimal places from this date/time source", "use the default format for this numeric source", "decimal places must be between 0 and 9", "remove numeric/date formatting from this text source"
  • "{{M}} was removed from the current template; remove its stored mapping."

A command under review still runs: nothing is dropped at emission, and a marker that cannot resolve fails that one label as it always did. The configuration screen is where this is learned, not the printed tag.

How a procedure selects actions

A procedure's page carries the card Actions this procedure emits with a "<n> selected" pill and one checkbox per action of the model, in list order. Each row shows the action's emission line ("Label at Start, Label and report at Completion", or "Emits nothing yet: this action has no commands.") and, once selected, a Ready or Review pill. Review lists what this procedure lacks for the action's markers, one remark per marker, because a marker resolved per run resolves only where the procedure has the thing it names:

  • "{{M}} reads a metadata field this Procedure does not prompt. Tick it in Metadata above."
  • "{{M}} reads a criterion result, and this Procedure judges by no evaluation."
  • "{{M}} reads a criterion this Procedure's evaluation does not declare."
  • "{{M}} reads cycle <c>, and this Procedure runs a single cycle." / "… runs <n>."
  • "The Logic action it names no longer exists." (a Logic action command of the action, whose action was deleted: the procedure would run nothing in its place)

The action is neither hidden nor refused: the procedure says what it lacks, and the remedy is on the same page. With no action in the model the card says "No actions in this model yet. Add some under the model's Actions."

The emission order

At a run boundary the selected actions emit in the model list's order, and inside each action in its command order, filtered to that boundary's trigger: one answer for the whole model, never one per procedure. Start commands run once the run has materialized (after the sequential metadata has been reserved), and Completion commands once the terminal verdict has been sealed. Each command is isolated: a failure publishes nothing, changes nothing about the run and never stops the commands behind it. A report is named after the run and the action that emitted it; a later render of the same command replaces that command's document and nothing else. A Logic action command keeps that order among the Logic action commands of its moment; when it runs is said under Logic action commands. What each emission records in the run, and how it is reissued from Histories, is on Emitting labels and reports.

What an action does not do

  • It emits nothing on its own. A procedure has to select it, and a run of that procedure has to reach the boundary.
  • It does not check the procedure. Whether a procedure prompts the field or judges by the evaluation a marker names is stated on the procedure's page, beside the selection.
  • It does not pick the printer. The queue is the unit's, by kind and trigger, on Printers.
  • It does not edit templates. Label commands and report layouts are written under Templates; the action only names them.
  • It does not confirm physical printing. Queue acceptance is what a label or a printed report records, never proof that paper came out.
  • It does not wait for a Logic action, and does not record one in the run. The action's outcome is on its own page in Logic and in the journal.
  • It does not create or change a table, and does not keep a refused row to send it later. A database row goes to a table the factory database already holds; a refusal is recorded in the run and sent again from Histories by hand.