Versions Compared

Key

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

...

Code Block
languagexml
<templateDomain name="TemperatureAnalysis">
    <description>Temperature Analysis Description</description>
 
  <templates>
   
    <template name="Template1Maximum Temperature">
     
      <description>To check averagemaximum room temperature within specified time window of all rooms</description>
            <executionPlan>
<executionPlan><![CDATA[
               <![CDATA[                 /* Enter a unique ExecutionPlan */
                                @Plan:name('testPlan')
                
/* Enter a unique description for ExecutionPlan */                            -- @Plan:description('ExecutionPlan')   /* Enter a unique description for ExecutionPlan */
       /* define streams and write query here ... */                 -- @Import@Plan:description('inStream:1.0.0ExecutionPlan')
                define
stream inStream (temperature double, roomNumber int);                              /* define streams and write query here ... */
                
                                @Import('inStream:1.0.0')
                                define stream inStream (meta_temperature double, meta_roomNumber int);
                
                                @Export('outStream:1.0.0')
                                define stream outStream (meta_temperature double, meta_roomNumber int);
                
                                from inStream[meta_temperature > $maxVal]
                                select meta_temperature,meta_roomNumber
                                insert into outStream;
                                 ]]></executionPlan>
      <parameters>
        <parameter name="maxVal" type="int">
          <displayName>Maximum Temperature</displayName>
          <description>Maximum room temperature threshold</description>
          <defaultValue>75</defaultValue>
        </parameter>
      </parameters>
    </template>
  </templates>
  <streams>
    <stream>
                        {
                        "streamId": "inStream:1.0.0",
                        "name": "inStream",
                        "version": "1.0.0",
                        @Export('outStream:1.0.0')"nickName": "",
                define stream outStream (temperature double, roomNumber int);  "description": "",
              from inStream#window.time($timeInterval)         "metaData": [
      select avg(temperature) as temperature,roomNumber               {
 group by roomNumber 				having temperature>= $maxVal 				insert into outStream;               "name": "temperature",
  ]]>             </executionPlan>         "type": "DOUBLE"
  <parameters>                 <parameter name="maxVal" type="int">   },
                 <displayName>Maximum Temperature</displayName>      {
               <description>Maximum Temperature which needs to be checked</description>   "name": "roomNumber",
                <defaultValue>75</defaultValue>        "type": "INT"
       </parameter>                 <parameter}
name="timeInterval" type="time">                     <displayName>Time Interval</displayName> ],
                   <description>Time can be defined such 5 sec, 1 min and etc</description>"correlationData": [],
                         <defaultValue>1 min</defaultValue>"payloadData": []
                 </parameter>       }
     </parameters>         </template>      </templates>stream>
    <streams>
<stream>
       <stream>             {             "streamId": "inStream:1.0.0",{
              "name": "inStream",             "versionstreamId": "outStream:1.0.0",
              "nickName": "",             "descriptionname": "outStream",
                 "metaData": [          "version": "1.0.0",
 {             "name": "temperature",             "typenickName": "DOUBLE",
                  },          "description": "",
 {             "name": "roomNumber",             "typemetaData": "INT" [
                 }           {
 ],             "correlationData": [],             "payloadDataname": "temperature",
[]             }         </stream>      "type": "DOUBLE"
 <stream>             {             "streamId": "outStream:1.0.0", },
               "name": "outStream",            {
"version": "1.0.0",             "nickName": "",             "descriptionname": "roomNumber",
                    "metaData": [       "type": "INT"
    {             "name": "temperature",           }
   "type": "DOUBLE"             },           ],
 {             "name": "roomNumber",             "typecorrelationData": "INT" [],
                }            "payloadData": [],
                "correlationData": [],           }
 "payloadData": []             }         </stream>
 
  </streams>
</templateDomain>

...