Overview
Critical Manufacturing MES (CM MES) runs material tracking, dispatch, resources, data collection and quality for complex discrete and semiconductor plants. Every MES service is exposed as REST on the MES host. This connector lets plant logic on MQTT track materials in and out, post machine readings and log machine state changes, without custom code. CriticalManufacturingMesApi (CriticalManufacturingMesRestApi.lot) is one client connector on https://YOUR_CMF_SERVER with 37 events: 2 Security Portal token events, 17 reads and 18 writes. No event deletes, terminates or removes anything.
The events follow CM’s public REST API catalog, which publishes one Swagger 2.0 file per service (for example
Material.swagger.json), and the Host API reference for input and business objects. The catalog has 66 services and about 2,000 operations. This app packages the shop-floor slice. To add another operation, copy an event and change the endpoint to /api/<Service>/<Operation>.Server host
CM MES is installed per customer, on premises or hosted by CM. ReplaceYOUR_CMF_SERVER with the host of your MES UI, with no trailing slash. REST services live under /api/<Service>/<Operation>. The Security Portal is on the same host under /SecurityPortal. If your Security Portal runs on a different host, copy the two token events into a second connector on that host.
Authentication
CM MES uses the Security Portal (OAuth 2.0). Pick one of these:- Personal Access Token. In the MES UI, open your User Profile and create an access token for the Coreflux service user. Publish
{"tenant": "<TenantName>", "client_id": "MES", "pat": "<PAT>"}onmes/critical-manufacturing-mes/token/create. The Security Portal validates the PAT with therefresh_tokengrant and returns a Beareraccess_token. Use the Security Portal client ID set on your environment (/Cmf/System/Configuration/SecurityPortal/ClientId/, usuallyMES). - Client credentials. For application-to-application calls with no user, publish
{"tenant": "<TenantName>", "client_id": "<id>", "client_secret": "<secret>"}onmes/critical-manufacturing-mes/token-client/create.
"authorization": "Bearer <access_token>" in every other payload. Tokens expire, so request a new one on a timer (the example actions use 30 minutes).
A PAT does not work as a Bearer token. CM’s community answer is to send it with Basic authentication instead, as "authorization": "Basic <base64 of <PAT>:>", that is the PAT as user name with an empty password. That form comes from a community answer and has not been tested here. The token flow is the documented path.
TenantName is the tenant configured for your environment. Calls run with the MES roles and data groups of the PAT owner or client application.
Suggested secrets: CMF_PAT and CMF_TENANT, or CMF_CLIENT_ID and CMF_CLIENT_SECRET.
Payload conventions
- Body. Almost every service is
POST."body"is sent unchanged as the operation’s input object, with the PascalCase properties from the Swagger file, for exampleComplexTrackInMaterialInputhasMaterial,Resource,CurrentDataCollectionPointsandSkipDCValidation. - Entity references. Reference materials, resources and other entities by
Name(orId) with a"$type", for example{"$type": "Cmf.Navigo.BusinessObjects.Material, Cmf.Navigo.BusinessObjects", "Name": "MAT-0001"}. Resources useCmf.Navigo.BusinessObjects.Resource, state modelsCmf.Foundation.BusinessObjects.StateModel, Cmf.Foundation.BusinessObjects. - Readings. A data collection point is
{"$type": "Cmf.Navigo.BusinessObjects.DataCollectionPoint, Cmf.Navigo.BusinessObjects", "TargetEntity": {"$type": "Cmf.Navigo.BusinessObjects.Parameter, Cmf.Navigo.BusinessObjects", "Name": "Temperature"}, "Value": 72.4, "ReadingNumber": 1, "SampleId": "Sample 1"}. - Losses. Loss lines are
LossBonusAffectedQuantityobjects withReasonandReasonPrimaryQuantity. Hold lines areMaterialHoldReasonobjects withTargetEntity(the reason) andComment. - Enums. Enums are integers, for example
Direction0 Ascendant / 1 Descendant onGetMaterialGenealogy, andComplexPerformDataCollectionMode0 Material, 1 Resource, 2 first material in the resource, 3 all materials in the resource. - Query.
GetObjectByNameandGetObjectByIdtake"query"as the URL query string, for example"query": "Type=Material&Name=MAT-0001&LevelsToLoad=1". - Token form. The token body is form-encoded with raw substitution, so keep the tenant, client ID and secret free of
&and=.
Two details are not shown in the public Swagger files: the exact
Type value GetObjectByName expects (a short name such as Material, or the URL-encoded type name), and whether your host needs "$type" on every reference. The "$type" form matches CM’s Connect IoT workflow samples. Check both against your MES before going live.Events
Tokens and session
Generic objects and saved queries
Materials, dispatch lists and production orders (read)
Material transactions (write)
Resources (machines)
Data collection (EDC)
Production orders (write)
Every event replies on its topic plus
/response.
Example: connector excerpt
Example: plant actions
These actions get a token every 30 minutes, keep it on an internal topic, track a material in and out when the press loads and finishes it, send the press temperature to an ad-hoc data collection, log machine state transitions and poll the dispatch list.Not packaged
- Every
Delete*,Remove*,Terminate*andUnterminate*operation, by policy. - Master data and configuration (
Create*,FullUpdate*,Update*of products, flows, recipes, roles and data collections). /api/Security/Login. It is not in the public REST catalog; use the Security Portal token endpoint.- Outbound webhooks. CM’s public documentation lists no outbound webhook feature, so no receiver connector is packaged. Pushing MES events to MQTT is a job for Connect IoT or integration entries, configured inside MES.
Status
The connector stays blocked until it is checked against a real CM MES 11.x server with the Security Portal: a token from a PAT,
Echo, GetCurrentUser, GetResourceByName and GetMaterialBasicInformation, and a Track-In / Track-Out of a test material.

