OpenCore MES Try the demo

Docs Designing the system 6

Connections: the outside systems

On this page

A connection describes an outside system (ERP, a LIMS, a label printer). Create one with New connection or + connection:

The ERP connection's General tab: its name, label, base URL and timeout
A connection's General tab: its name, label and base URL, and how long a request may take.
The ERP connection's General tab: its name, label, base URL and timeoutA connection's General tab: its name, label and base URL, and how long a request may take.
TabWhat you set
GeneralLabel and base URL (https://erp.plant.local/api); Peer when it is another OpenCore MES instance (see Several instances as one, below)
Authenticationnone, bearer, header or basic, and the name of the secret. The secret's value is set on the server by IT (MES_SECRET_<NAME>); it never appears in a design, a review or an AI's context
Allowed requestsThe only requests services may send: a method and a path (POST /confirmations, GET /orders/*). Anything else is refused, and so is a path written to climb out of what is allowed (.., %2e, a backslash, a space): a script that builds a path from an order number sends exactly that path or nothing
Data sourceTick when it is a system that holds data by time (a time-series store, a historian, an EDC service) and answers a read-only window query (docs/contracts/data-source). The request (a GET among the allowed requests), the names of its window parameters (from, to), its parameters (the machine, the chamber) and the most rows (up to 5 000)
PublishedFor a peer only: what it publishes to this plant, as last discovered, and Discover
ActivityEvery request services sent it
StewardsWho answers for it. They approve every service that starts using it
The ERP connection's Allowed requests: POST /confirmations and GET /orders
A connection's Allowed requests: the only calls a service may send that system.
The ERP connection's Allowed requests: POST /confirmations and GET /ordersA connection's Allowed requests: the only calls a service may send that system.

A data source. A connection with a Data source tab filled in is read a window at a time: the system keeps its samples, and OpenCore MES asks it for the window of a record (a run's start and end), never copying them in bulk. Ask for it in a screen's source block (below), or in a service with ctx.sources.read("edc", { params: { machine: "M-7" }, from, to }) → { columns, rows, truncated, hash, window } (the connection in the service's What it may reach; a dry run answers from its canned response for GET <the request>). The hash is the SHA-256 of the rows read: a service may keep it with the window on the record that used the data, so an auditor can ask the source for the same window and compare. A source that is down, answers an error or does not keep the contract shows a sentence; nothing partial is ever drawn.

Requests and answers are JSON. The request timeout is set per connection (100 ms to 30 s; 5 s left empty). IT may list the hosts connections can be sent to on the server; a connection to a host that is not on that list is refused when it is used, saying so (ask IT to add it). A host that leads to a link-local address (169.254.x.x, fe80::, where a cloud keeps its metadata service) or an unspecified one (0.0.0.0) is always refused, even when IT lists it: no plant system lives there. A host whose name cannot be looked up is not sent anything: the call fails as unreachable ("could not be looked up"), and a trigger tries again later.

Not yet. Only JSON over HTTP, and only the four kinds of authentication above (no OAuth2 client credentials or client certificates yet).