Patterns
Patterns
A pattern describes a shape, not a list. You draw the relationship once: a weather
station and the pumps beneath it, a batch and the unit that ran it, and Stream resolves
that shape into every combination which actually exists in your plant. Each combination
is a match, and each match is one unit of work for the task built on it.
What they are for
Reading one asset's tags needs none of this. Patterns exist for the questions that
need values from more than one place at the same time.
Those places are sub-hierarchies. A weather station's temperature sits in one branch of
your AF tree and a pump's production sits in another, and the question how does ambient
temperature affect output needs both, on the same row, for every pump on site. The same
goes for time: the temperature belongs to a batch, not to a clock interval, and the
batch is a separate record again.
A pattern is the statement of how those branches belong together. Stream then merges
their data for you: one row per match, carrying values drawn from every asset and every
production event the pattern names.
Two kinds, one idea
| Pattern | Answers | Matches against |
|---|---|---|
| Asset Patterns | Which equipment | Assets and the sub-hierarchy beneath them |
| TimeFrame Patterns | Which production events | AF event frames: batches, phases, downtime |
They resolve the same way, and a task can use both at once. The TimeFrame pattern
supplies the batches, the asset pattern supplies the equipment, and each row the task
writes carries values from both.
Every match hands the task a set of named keys: e1 for an element, a1 for one of
its attributes, tf1 for a TimeFrame, and those keys are what the
Mapping and Conditions tabs read.
See Object properties for what each key answers to.
Matching costs a search
A task cannot read anything until it knows which assets it matched, so without help it
searches AF on every run. Asset Pattern Cache resolves the matches
once per cadence you choose and stores them, and every task on that pattern reads the
stored list instead.
It is optional. An uncached pattern is correct, only slower.
What's Next
- Asset Patterns: match equipment, and repeat the shape across the plant
- TimeFrame Patterns: match batches, phases and downtime events
- Asset Pattern Cache: resolve the matches on a schedule instead
Related
- Tasks: what runs once per match
- Object properties: every property a match's keys answer to