Components
Components are building blocks that compute or process values; you set them up from the library, bind them to nodes, start and stop them, and read their runs and logs.
Overview#
A component is a building block that takes input values, computes something and delivers output values, for example a signal generator, a scaling, a threshold or an analysis. Every component has the same shape:
- inputs and outputs (ports) with a name and a value type (
float,integer,bool,stringordynamic), - a state (
IDLE,OK,ERROR,BUSY), - a log and an error text.
The workbench distinguishes two things:
| Term | Meaning |
|---|---|
| Library | Everything that can be set up: the building blocks provided by the operator of your LooT installation and the scripts of your tenant. |
| In operation | The components of your tenant: set-up building blocks with their own name, settings, bindings to nodes and their own run history. |
A component runs in one of two modes:
- Job: a run has an end. The component works through its default inputs and delivers results, then the run ends.
- Reactive: the run lasts until it is stopped. The component continuously processes the values of the nodes its inputs are bound to and writes results into the nodes of its outputs.
A component has at most one active run at any time. While it runs, starting, changing and deleting are blocked until the run ends.
The Components view#
Open the Components view from the rail. It is the only entry to components and the library and has two groups:
- In operation (n): all components of the tenant by name, each with a status dot for the latest run, the kind, the Start and Stop buttons and a ⋮ menu (open, start, stop, delete …). Set the sort order in the ⋮ menu of the view (by name or by last run).
- Library: the scripts first, then the entries of the catalog, grouped by the first level of their classification (entries without a classification are listed under "Other"). The list shows only the latest version of each entry.
The search field at the top filters both groups. A click on a row opens a preview tab, a double-click pins it:
- a component opens the Component tab,
- a catalog entry opens the Library tab,
- a script opens the script tab (see Scripts).
The lists update live when states change.
Setting up a component#
The New … wizard guides you through the setup. You find it in the ⋮ menu of the Components view and in the toolbar of a workflow. From the library, start it with Set up … in the Library tab or with Set up component … in the ⋮ menu of a library row; the entry is then already selected.
The wizard offers two paths as tiles:
- Write a script ("Create scripts" permission): creates a new script from a template, see Scripts.
- Set up from the library ("Create components" permission): sets up a catalog entry or an existing script as a component.
Without the respective permission the tile is disabled and states the reason. The path "Set up from the library" has these steps:
- Entry: choose an entry from the grouped tiles (search and double-click help). The latest version applies.
- Name: enter the name of the component; the entry's name is suggested. The name is unique within the tenant, ignoring case.
- Inputs: for a reactive component, use Bind node … to bind a matching node to an input (at most one per input) or enter a default value. For a job component, enter default inputs.
- Outputs: choose any number of nodes the output writes to.
- Finish: decide whether the component should start right away, whether a log is produced, whether it restarts after a container failure and which deadline applies.
Steps the component does not need (because it has no ports) are skipped. Set up creates the component, binds the nodes and, if wanted, starts it; its tab then opens. If a step fails after the component was created, the component stays and the wizard names what is missing.
Alternatively, drag a library entry from the view onto the canvas of a workflow: a component is created at once and appears as a box.
The Component tab#
The tab header shows the name, kind with version and mode, the state with the time of the latest run, Start, Stop and the error text of the latest run. The ⋮ menu offers Rename … and Delete …. A component with an active run cannot be deleted or changed.
The sections:
| Section | Content |
|---|---|
| Settings | Default inputs per input, deadline in seconds (empty: the component's own deadline), create log and the option to restart with the same inputs after a container failure. Changes only apply with Save; Reset discards them. |
| Bindings | Connection of the ports with nodes, see below. |
| Version | Shows the version in use and newer versions; this is where you switch the component. |
| Runs | The latest 50 runs of this component with details. |
| Permissions | Permissions on the component; visible only with the Manage permission. |
Bindings#
A binding connects a port of the component with a node of your tenant:
- An input receives the values of a node with direction OUT or IN/OUT. There is at most one binding per input. Inputs can only be bound on reactive components; job components get default inputs.
- An output writes into nodes with direction IN or IN/OUT. One output may serve several nodes, but not the same node twice.
The types must match: numeric outputs go into number nodes, bool into bool nodes, string into text nodes; an integer node accepts only whole numbers. Compound, stream, custom and geo nodes cannot be bound. Cycles are not allowed: the check reports the path in plain text (for example via "Component Average"). Bindings take effect immediately.
Bindings are checked when created and again when the node changes. If a change of a node's type or direction would invalidate bindings, the server rejects the change and names the number of affected bindings; release those bindings first.
Switching the version#
A component stays on its version until you switch it. The Version section shows whether a newer version is available and which ports changed. The switch is checked first as a trial run:
- If everything fits, Switch is enough.
- If only some bindings no longer fit, Release bindings and switch … offers to release them and switch in one step (with confirmation).
- Otherwise the server lists all reasons, for example a changed mode, a missing port or a running run.
Whoever may manage the component (Manage permission) may switch it. For scripts, Compare opens the script's Versions section with the line-by-line difference.
Starting and stopping#
Start begins a run with the default inputs and the bindings of the component; the request returns at once and the state changes to BUSY. Stop asks the container to end the run; after a short while (a few seconds at most) the state is IDLE. Reactive runs and long jobs end only by stopping or by their deadline.
Run states:
| State | Meaning |
|---|---|
BUSY | The run is working. |
OK | The run ended without error. |
IDLE | The run was stopped. |
ERROR | The run ended with an error; the error text appears in the header. |
A run also ends with ERROR if the container is unreachable or the deadline is exceeded. If restart with the same inputs after a container failure is set, the server restarts the run up to three times; this is only sensible for components whose result can be repeated.
Trying out an entry#
In the Library tab of an entry (and in the script tab), the Try out section starts a test run. Enter inputs (Set default values fills in the defaults) and start with Start test run. The result shows the state, outputs, error and log. Cancel ends the run.
The Library tab also has the Overview section (description, reachability of the container, ports with direction, type, default value and description, all versions) and In operation (the components of your tenant that use this entry, with state and the notice "x.y.z available").
Runs and logs#
Every run is kept as an entry, also after it has ended. A click on a row opens the details: state, start and end, attempt, inputs, the latest outputs and, if you enabled the log, the log of the run. A second click closes the details.
- In the Component tab, the Runs section shows the latest 50 runs of this component.
- The Component runs button in the header of the tenant tab (and in the ⋮ menu of the view) opens the Runs tab with the latest 100 runs of all components, newest first. Columns: state, component, kind, start, duration, error. The kind is Test (test run), Operation (run of a component) or One-off (a single start from the library, for example via the command line). Filters by component, state and kind can be combined; running runs have Stop. The tab needs the Execute permission on the tenant.
Logs are stored only if Create log is enabled. LooT keeps finished runs and their logs for a limited time: by default 90 days for runs and 30 days for log entries; your operator can change this.
Container components#
The library building blocks other than scripts run in their own containers, operated by the operator of the installation. A container registers its components in the catalog at start; catalog entries are immutable per version and visible to all tenants. If you want to write your own containers, contact the operator. Whether a container is reachable is shown in the Overview section of the Library tab; system administrators see the operation of all containers in the system status.
For numbers and text you want to process without a container, write a script: it is an ordinary component and runs in a protected environment.
Permissions#
| Permission | Granted on | Allows |
|---|---|---|
| Create components | the tenant | setting up components |
| Read | the component | seeing the component, bindings, runs and log |
| Execute | the component or the tenant | starting and stopping; on the tenant also test runs and the Runs tab |
| Manage | the component | changing, deleting, creating and releasing bindings, switching the version, granting permissions |
Whoever creates a component receives Read, Manage and Execute on it. Tenant admins and system admins have all permissions. Components without read permission are invisible. You grant permissions in the Permissions section of the component; in general see Permissions and Tenant administration.