What is a System ID?
Jira Legacy | ||||||||
---|---|---|---|---|---|---|---|---|
|
How is Sid named (defined by model definition?)
How is Sid value assigned (give in model definition or assigned by the system automatically?)
Does Sid ever change?SystemId or Sid is unique identifier that is automatically assigned by TQLEngine to every newly created Model Instance. It is of type "String" and is defined as following within TQLEngine.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<Def name="System" inherits="Entity" documentation="Marker of all system types"/>
<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.
Model developers can create attribute of type SystemId or Sid.
In this example: PhidServoId is defined as Sid.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<ThingModel Name="PhidgetServoModel" Combines="PhidgetServoFacet">
<Sid Name="PhidServoId"/>
</ThingModel> |
When the Model Instance is created, using Create TQL Query, System ID is automatically generated by TQLEngine.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<Query>
<Create>
<PhidgetServoModel>
<ServoProtocolURL>
phid://
</ServoProtocolURL>
<PhidgetDeviceType>
PhidgetAdvancedServo
</PhidgetDeviceType>
<DeviceInterfaceIndex>
0
</DeviceInterfaceIndex>
<ServoAngle>
110
</ServoAngle>
</PhidgetServoModel>
</Create>
</Query> |
Using the Find TQL Query on PhidgetServoModel
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<Query>
<Find>
<PhidgetServoModel>
<PhidServoId ne="" />
</PhidgetServoModel>
</Find>
</Query> |
Find Result is:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<Find Status="Success">
<Result>
<PhidgetServoModel>
<PhidServoId>KNI5JYVPAAAAUAABA4ONNHF2</PhidServoId>
<PhidgetDeviceType>PhidgetAdvancedServo</PhidgetDeviceType>
<ServoAngle>110</ServoAngle>
<DeviceInterfaceIndex>0</DeviceInterfaceIndex>
<ServoProtocolURL>phid://</ServoProtocolURL>
</PhidgetServoModel>
</Result>
</Find> |
Note that PhidServoId is automatically generated even though it is NOT specified at the time of Create Query
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<PhidServoId>KNI5JYVPAAAAUAABA4ONNHF2</PhidServoId> |
About System ID:
- Are Unique per Installation of TQLEngine: System ID Values are guaranteed to be Unique for a given Installation of TQLEngine.
- Can neither be created or modified by user: If an attribute is defined of type Sid or SystemId, their values can neither be specified or updated by the user.
- New Values are generated each time for same model: Each time an instance is deleted and created again new value System ID value.