What is a System ID?
Jira Legacy |
---|
showSummary | false |
---|
server | JIRA (mqidentity.atlassian.net) |
---|
serverId | 77fb3325-4051-36d9-bcc7-761f62050707 |
---|
key | DOCS-19 |
---|
|
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 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 |
---|
language | ruby |
---|
theme | Emacs |
---|
title | System ID Definiton |
---|
linenumbers | true |
---|
|
#
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 define attribute of type SystemId or Sid.
In this example: PhidServoId is defined as Sid.
Code Block |
---|
language | ruby |
---|
theme | Emacs |
---|
title | PhidServoId defined as System ID |
---|
linenumbers | true |
---|
|
#
ThingModel(Name: "PhidgetServoModel", Combines: "PhidgetServoFacet")
Sid(Name: "PhidServoId") |
When the Model Instance is created, using Create TQL Query, System ID value is automatically generated by A-Stack.
Code Block |
---|
language | ruby |
---|
theme | Emacs |
---|
title | Create Phidget Servo Thing Model Instance |
---|
linenumbers | true |
---|
|
#
Query:
Create:
PhidgetServoModel:
ServoProtocolURL: "phid://"
ServoProtocolURL:
PhidgetDeviceType: "PhidgetAdvancedServo"
DeviceInterfaceIndex: 0
ServoAngle: 110 |
Using the Find TQL Query on PhidgetServoModel
Code Block |
---|
language | ruby |
---|
theme | Emacs |
---|
title | Find Phidget Servo Model |
---|
linenumbers | true |
---|
|
#
Query:
Find:
PhidgetServoModel:
PhidServoId(ne: "") |
Find Result is:
Code Block |
---|
language | ruby |
---|
theme | Emacs |
---|
title | Find Result Phidget Servo Model |
---|
linenumbers | true |
---|
|
#
Find(Status="Success"):
Result:
PhidgetServoModel:
PhidServoId: "KNI5JYVPAAAAUAABA4ONNHF2"
PhidgetDeviceType: "PhidgetAdvancedServo"
ServoAngle: 110
DeviceInterfaceIndex: 0
ServoProtocolURL: "phid://" |
Note that the PhidServoId value is automatically generated even though it is NOT specified at the time of Create Query
Code Block |
---|
language | ruby |
---|
theme | Emacs |
---|
title | Automatically Generated System ID |
---|
linenumbers | true |
---|
|
#
PhidServoId: "KNI5JYVPAAAAUAABA4ONNHF2" |
About System ID:
- Have unique values per Installation of A-Stack: System ID Values are guaranteed to be Unique for a given Installation of A-Stack.
- Value can neither be given 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.