Designing an Event Scheme
The settings that define a scheme — backfill, refresh offset, indexing, retention — and how to decide each.
An event scheme is a definition of one kind of thing that happens: a production run, a stoppage, a batch, a CIP cycle. This article covers designing the scheme itself. Its triggers and attributes have their own articles.
Scope it to one kind of thing#
The first decision is what the scheme is, and the failure mode is making it too broad.
One scheme per kind of event, per piece of equipment that needs its own:
Line 1
+-- Production Run runs, with product and operator
+-- Stoppage downtime, with reason and category
+-- Changeover transitions, with from-product and to-product
The tempting alternative is one Line 1 Events scheme with a Type attribute distinguishing runs from stoppages from changeovers. Resist it. Separate schemes give you:
- Triggers that describe one thing and can be reasoned about
- Attribute sets that are all relevant, rather than mostly blank
- Event-aggregated measures that mean something without filtering
- Analysis that does not begin by separating out what you merged
Put each scheme in the folder for the equipment it describes, so the events and the measures they contextualise are found together.
The scheme settings#
| Setting | What it controls |
|---|---|
| Name and Description | Identity |
| Label | How individual events are labelled |
| Engine | Which Data Engine processes it |
| Backfill | The date from which to build events |
| Refresh Offset | How far back to re-examine on each pass |
| Archive Age | When events move to archive |
| Purge Age | When events are removed |
| Index Time Scheme, Index Interval, Index Initial | Automatic event numbering |
| Active | Whether it is processed |
Backfill#
Backfill sets the date from which Infohub builds events. Left unset, events begin from when the scheme starts running.
Set it when the source data already contains history you want as events — a historian holding two years of machine states, or an MES table of past production orders. Infohub will work through the history and create the events.
Backfill deliberately, not ambitiously. Backfilling two years of stoppage events across forty machines is a large amount of work for the engine, and it competes with current collection. Start with a few weeks, confirm the events look right, then extend. Backfilling a long history against a badly configured trigger produces a long history of wrong events, which then has to be cleared.
Refresh Offset#
Refresh Offset controls how far back the scheme re-examines source data on each pass.
It exists because plant data arrives late. A historian may log a state change a little after it happened; an MES record may be completed retrospectively; a manually confirmed production order may be entered the next morning. A scheme that only ever looks at the newest data will miss all of it.
The trade-off is direct: a larger offset catches more late data and costs more work per pass.
Practical guidance:
- Start at something comfortably larger than the worst lateness you actually observe.
- For manually confirmed events, that may be a day or more.
- For pure tag-driven events on a healthy historian, minutes to an hour is usually enough.
- If events appear and then need correcting, the offset is too small.
Indexing#
The Index settings give events automatic sequential numbers — batch numbers, run numbers, order numbers — and control when the numbering restarts.
| Setting | Effect |
|---|---|
| Index Time Scheme | Which calendar governs the reset |
| Index Interval | The interval at which numbering restarts |
| Index Initial | The number to start from |
So an index interval of Yearly with an initial of 1 numbers events 1, 2, 3… through the year and restarts at 1 in January. A Daily interval numbers within each day.
This is genuinely useful for batch and run identification, and it is worth deciding before the scheme runs. Changing the numbering scheme after events exist does not renumber history, so you end up with two conventions in one series.
Match the index to how people refer to events. If operators talk about "batch 47" meaning the forty-seventh of the day, use a Daily index. If they mean the forty-seventh this year, use Yearly. Getting this to match the plant's own language is what makes the number useful in conversation.
Archive Age and Purge Age#
Events accumulate. Archive Age moves older events out of the active working set; Purge Age removes them.
Decide these against your actual reporting horizon:
- If people compare against last year, purge age must exceed a year comfortably.
- If quality traceability requires seven years, that is the constraint, and it may be a regulatory one.
- If a scheme is genuinely operational — machine states for a live utilisation dashboard — a shorter retention is reasonable and keeps the model fast.
Purge is not reversible. A purged event is gone. Where events carry manually entered attributes — a reason typed by a supervisor, a comment explaining a deviation — that information cannot be regenerated from any source. Treat purge settings on schemes with manual attributes with the same caution as manual entry measures, and make sure your database backup retention outlives your purge age.
Design sequence#
A workable order, and the reason for it.
1. Decide what one event is. Write the sentence: "a Stoppage starts when the line stops running and ends when it runs again". If you cannot write that sentence unambiguously, the scheme is not yet defined.
2. Find the trigger source. What in the data marks the start and the end? A state tag, a query against an MES table, a calendar. If nothing in the data marks it, the event will have to be manually entered — which is legitimate but changes the design.
3. Decide the attributes. What do you need to know about each event, and where does each value come from — the source, a calculation, or a person? See Event Attributes and Enumerations.
4. Decide the enumerations. Anything categorical needs a defined list, or analysis will drown in spelling variants.
5. Set the scheme settings above.
6. Run it forward first. Let it create events from now, with no backfill, and look at them. Are the boundaries where you expect? Are attributes populated? Are there duplicates or events that never close?
7. Then backfill, in a bounded range, and check again.
8. Then build the event-aggregated measures and charts.
Steps 6 and 7 in that order matter. Building the analysis before confirming the events are right means debugging two things at once.
Verifying a scheme#
Before relying on it, check against reality:
- Count. Does the number of events per day match what the plant says happened?
- Boundaries. Pick three events and compare their start and end times against the source data or an operator's account.
- Open events. Are there events with no end that should have closed? That is a trigger problem.
- Duplicates. Two events for one real occurrence is also a trigger problem.
- Attribute completeness. What proportion of events have their attributes populated? A reason attribute filled in 40% of the time produces a Pareto chart dominated by "unspecified".
- Total duration. For state-based schemes, do the durations across a day add up to roughly the day? If they add to much more, events are overlapping; much less, and gaps are being missed.
Common design mistakes#
| Mistake | Consequence |
|---|---|
| One scheme for several kinds of event | Attributes mostly blank; every analysis starts with filtering |
| Modelling a run as a calendar period | Unmaintainable; cannot describe it with attributes |
| Modelling a stoppage as a 1/0 measure | No reason, no duration per instance, no Pareto |
| Refresh offset too small | Late data never captured |
| Backfilling before verifying the trigger | A long history of wrong events |
| No enumerations on categorical attributes | Free-text categories that will not group |
| Purge age shorter than the reporting horizon | History disappears before anyone finishes comparing against it |
| Index scheme changed after events exist | Two numbering conventions in one series |