System Attributes

System attributes are reserved attributes of the Citeck platform, available for any entity regardless of its type. They start with the _ character and provide service information: entity metadata, access rights, status, attribute meta-information, and also control the behavior of read and write operations.

System attributes are used in the same contexts as regular attributes: in Records API, journal and form configuration, computations, and business processes.

Attribute

Description

_null

always returns null

_type

returns the entity type

_notExists

returns true if the entity does not exist

_has

check whether something is present in the value. For example:
permissions._has.Write?bool
check whether the current user has permission to edit the entity

_edge

get meta-information about an attribute (name, title, ability to view, ability to edit, etc.):
_edge.title.protected?bool
for example, to check whether an attribute is protected from editing

_alias

entity alias used on submit. Used when multiple related entities need to be created at once.
Since the IDs of new entities become known only after they are actually created, a placeholder ID is required to reference them in attributes.
For example, suppose we want to create 2 entities:
[
  {"id": "emodel/some-type@", "attributes": {"link": "alias-value-0"}},
  {"id": "emodel/some-type@", "attributes": {"_alias": "alias-value-0"}}
]
The engine creates entities from the end. That is, it first creates:
{"id": "emodel/some-type@", "attributes": {"_alias": "alias-value-0"}}
it receives the identifier of the new entity emodel/some-type@123-123-123-123 and iterates through the entities,
that will be created next and replaces all alias-value-0 occurrences with the real ID emodel/some-type@123-123-123-123.
That is, the second entity is submitted for creation already as:
{"id": "emodel/some-type@", "attributes": {"link": "emodel/some-type@123-123-123-123"}}

_parent

association to the parent entity

_parentAtt

parent attribute used to create the parent → child entity reference

_formKey

form key (in plural form) that can be used for editing the entity, listed in descending priority order.
Allows linking entities without an ECOS type to forms (e.g., legacy tasks).

_modified

entity modification date

_modifier

user who modified the entity

_statusModified

date of the last status change for the record

_created

entity creation date

_creator

user who created the entity

_content

entity content

_actions

actions

_docNum

document number generated according to the numbering template defined in the type

_status

current status

_stage

stage

_status?str

ID of the current status

_name

attribute that returns the display name of the entity.
It is computed as follows:
1. Если в конфиге типа есть dispNameTemplate, то имя будет вычислено на его основе
2. Если в типе есть атрибут с id=name и в сущности это поле не пустое, то его значение будет значением _name
3. Берётся name типа
4. Берётся id типа
The computed _name value is always saved to the database and can be used for search

_self

attribute that represents the value itself.
That is, _self._self._self._self._self is the same as _self._self.
Used:
1. Там, где значение — примитив (строка, число), но его нужно отредактировать на форме (форма может редактировать только атрибуты). В этом случае можно добавить на форме атрибут _self.
2. Там, где нужно сделать мутацию, передав на форме файл (или JSON-объект), который по сути является сборником атрибутов сущности (например, форма с загрузкой конфигурации артефактов). Т.е. при отправке:
{"id": "abc", "attributes": {"_self": {"first": "second", "third": "fourth"}}}
the engine treats this the same as:
{"id": "abc", "attributes": {"first": "second", "third": "fourth"}}

_isDraft?bool

Get the value of the system “Draft” flag. For draft records, required field validation is disabled and no business process is started.

_as

get the value as a different type. The available options depend on the value type.
For a string, the following are available:
_as.ref — get the string as a reference to an entity
_as.mltext — get the string as multi-language text
_localId
_disp
_str
Scalars that can be retrieved as values of regular attributes.
In the API, scalars are accessed via a question mark (e.g., ?str and ?bin), but by replacing “?” with “_” you get the same data in non-scalar form (i.e., nested attributes can be queried).
As a use case — take a property that stores a reference to something else as a string. Write:
someField._str._as.ref.fieldFromRef
_roles.isCurrentUserMemberOf.initiator?bool
Whether the current user is a member of the “initiator” role. Any role identifier can be used instead of initiator
_roles.assigneesOf.initiator[]?str
Load the members of the “initiator” role. Any role identifier can be used instead of initiator
_pathByAssoc.someAssoc[]{?id,?disp}
Load the path to the current record via the association with id someAssoc
_pathByParent[]{?id,?disp}
Load the path to the current record via the association with id _parent