How to inject thresholds and dispersion multipliers values

This cookbook applies for new Thresholds and Dispersion Multipliers types and will not work for ThresholdLevels - old and BaselineMultipliers - old.

Context

You want to inject  Thresholds  or Dispersion Multipliers values from Data Integration or WebService.

This topic provides an example on how to inject thresholds. However, the method for dispersion multipliers is exactly the same.

Write thresholds values

To write thresholds values, start by creating an observed attribute for the threshold. 

Observed attribute configuration

  1. On the main menu, click the cog icon > Model & Configuration. On the left menu, click  Entities .
  2. Click the Edit icon for the Process entity.
  3. On the left menu, click Attributes.  
  4. From the You can also create a drop-down, select Observed Attribute.
  5. Use the same settings for your attribute as the ones shown in the picture below. 

In this example, the attribute is has a 1-hour rhythm. When injecting data, be careful to align the operation time to that rhythm: all update times will have to be on the hour

Although the example here uses rhythms, please note that static thresholds are usually arrhythmic while dynamic thresholds, for example, computed from the new baseline model, are usually rhythmic.

 

Mapping configuration

Create a mapping to inject data into Decision Insight.

  1. On the main menu, click the cog icon > Data Integration. On the left menu, click Mappings.
  2. Click the New Mapping button. 
  3. Use the following settings for the mapping:
    • Name: addThresholdRisk
    • A Thresholds Decimal parameter named myThreshold.
    • An Instant parameter named updateTime.
    • An Instance operation on entity Process .
      • Operations begin uses the updateTime parameter
      • Operations end is set to UNTIL_CHANGED.
    • The value in the resolution area is set to Constant and Outgoing.
    • Change value(s) of attribute operation on the thresholdRisk attribute.

Route configuration

Go to the Routes panel and create a routing context with the following definition:

<routes xmlns="http://camel.apache.org/schema/spring" xmlns:u="http://www.systar.com/aluminium/camel-util">
    <route>
        <from uri="timer://foo?repeatCount=1"/>
        <setBody>
            <u:map-create>
                <u:map-entry key="myThreshold">
                    <!-- Expression for Thresholds (Decimal) -->
                    <u:map-create>
                        <u:map-entry key="rules">
                            <u:list-create>
                                <u:map-create>
                                    <u:map-entry key="classifier">
                                        <simple>CRITICAL</simple>
                                    </u:map-entry>
                                    <u:map-entry key="threshold">
                                        <simple>8</simple>
                                    </u:map-entry>
                                    <u:map-entry key="included">
                                        <simple>false</simple>
                                    </u:map-entry>
                                </u:map-create>
                                <u:map-create>
                                    <u:map-entry key="classifier">
                                        <simple>WARNING</simple>
                                    </u:map-entry>
                                    <u:map-entry key="threshold">
                                        <simple>6</simple>
                                    </u:map-entry>
                                    <u:map-entry key="included">
                                        <simple>false</simple>
                                    </u:map-entry>
                                </u:map-create>
                                <u:map-create>
                                    <u:map-entry key="classifier">
                                        <simple>NORMAL</simple>
                                    </u:map-entry>
                                    <u:map-entry key="threshold">
                                        <simple>3</simple>
                                    </u:map-entry>
                                    <u:map-entry key="included">
                                        <simple>true</simple>
                                    </u:map-entry>
                                </u:map-create>
                                <u:map-create>
                                    <u:map-entry key="classifier">
                                        <simple>WARNING</simple>
                                    </u:map-entry>
                                    <u:map-entry key="threshold">
                                        <simple>2</simple>
                                    </u:map-entry>
                                    <u:map-entry key="included">
                                        <simple>true</simple>
                                    </u:map-entry>
                                </u:map-create>
                                <u:map-create>
                                    <u:map-entry key="classifier">
                                        <simple>CRITICAL</simple>
                                    </u:map-entry>
                                </u:map-create>
                            </u:list-create>
                        </u:map-entry>
                    </u:map-create>
                </u:map-entry>
                <u:map-entry key="updateTime">
                    <simple resultType="org.joda.time.ReadableInstant">2016-06-20T00:00:00</simple>
                </u:map-entry>
            </u:map-create>
        </setBody>
        <to uri="tnd-absorption:addThresholdRisk"/>
    </route>
</routes>

 

WebService configuration

When invoked from a WebService, use the following query parameter:

{
    "rules": [
      {
        "classifier": "CRITICAL",
        "threshold": 8,
        "included": false
      },
      {
        "classifier": "WARNING",
        "threshold": 6,
        "included": false
      },
      {
        "classifier": "NORMAL",
        "threshold": 3,
        "included": true
      },
      {
        "classifier": "WARNING",
        "threshold": 2,
        "included": true
      },
      {
        "classifier": "CRITICAL"
      }
    ],
  "updateTime": "2016-06-20T00:00:00"
}

Related Links