Dynamic Histories - Under the Hood

There are two components inside the DynamicHistory palette folder, HistorySource and HistoryFunction.

Rollups, conversions, and history grouping all use what we call "Dynamic History" components. Dynamic history components are structured using history functions containing history sources. For instance, a conversion is simply a history function with a single history source that listens for history events (changes) multiplied by a scale whereas a rollup would contain multiple history sources.

These components are dynamically created and used by Periscope and then stored inside of the Periscope Service underneath the "Dynamic Histories" container. Users should never edit anything under the dynamic histories container unless instructed to do so by technical support. Instead, users should opt for using the interfaces available in Periscope Config or other areas. Editing of dynamic histories that are directly tied to the Periscope Service is discouraged because Periscope automatically detects and handles things such as:

  • Keeping track of which histories are "rolled into" other histories (using metadata tags rolledInto and rolledUp, viewable in the metadata explorer)
  • Change propagation; if a history changes that updates a dynamic history, the dynamic history will also check to make sure to update anything it  might be rolled into as well
  • Trend mapping/learning; in most cases when Periscope Config creates a history source or history function, newly created histories are automatically added to the learned trends section of the Periscope Config.

History Source

History sources contain a simple reference to a history on the station as well as an accumulating flag for whether or not the history should be considered accumulating for calculations. Link the history source's "output" slot to a history function "inputX" slot - where X is an arbitrary letter - to use a history source with a history function. Note that the slot on the history function will not exist until the number of inputs is defined. For more information see History Function.

History sources may also be found in 2.4 with a strange history source like 'history:/Device/History_TS_timestamp_VAL_val'. This represents a virtual history of a base history using val for the value column and timestamp for the timestamp column. This is a product of internal Periscope workings and is not handled like a standard BOrd and will encounter an error if an attempt is made to resolve the BOrd.

 

History Function

History functions are the work-horse behind many historical operations and you will find many similarities between them and the newly added series transforms in AX. History functions apply a rollup to the provided history source inputs as well as allow for a custom function to be used with the inputs. History functions support all standard mathematical operations as well as less-common ones like abs() and sqrt().

Some other features of history functions include:

  • Automatic 1-day back-fill; by default, all history functions will check the previous 24 hours of data to make sure that all of the data is correct and up-to-date.
  • Include Null Values: by default, if a function (A+B+C) does not have an input (C) for a time-period, it will drop the value entirely to indicate via the history that not all the values were present. By setting include null values to true, it is informing the history function that it is OK for an input to not exist, turning A+B+C into A+B if C does not exist. Otherwise, A+B+C will be null for that time-period.

 

For any issues or questions pertaining to dynamic histories please contact techsupport@activelogix.com.