Lookup Event
Gets data from an event and adds it to a frame.
Parameters
Name | Default | Meaning |
---|---|---|
source | The name of the event source | |
prefix | A prefix to be added to lookup value names | |
sufffix | A suffix to be added to lookup value name | |
where | If present, this condition must be met for the lookup to happen | |
key | The name of the frame attribute used to in the lookup | |
rkey | The name of the lookup table column/property that matches the key | |
url | The URL to download the content from | |
global | false | If true, this resource is loaded once for the entire time range |
time | any | 'any', 'within', 'before' or 'after' adjusts which events are acceptable |
Description
This function searches for any events that happen in or around the active time-frame and adds the event information in with the rest of the captured data.
This is often used to capture information about production batches or inspections.
Time
The time parameter specifies where the event should be.
ANY: The event will be added no matter when the event was seen.
WITHIN: The event will be used only if it happens inside the time frame.
BEFORE: The event will be used only if it happens during or before the time frame.
AFTER: The event will be used only if it happens during or after the time frame.
Where
The where condition is checked on the event. For example, events might include a 'Urgency' property with a value of 1 for urgent items.
Your layer can include a condition like…
where: "{Urgency} == 1"
…so that only those events marked as 'urgent' would be attached to the frame.
Example
If the frame contains the following attributes…
Attribute | Value |
---|---|
StartTime | 10:00AM |
EndTime | 11:00AM |
Order | 8830 |
and we have the following events…
Time | POrder | Quality | Final | Response |
---|---|---|---|---|
8:00AM | 8829 | Good | 1 | OK |
9:00AM | 8830 | Bad | 0 | Bad Paint |
9:20AM | 8830 | Bad | 1 | Bad Paint |
11:15AM | 8830 | Good | 1 | OK |
12:20AM | 8831 | Bad | 0 | Throw Out |
{ "type": "lookup_event", "source": "Inspections" "key": "Order", "rkey" : "POrder", "prefix": "Inspection ", "where": "{Final} == 1" }
Would result in the following…
Attribute | Value |
---|---|
StartTime | 10:00AM |
EndTime | 11:00AM |
Order | 8830 |
Inspection Quality | Good |
Inspection Final | 1 |
Inspection Response | OK |