lumnik. / scenarios All scenarios · Français

The CMMS is switched off and the hub still returns the same bytes

Goal Switch off a replaced CMMS without losing its thirty years of work orders or its compliance reads.

A replaced CMMS stays on for a few compliance reads a year. lumnik reads it one last time, archives what it read, and the machine is switched off.

cmms.sql
-- A retired CMMS: thirty years of work orders, all synthetic, generated the same way every time.
CREATE TABLE workorder (
  wonum       text PRIMARY KEY,
  assetnum    text NOT NULL,
  description text NOT NULL,
  status      text NOT NULL,
  reportdate  date NOT NULL,
  actfinish   date,
  failurecode text,
  remarks     text
);

INSERT INTO workorder
SELECT 'WO-' || lpad(n::text, 6, '0'),
       (ARRAY['T-114','T-115','P-207','P-208','C-031','V-412','G-002','K-090'])[1 + n % 8],
       (ARRAY['Inspection annuelle','Fuite huile','Remplacement joint','Surchauffe','Vibration anormale',
              'Contrôle isolement','Graissage','Déclenchement protection'])[1 + (n * 7) % 8],
       CASE WHEN n % 97 = 0 THEN 'CAN' ELSE 'CLOSE' END,
       date '1995-01-02' + (n * 3),
       date '1995-01-02' + (n * 3) + (n % 5),

… 4 more lines

manifests/20-work-order.yaml
kind: Entityname: work_order_blabel: Ordre de travaildescription: "Thirty years of the retired CMMS's work orders, kept for compliance reads."scopes: [maintenance]match: [wonum]sources:  - table: t_zombie_workorder_b    map:      wonum: wonum      assetnum: assetnum      description: description      status: status      reportdate: reportdate      actfinish: actfinish      failurecode: failurecode      remarks: remarks
manifests/30-archive.yaml
# The final archive: one file, one name, delivered once. A second run is refused rather than# replacing what was delivered.apiVersion: apps.lumnik.io/v1kind: Exportmetadata:  name: scenario-zombie-archive-bspec:  scope: maintenance  source:    entity: work_order_b  columns: [wonum, assetnum, description, status, reportdate, actfinish, failurecode, remarks]  order: [wonum]  format:    kind: csv  destination:    kind: s3    bucket: archive    prefix: cmms    filename: work-orders-final.csv    region: us-east-1    endpoint: http://zombie-archive-b:9000    access_key_env: SCENARIO_ZOMBIE_B_S3_ACCESS    secret_key_env: SCENARIO_ZOMBIE_B_S3_SECRET  mode: snapshot
$ lm run get cb35afc0-b589-48f6-9c23-8fc463dfa536
ID        CONNECTOR          ENDPOINT   STATUS  IN  OUT  SKIPPED  DEAD-LETTERS  STARTED           ENDED             EVALUATED
cb35afc0  scenario-zombie-b  workorder  Failed  0   0    0        0             2026-11-03 19:11  2026-11-03 19:11  yes
✖ run failed: could not reach public.workorder (SQLSTATE 08001): host not resolved (UnknownHostException)

$ lm connector pause scenario-zombie-b
paused: scenario-zombie-b

$ lm connector list
NAME                             TYPE          TENANT  SCHED               WINDOW  STATUS     LAST RUN
scenario-zombie-b                jdbc-generic  1       * * * * * (paused)          Failed     2026-11-03 19:11
$ lm entity get work_order_b --filter wonum=WO-001234
WONUM      ASSETNUM  DESCRIPTION  STATUS  REPORTDATE  ACTFINISH   FAILURECODE  REMARKS                                    _CONFLICTS
WO-001234  P-207     Graissage    CLOSE   2005-02-20  2005-02-24               Intervention 1234 : aucun défaut constaté  {}

$ lm entity export work_order_b -o work-orders-after.csv
work_order_b: 438561 bytes written to work-orders-after.csv (sha256 6cfa21baedadc0b0321a9998f5fa6da5eded14a94b84f597b4527a3017292fc2)

$ lm export run scenario-zombie-archive-b --wait
Run           5cd65a1c-85a2-4df4-8b60-c0682dcf9eee
Export        scenario-zombie-archive-b
Entity        work_order_b
Scope         maintenance
Destination   s3
Status        Failed
Trigger       manual
Attempt       1
Started       2026-11-03 19:13:40
Ended         2026-11-03 19:13:40
Failure       collision
Reason        S3 destination: s3://archive/cmms/work-orders-final.csv already exists — refusing to overwrite a previously delivered artifact
• export run 5cd65a1c-85a2-4df4-8b60-c0682dcf9eee accepted — waiting for the hub to record its outcome
Error: export run 5cd65a1c-85a2-4df4-8b60-c0682dcf9eee failed (collision): S3 destination: s3://archive/cmms/work-orders-final.csv already exists — refusing to overwrite a previously delivered artifact

Limits

  • A connector whose source is switched off fails at every slot until it is paused; the hub does not pause it by itself.
  • lm source jdbc discover still quotes the driver's own message.
  • Retention on the bucket (object lock) belongs to the store, not the hub.
  • Simulated CMMS and bucket; synthetic data.

Maintenance · compliance

A replaced CMMS is still running.

For a few reads a year.

A licence, a machine, and one person who knows how to restart it.

Simulated CMMS · synthetic data

The problem

Thirty years of work orders keep the machine alive.

  • 3,600 orders, from 1995 to 2024.
  • An audit can cite any of them.
  • Switching off means losing the answer.

Nothing is migrated

The CMMS is read as it is.

  • A read-only account.
  • No data migration.
  • No application to build.

What had to be written

filename: work-orders-final.csv
mode: snapshot

One archive, one name, delivered once.

A 63-line scenario, three declaration files.

The proof

One digest.

  • The local snapshot.
  • The export's receipt.
  • The object read back from the bucket.

SHA-256 6cfa21ba…92fc2, replay of 3 November 2026.

The machine switched off

The next run says why it fails.

lm run get
could not reach public.workorder (SQLSTATE 08001): host not resolved (UnknownHostException)

A pause stops the schedule.

The limit

The hub does not pause itself.

  • Without a pause, every slot fails.
  • Bucket retention belongs to the storage.
  • discover still shows the driver's message.

Try it

The scenario replays end to end.

CMMS, S3 archive, switch-off: every step is published with its output.

This scenario runs on lumnik Open, free and open source.

Try lumnik Open →