How to inject Baseline values

This cookbook applies for new Baseline type and will not work for old one.

Context

You want to inject Baseline values from Data Integration or WebService.

Observed attribute configuration

 

  1. On the main menu, click the cog icon > Model & configuration. On the left menu, click Entities.
  2.  Add a new observed attribute to the Process entity:
    • Name: myBaseline
    • Type: Boolean (Decimal)
    • Typical: 1 hour of 1 day

Mapping configuration

  1. On the main menu, click the cog icon > Data integration. On the left menu, click Mappings.
  2. Create a mapping configuration with the following settings:
    • Name: addBaselineDecimal
    • A Baseline (Decimal) parameter named myBaselineValue
    • An Instant parameter named updateTime
    • An Instance operation on entity Process
    • Operation begin uses the updateTime parameter
    • Operation end is set to UNTIL_CHANGED
    • In the Resolution area, name is a constant set to Outgoing
    • Change value(s) of attribute operation on myBaseline 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="myBaselineValue">
                    <!-- Expression for Baseline (Decimal) -->
                    <u:map-create>
                        <u:map-entry key="average">
                            <constant>13</constant>
                        </u:map-entry>
                        <u:map-entry key="standardDeviation">
                            <constant>1.2</constant>
                        </u:map-entry>
                    </u:map-create>
                </u:map-entry>
                <u:map-entry key="updateTime">
                    <simple resultType="org.joda.time.ReadableInstant">2016-02-05T14:00:00</simple>
                </u:map-entry>
            </u:map-create>
        </setBody>
        <to uri="tnd-absorption:addBaselineDecimal"/>
    </route>
</routes>

 

WebService configuration

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

{
  "myBaselineValue": {"average":"13", "standardDeviation":"1.2"},
  "updateTime": "2016-02-05T14:00:00"
}

Related Links