Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

DOS provides the following out-of-the-box message handlers

Handler Name

Description

Writing customer handlers

Standard Event Structure

...

languageyaml

...

AST_DOS_MessageProcessingHandler_Activity

This handler does a simple 1:1 mapping of source fields to the destination field.

AST_DOS_MessageProcessingHandler_OPC_Activity

This handler parses the OPC data and maps each parsed NodeID structure into attribute names. It takes values from NodeValue.

NodeID Structure:

#ns=2;s=Channel1.Device2.\USSAV1S01HST\AirCompressor_CMP02_Current_Average

  1. The algorithm is to look for last “\” and take the string from this location to the end of the string. In the above example, it takes AirCompressor_CMP02_Current_Average

  2. Extracted last field is further broken down based user-provided SourceFieldFilterPattern

Writing customer handlers

Standard Event Overall Structure
Gliffy
imageAttachmentIdatt1957494787
baseUrlhttps://atomiton.atlassian.net/wiki
macroId42616c95-5c32-4f58-8a1c-2642052b30b7
displayNameStandard Event Structure
nameDOF-End-2-End-Flow
diagramAttachmentIdatt1957363718
containerId1423933445
timestamp1596304492741
Standard Event Schema Definition
Code Block
languageyaml
#
xs:element(name: updatesaveentity):
    xs:complexType:
      xs:sequence:
        xs:element(name: request):
          xs:complexType:
            xs:sequence:
              xs:element(name: entity, maxOccurs: unbounded):
                xs:complexType:
                  xs:all:
                    xs:element(name: find):
                      xs:complexType:
                        xs:sequence:
                          xs:element(name: entity):
                            xs:complexType:
                              xs:all:
                                xs:element(name: entitytype):
                                  xs:simpleType:
                                    xs:restriction(base: "xs:string"):
                                      xs:pattern(value: "([a-zA-Z])+");
                                xs:element(name: filter):
                                  xs:complexType:
                                    xs:sequence:
                                      xs:any(maxOccurs: unbounded, minOccurs: 1, processContents: skip);
                    xs:element(name: entitytype):
                      xs:simpleType:
                        xs:restriction(base: "xs:string"):
                          xs:pattern(value: "([a-zA-Z])+");
                    xs:element(name: body):
                      xs:complexType:
                        xs:sequence:
                          xs:any(maxOccurs: unbounded, minOccurs: 1, processContents: skip);
Example of Generated Standard Event
Multiple different entities with the same entity

When different entities can be packed within a body; EntityType will be ignored and not used.

Code Block
UpdateSaveEntity:
  Request:
    Entity:
      EntityType: Not used
      Body:
        AirCompressor:
          AirCompId: CMP02
          PowerAttrs:
            CurrentAverage: 0.0
            LineFrequency: 57.6
            PowerConsumption: 0.0
            PowerFactor: 57.6
            VoltageAverage: 57.6
        Boiler:
          BoilerId: B001
          PowerAttrs:
            CurrentAverage: 0.0
            LineFrequency: 57.6
            PowerConsumption: 0.0
            PowerFactor: 57.6
            VoltageAverage: 57.6
        HTPanel:
          HTPanelId: HT02
          PowerAttrs:
            CurrentAverage: 0.0
            LineFrequency: 0.0
            PowerConsumption: 0.0
            PowerFactor: 0.0
An array of Similar Entity Types

In the example below an array of AirQuality models are packaged with EntityType as EnvironmentSensor

Code Block
#
UpdateSaveEntity:
  Request:
    Entity:
      entityType: EnvironmentSensor
      body:
        airQuality:
          reading:
            o3:
              Value: 4440.0
            pm1:
              Value: 15
            pm2p5:
              Value: 16
            so2:
              Value: 1110.0
            pm10:
              Value: 17
        Label: 15000024
        barometer:
          reading:
            pressure:
              Value: 111111
        ambientHumidity:
          reading:
            relativeHumidity:
              Value: 44.77
        geocoordinates:
          latitude: 55.724915
          longitude: 12.4730643
        ambientTemperature:
          reading:
            temperature:
              Value: 70
        parentDomain: Environment
        applicableDomain: Environment
        thirdPartyId: 15000024
        ambientNoise:
          reading:
            noise:
              Value: 55.33
        providerDetails:
          provider: uRad
         

...

 providerId: uRadEnvironmentProvider
        

...

tenantId: ckcaws.com
        LastUpdated: 1548913485000
    

...

    deviceState:
          

...

connState:
            connected: true
      

...

      Since: 1575297029602
    Entity:
      

...

entityType:

...

 EnvironmentSensor
      body:
        airQuality:
   

...

 

...

      reading:
            no2:
   

...

           Value: 6080.0
            

...

o3:

...


              Value: 9050.0
           

...

 pm1:
              Value: 21
            

...

pm2p5:
              Value: 22
            pm10:
 

...

             Value: 23
        Label: 15000025
        

...

barometer:
          reading:
            pressure:
              

...

Value: 98989
        ambientHumidity:
          reading:
            relativeHumidity:
     

...

         Value: 88.77
        geocoordinates:
          latitude: 55.724917
          

...

longitude:

...

 12.4730644
        ambientTemperature:
          reading:
            

...

temperature:
              Value: 98.14
        parentDomain: Environment
        applicableDomain: Environment
     

...

   thirdPartyId: 15000025
        ambientNoise:
          reading:
            

...

noise:
              Value: 99.88
        providerDetails:
          provider: uRad
   

...

 

...

 

...

 

...

 

...

 

...

  providerId: uRadEnvironmentProvider
        tenantId: ckcaws.com
       

...

 LastUpdated: 1548913444000
        deviceState:
          connState:
 

...

           connected: true
            

...

Since:

...

 1575297029605
Creating Standard Event
Code Block
languageyaml
$stdeventcontent = MLP.newMl();  #Create a new Map List Structure to hold the Standard Event
$stdeventcontent.EntityType = $F.context.EntityType; # Set the entity Type from either the context (if available) to derived from fields.
foreach (value: var $mapfield, in: $msghandlerInfo.MapFields.Field):          

...

 # while looping through the mapfileds and generating desitnation fields..
    ......
    $stdeventcontent.Body.{$mapfield.DestinationFieldName} = $srcValue;  

...

      # Set the Body of the event; All 

...

the mapped fields will be added within the body 

...

$stdevent.UpdateSaveEntity.Request.Entity = $stdeventcontent;                  # Now Set the overall container 

...

i.e. UpdateSaveEntity with generated standard event content

Filter Functions

Description of DOS Configuration Parameters

...