Object Methods and Fields
brefs
obj.brefs
Description
This field corresponds to a table that can be used for retrieving the back-references of an inmation object. Each entry in this table is in itself a table, corresponding to one reference. Each reference has three fields: name, path, and type. Check syslib.getbackreferences() function for a list of all the existing types.
Examples
The following is an example how back-references of an existing object can be retrieved:
local obj = syslib.getobject("/System/Core/object")
return obj.brefs
The back-references table and its sub-tables are read-only tables. Any attempt to add new entries to them will result in an error. Any alternation to their existing fields will get ignored when calling obj:commit(). To alter back-references of an object, use obj.refs or syslib.setreferences() on the referencing objects. |
The first time this field is accessed, it captures the state of the object back-references. Afterwards, any updates to the back-references of the object will not be reflected upon subsequent accesses. |
comm_empty
obj:comm_empty()
Description
Returns true if the communication state of the object is "empty", will return false if not. Corresponds to the ModUserState flag mask that indicates the direct colour state of objects in the UI.
comm_error
obj:comm_error()
Description
Returns true if the communication state of the object is "error", will return false if not. Corresponds to the ModUserState flag mask that indicates the direct colour state of objects in the UI.
comm_good
obj:comm_good()
Description
Returns true if the communication state of the object is "good", will return false if not. Corresponds to the ModUserState flag mask that indicates the direct colour state of objects in the UI.
comm_neutral
obj:comm_neutral()
Description
Returns true if the communication state of the object is "neutral", will return false if not. Corresponds to the ModUserState flag mask that indicates the direct colour state of objects in the UI.
comm_warning
obj:comm_warning()
Description
Returns true if the communication state of the object is "warning", will return false if not. Corresponds to the ModUserState flag mask that indicates the direct colour state of objects in the UI.
classmismatch
obj:classmismatch()
Description
Returns true if the local and remote class versions mismatch, will return false if not. Corresponds to the ModUserState flag mask that indicates the direct colour state of objects in the UI.
commit
obj:commit()
Description
See the examples for the functions syslib.createobject() and syslib.getobject().
deleted
obj:deleted()
Description
Returns true if the object is deleted, will return false if not. Corresponds to the ModUserState flag mask that indicates the direct colour state of objects in the UI.
dynamic
obj:dynamic()
Description
Returns true if the object has dynamic properties, will return false if not. Corresponds to the ModUserState flag mask that indicates the direct colour state of objects in the UI.
empty
obj:empty()
Description
Returns true if the state of the object is "empty", will return false if not. Corresponds to the ModUserState flag mask that indicates the direct colour state of objects in the UI.
enabled
obj:enabled()
Description
Returns true if the object is enabled, will return false if not. Corresponds to the ModUserState flag mask that indicates the direct colour state of objects in the UI.
error
obj:error()
Description
Returns true if the state of the object is "error", will return false if not. Corresponds to the ModUserState flag mask that indicates the direct colour state of objects in the UI.
exploring
obj:exploring()
Description
Returns true if the object is exploring, will return false if not. Corresponds to the ModUserState flag mask that indicates the direct colour state of objects in the UI.
good
obj:good()
Description
Returns true if the state of the object is "good", will return false if not. Corresponds to the ModUserState flag mask that indicates the direct colour state of objects in the UI.
has_objref
obj:has_objref()
Description
Returns true if the object has object references, will return false if not. Corresponds to the ModUserState flag mask that indicates the direct colour state of objects in the UI.
has_secref
obj:has_secref()
Description
Returns true if the object has security references, will return false if not. Corresponds to the ModUserState flag mask that indicates the direct colour state of objects in the UI.
modified
obj:modified()
Description
Returns the same three values as the created method does, only that they concern last modification information.
neutral
obj:neutral()
Description
Returns true if the state of the object is "neutral", will return false if not. Corresponds to the ModUserState flag mask that indicates the direct colour state of objects in the UI.
refs
obj.refs
Description
This is a field corresponding to a table that can be used for creating and modifying the references of an inmation object. Each entry in this table is itself a table, corresponding to one reference. Each reference has three fields: name, path, and type. Only the path field is mandatory.
Examples
The following is an example how references can be set on a new object:
local a = syslib.createobject("/System/localhost", "MODEL_CLASS_ACTIONITEM")
a.ObjectName = "new"
a.AdvancedLuaScript = "return syslib.getvalue('A')"
a.refs = { { name = 'A', path = syslib.slf():path() } }
a:commit()
return 'OK'
This will create an action item with a reference to self named A
. The type, when not specified, defaults to
"OBJECT_LINK"
(triggering). Check the syslib.setreferences() function for a
list of all the existing types. The following example shows how to modify existing references – delete all of them in
this case – and also inspect what references are present:
local a = syslib.getobject("/System/localhost/new")
local old = a.refs
a.refs = {}
a:commit()
return old[1].path
When a refs field is set, as in the examples above, it must be set to a table; setting it to anything else, including nil, will make the object not-committable. The same applies to the content of refs table: it must only contain tables, and those in turn must contain at least the path field.
It is also possible not to set or reset the entire refs table as in the examples above, but manipulate individual entries directly, via a.refs[1] = … or via a.refs[1].path = … |
The first time this field is accessed, it captures the state of the object references. Afterwards, any updates to the references of the object will not be reflected upon subsequent accesses. |
registering
obj:registering()
Description
Returns true if the object is registering, will return false if not. Corresponds to the ModUserState flag mask that indicates the direct colour state of objects in the UI.
state
obj:state()
Description
Returns the Object State bitmask as an integer. See the ModObjectState flag group for more details.
type
unconfirmed
obj:unconfirmed()
Description
Returns true if the state of the object is "unconfirmed", will return false if not. Corresponds to the ModUserState flag mask that indicates the direct colour state of objects in the UI.
warning
obj:warning()
Description
Returns true if the state of the object is "warning", will return false if not. Corresponds to the ModUserState flag mask that indicates the direct colour state of objects in the UI.