Bitmap for multiple indicators in Canonical

#1

Our client has several indicators in the input record for a Canonical. Two of these exist today, some are for future use. the two that exist today are:
isMeasurement: Is this is a measurement (kw, rpm, Celcius, etc) or not (status like on, off, repair, offline, etc).
isGood: Is this value determined by PI a good measure or is there something flaky about it?

They want a single field to denote both indicators, kind of like chmod on file systems. So using just the two indicators, the values would signify the following:
0: bad value, not a measurement
1: bad value, measurement
2: good value, not a measurement
3: good value, measurement

Based on the value, there would be three or four transforms to ingest the data into the correct type.
Do we support this type of field or would it be something I would need to code in the transform condition?

0 Likes

#2

This is the list of supported types List all Primitive Types

 int
 long int
 byte
 string
 char
 decimal
 double
 float
 datetime
 boolean
 json
 binary

The binary / byte seems the types that you could try for your use case.

I think having separate boolean flags (i.e. isMeasurement, isGood) like your current case is much easier.

type CanonicalXYZ {
  isMeasurement: boolean
  isGood: boolean
}

As your 4 transforms will just have the proper activation conditions

@canonicalTransform(condition="isMeasurement && isGood")
type TransformCanonicalXYZToXYZ mixes XYZ transforms CanonicalXYZ {
  . . .
}
0 Likes

#3

Thanks @bachr for the reply. My original request was to have two separate indicators (or as many as are needed going forward), but the client got upset about having to include more data (it was only 1 extra byte, but the principle is not lost on me) to transmit and more work for them to do on their ETL.

We came to the conclusion that we would test 4 different transforms, each with a filter condition like
Indicators==0
Indicators==1
…etc.

If that does not work, we’ll have to go back to the drawing board

0 Likes