Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 57 Next »

 Expand to see legends and methodology

Unable to render {include} The included page could not be found.

Go to page

TmNamespace TmContent Macro
Example
<Macro name="RetryQuery">
  <Argument>
    <MaxRetries>10</MaxRetries>
    <StatusFrom>Save,Update</StatusFrom>
  </Argument>
  <Result>
    <NewLocalData>
      <MaxRetries>[:$Macro.Argument.MaxRetries:]</MaxRetries>
      <StatusFrom>[:$Macro.Argument.StatusFrom:]</StatusFrom>
      <RetryScript>
        <JavaScript>
           <Response>
               <Include>$Response.Message.Value</Include>
           </Response>
           <Retry>
               <Include>$Macro.Argument</Include>
               <Include>$LocalData.RetryScript</Include>
           </Retry>
var result = null;
var max_retries = [:$LocalData.MaxRetries:];
if(--max_retries [:ge:] 0)
{
    sffContext.setLocalData("MaxRetries", max_retries);
    var check = Str.static.listSplitChar("[:$LocalData.StatusFrom:]", ", ", Str.static.SPL_TRIM);
    for each (var path in check)
    {
        var key = Str.static.listSplitChar(path, ".", Str.static.SPL_TRIM);
        key.add("Status");
        for each (var status in Response.iterValues(key))
        {
            sffLog.info("RetryQuery(%s): Checking %s=%s", [~~max_retries, key, status]);
            if(typeof status == "string" [:and:] status.startsWith("Failure"))
            {
                result = Retry;
                break;
            }
        }
    }
}
result;
         </JavaScript>
      </RetryScript>
    </NewLocalData>
    <Include>$Macro.Argument</Include>
    <Include>NewLocalData.RetryScript</Include>
  </Result>
</Macro>

 


Referenced by:


Namespace, TQL model content, Macro

  • TmContent.TmNamespace: nested namespace

TmDataContent (Data)
Example

<DataModel Name="Region">

            <Sid name="RegionID" />

            <String name="Name" />

            <String name="Description" />

            <BoundingBox name="Area"/>

            <Person name="Manager"/>

            <Person name="Owner"/>

</DataModel>


Referenced by:


TmDataContent

  • Inherits: Inheritance descriptor.
  • Combine:
  • TmDataAttribute: TQL data model attribute definition.
  • StandAloneConstraint: Stand-alone constraint definition.
  • TmUnique: Unique constraint definition.

TmThingContent (Thing)
Example

<ThingModel name="GPSModel" combines="GPSFacet">

            <Sid name="GPSID" />

</ThingModel>

<ThingFacet Name="GPSFacet">

    <String name="Payload" knownBy="SubscribeGPS" update="auto"/>

    <Double name="latitude" knownBy="SubscribeGPS"/>

    <Double name="longitude" knownBy="SubscribeGPS"/>

    <Number name="Direction" knownBy="SubscribeGPS" />

    <Number name="Speed" knownBy="SubscribeGPS" />

    <Boolean name="Simulated" />

    <String name="SensorURL" />

    <String name="SensorInterfaceIndex" />

    <String name="SensorInterfaceType" />

    <AA>[:#o#Output.ActionArgument:]</AA>

    <Action Name="SubscribeGPS"

            Documentation="Start the subscription to sensors data">

            ...

</ThingFacet>


Referenced by:


TmThingContent

  • Inherits: Inheritance descriptor.
  • Combine:
  • TmThingAttribute: TQL thing model attribute definition.
  • StandAloneConstraint: Stand-alone constraint definition.
  • TmUnique: Unique constraint definition.
  • TmAction: Thing action definition

TmAppContent (App)
Example

<AppModel Name="OptimumValueAlgorithmModel" combines="OptimumValueAlgorithm">

      <Sid Name="OptimumValueAlgorithmID" />

      <Integer name="currentTemp"/>

      <Integer name="currentHumidity"/>

</AppModel>


<AppFacet name="OptimumValueAlgorithm">
    <DateTime name="time" format="$SimpleDateFormat(yyyy-MM-dd'T'HH:mm:ss.SSS'Z')"  KnownBy="RunAlgorithm"/>
        
    <Action name="RunAlgorithm">
        <Workflow Limit="1" Live="1">
            <Task name="Main" while="true">
                <Event name="Argument" as="ActionArgument"/>
                
                <!-- <Log waitFor="Argument" Message="Got Arguments : [:Event.Argument:]"/> -->
                
                <Invoke Name="CreateCommand" waitFor="Argument">
                    <JavaScript>
                        var command = "java -jar [:RuntimeParams.LibDir:]OptimumFarmValueCalculator.jar";
                        
                        var currentTemp = String(Event.Argument.currentTemp.Value);
                        var currentHumidity = String(Event.Argument.currentHumidity.Value);
                        var outputFile = String("[:RuntimeParams.ConfigDir:]OptimumFarmValues.txt");
                        
                        //sffLog.info("Before calling jar file  : " + command);
                        
                        command = command.concat(" "+currentTemp + " "+currentHumidity);
                        command = command.concat(" \"" + outputFile + "\"");
                        
                        sffLog.info("Command to call Optimum value Algorithm : " + command);
                        command;
                    </JavaScript>
                </Invoke>
                
                <Invoke name="ExecuteCommand" execute="[:Invoke.CreateCommand:]"/>
                
                <!-- <Log Message="Check Command Status : [:Invoke.ExecuteCommand:]"/> -->
                
                <Output name="Result" as="ActionResult">
                    <Value>
                        <time>[:Event.Argument.time.Value:]</time>
                    </Value>
                </Output>
                
            </Task>
        </Workflow>
    </Action>
</AppFacet>


Referenced by:


TmAppContent

  • Inherits: Inheritance descriptor.
  • Combine:
  • TmThingAttribute: TQL thing model attribute definition.
  • StandAloneConstraint: Stand-alone constraint definition.
  • TmUnique: Unique constraint definition.
  • TmAction: Thing action definition.

TmUnique
Example

<ThingFacet Name="PhidgetRFID">

    <Sid Name="RFIDId" />

    <String Name="ReadTag" Update="auto" KnownBy="PhidgetReadRFIDTagAc" />

    <String Name="WriteTag" KnownBy="PhidgetWriteRFIDTagAc" />

    <String Name="RFIDURL" Default="phid://" />

    <String Name="InterfaceType" />

    <String Name="InterfaceIndex" />

    <Unique Name="RFIDIndex" Value="InterfaceIndex" />

    <DateTime Name="timestamp" Format="$SimpleDateFormat(yyyy-MM-dd'T'HH:mm:ss'Z')" />

    <AA>[:#o#Output.ActionArgument:]</AA>

    <Action Name="PhidgetReadRFIDTagAc" Documentation="Read the Tag Automatically in the vicinity">

...

 


Referenced by:


Unique constraint definition

  • Name: Name is optional.
  • Value: List of attribute names.

TmDataAttribute
Example

 


Referenced by:


TmDataAttribute

  • Attribute: Cherry-picked attribute definition.

TmDataAtom
Example

 


Referenced by:

TmDataComposite
Example

 


Referenced by:

TmDataAdHocComposite
Example
 

Referenced by:

Ad-hoc/untyped composite attribute

TmAttributeBase
Example

 


Referenced by:


TmAttributeBase

  • Name: Model attribute name.
  • Cardinality: Nested cardinalities are not yet supported.
  • Format: Attribute value format specifier.
  • Codec: Attribute value coder/decoder specifier.
  • InlineConstraint: Inline constraint.

TmThingAttribute
Example

 


Referenced by:


TmThingAttribute

  • Attribute: Cherry-picked attribute definition.

TmThingAtom
Example

 


Referenced by:


TmThingAtom

  • Update: Currently only 'auto' value is supported.
  • KnownBy: Associated action[s] name[s], comma-separated list.

TmThingComposite
Example

 


Referenced by:


TmThingComposite

  • Update: Currently only 'auto' value is supported.
  • KnownBy: Associated action[s] name[s], comma-separated list.

TmThingAdHocComposite
Example

 


Referenced by:


Ad-hoc/untyped composite attribute

TmAction
Example

 


Referenced by:


TQL model action

Condition
Example

 


Referenced by:

ConditionExpression
Example

 


Referenced by:

ConstraintContent
Example

 


Referenced by:

StandAloneConstraint

NestedConstraint

InlineConstraint
Example

 


Referenced by:

 

 

  • No labels