construct::opal::DefinitionUpdateTask
OPAL task construct.definition.update: replace one of the document's own SDF definitions.
| Declared in | src/libs/libconstruct/construct/opal/DefinitionUpdateTask.hpp |
| Inherits | construct::opal::ConstructMutationTask |
| Group | construct |
Detailed description
The task takes definitionId and the new definition in one of two forms (construct-definition-editor §DUO-2), and changes the definition of that id in the active document:
- definition, a map. It is written into the definition's record text (§DUM-6a): each key it names gets the new value, and every key it does not name keeps its value and its comments. - source, the record text. It replaces the record text of the definition. Its id must be definitionId. The lineage and the common fingerprint, which a text does not hold, stay.
It checks the result first, and fails with the state unchanged when the data is not valid, the text does not parse or the id is not found.
The change goes through the document's operation executor as a DefinitionUpdate operation on the main thread, so it can be undone. The result names the definition and summarizes its new form.
See also SceneListDefinitionsTask, DefinitionGetTask.