Versions Compared

Key

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

SystemId or Sid is a unique identifier automatically assigned by A-Stack to every newly created Model Instance. It is of type "String" and is defined as the following in TQL.

Code Block
languagexmlruby
themeEmacs
titleSystem ID Definiton
linenumberstrue
<Def#
Def(name=: "System", inherits=: "Entity", documentation=: "Marker of all system types"/>
<Def name=)
Def(name: "SystemId", alt=: "sid", inherits=: "String,System"/>)

Note: SystemId and Sid are synonyms. For the purpose of this document will use Sid when referring to System ID.

...

In this example: PhidServoId is defined as Sid.

Code Block
languageruby
themexmlEmacs
titlePhidServoId defined as System ID
linenumberstrue
<ThingModel#
ThingModel(Name=: "PhidgetServoModel", Combines=: "PhidgetServoFacet">)
  <Sid Name=Sid(Name: "PhidServoId"/>
</ThingModel>)


When the Model Instance is created, using Create TQL Query, System ID value is automatically generated by A-Stack.

Code Block
languageruby
themexmlEmacs
titleCreate Phidget Servo Thing Model Instance
linenumberstrue
<Query>#
Query:
 <Create> Create:
   <PhidgetServoModel> PhidgetServoModel:
     <ServoProtocolURL>         ServoProtocolURL: "phid://"
      </ServoProtocolURL>
      <PhidgetDeviceType>
        PhidgetAdvancedServoServoProtocolURL:
		PhidgetDeviceType: "PhidgetAdvancedServo"
      </PhidgetDeviceType>
      <DeviceInterfaceIndex>
        DeviceInterfaceIndex: 0
      </DeviceInterfaceIndex>
      <ServoAngle>
        110
      </ServoAngle>
    </PhidgetServoModel>
  </Create>
</Query>ServoAngle: 110

Using the Find TQL Query on PhidgetServoModel

Code Block
languagerubyxml
themeEmacs
titleFind Phidget Servo Model
linenumberstrue
<Query>#
Query:
 <Find> Find:
   <PhidgetServoModel> PhidgetServoModel:
     <PhidServoId PhidServoId(ne="" />
    </PhidgetServoModel>
  </Find>
</Query>)


Find Result is:

Code Block
languageruby
themexmlEmacs
titleFind Result Phidget Servo Model
linenumberstrue
<Find#
Find(Status="Success">):
  <Result>Result:
    <PhidgetServoModel>PhidgetServoModel:
      <PhidServoId>KNI5JYVPAAAAUAABA4ONNHF2</PhidServoId>
PhidServoId: "KNI5JYVPAAAAUAABA4ONNHF2"
     <PhidgetDeviceType>PhidgetAdvancedServo</PhidgetDeviceType> PhidgetDeviceType: "PhidgetAdvancedServo"
    <ServoAngle>110</ServoAngle>    ServoAngle:   <DeviceInterfaceIndex>0<110</DeviceInterfaceIndex>ServoAngle>
      <ServoProtocolURL>phid://</ServoProtocolURL>DeviceInterfaceIndex: 0
    </PhidgetServoModel>  ServoProtocolURL: </Result>
</Find>"phid://"


Note that the PhidServoId value is automatically generated even though it is NOT specified at the time of Create Query

...