Node Description

The NodeDescription describes a node and its children, border nodes, labels, style, visibility and interactions.

1. Core Properties

  • name: Identifier A unique identifier of the node description. If the name is changed, existing nodes created from this description will disappear and new nodes will replace them. Existing positions, sizes and customizations done by the end users will be lost.

  • description: String Some documentation to let the studio makers understand the purpose of the node description.

2. Rendering

  • semanticCandidatesExpression: InterpretedExpression Used to selected the semantic elements for which a node may be created. The semantic elements selected by this expression will be then filtered by the domainType` and the preconditionExpression.

    • self: Object The current context on which the expression is evaluated. If the node is under the diagram description, it is the semantic element on which the diagram has been created. If the node is under another node description, it is the semantic element on which the parent node has been created.

    • editingContext: IEditingContext The editing context of the workbench. It can be used with core services to retrieve information about the semantic elements.

    • ancestors: List<Object> The list of all the semantic elements used to create the parents of the current node. The first element of the list is the semantic element used to create the parent node, the second element is the semantic element used to create the grandparent node, and so on up until the semantic element of the diagram itself.

    • semanticElementIds: List<String> The list of the identifiers of all semantic elements which should appear with the current description. For node descriptions using an UNSYNCHRONIZED synchronization policy, it can be expensive to consider all the potential semantic elements in the model. This variable can thus be used to consider only the semantic elements which are already present in the diagram and those who would be added by a create view model operation.

    • collapsingState: CollapsingState Indicates if the node is collapsed or expanded.

    • isBorderNode: boolean Indicates if the node being created is a border node or not.

    • previousDiagram: Diagram The previously rendered diagram. It can be used to retrieve information about the previous state of the diagram and its elements.

    • diagramEvent: IDiagramEvent The current event that is involved in the refresh of the diagram.

  • domainType: DomainType Fully qualified type of the semantic elements for which a node should be created. For example flow::System or ecore::EClass. Used to filter the semantic elements selected by the semanticCandidatesExpression.

  • preconditionExpression: InterpretedExpression Used to filter the semantic elements selected by the semanticCandidatesExpression after filtering by domainType.

    • self: Object The current context on which the expression is evaluated. If the node is under the diagram description, it is the semantic element on which the diagram has been created. If the node is under another node description, it is the semantic element on which the parent node has been created.

    • editingContext: IEditingContext The editing context of the workbench. It can be used with core services to retrieve information about the semantic elements.

    • ancestors: List<Object> The list of all the semantic elements used to create the parents of the current node. The first element of the list is the semantic element used to create the parent node, the second element is the semantic element used to create the grandparent node, and so on up until the semantic element of the diagram itself.

    • semanticElementIds: List<String> The list of the identifiers of all semantic elements which should appear with the current description. For node descriptions using an UNSYNCHRONIZED synchronization policy, it can be expensive to consider all the potential semantic elements in the model. This variable can thus be used to consider only the semantic elements which are already present in the diagram and those who would be added by a create view model operation.

    • collapsingState: CollapsingState Indicates if the node is collapsed or expanded.

    • isBorderNode: boolean Indicates if the node being created is a border node or not.

    • previousDiagram: Diagram The previously rendered diagram. It can be used to retrieve information about the previous state of the diagram and its elements.

    • diagramEvent: IDiagramEvent The current event that is involved in the refresh of the diagram.

  • synchronizationPolicy: SynchronizationPolicy Used to configure how the node created from this description will be synchronized with the semantic model. This is especially important when dealing with large models in which the semanticCandidatesExpression could return a very large number of elements. In order to prevent the creation of massive diagrams which are difficult to manipulate, one can use the synchronization policy to take control over the synchronization process. It can be configured to one of the following values:

    • SYNCHRONIZED The node will be automatically created when if a semantic element is returned by the semanticCandidatesExpression. To delete the node, the underlying semantic element must not be reachable by the semanticCandidatesExpression anymore (most of the time, when the semantic element is deleted).

    • UNSYNCHRONIZED The node will not be automatically created when the semantic element is returned by the semanticCandidatesExpression. Instead the node will only be created if a tool explicitely asks for it. In this case, the node can be deleted by another tool without deleting the underlying semantic element. The node will be automatically deleted if the underlying semantic element is not reachable by the semanticCandidatesExpression anymore.

3. Labels

Nodes can have multiple labels which can be displayed inside or outside the node. The labels can be configured by an expression to display information about the semantic element, such as its name or type.

3.1. Inside Label Description

InsideLabelDescription specializes LabelDescription for labels displayed inside a node. A node description can only have a single inside label description.

3.1.1. Rendering

  • labelExpression: InterpretedExpression Used to compute the text of the label.

    • self: Object The semantic element used as the target of the node being rendered

    • editingContext: IEditingContext The editing context of the workbench. It can be used with core services to retrieve information about the semantic elements.

    • ancestors: List<Object> The list of all the semantic elements used to create the parents of the current node.

    • collapsingState: CollapsingState Indicates if the node is collapsed or expanded.

    • isBorderNode: boolean Indicates if the node being created is a border node or not.

    • previousDiagram: Diagram The previously rendered diagram. It can be used to retrieve information about the previous state of the diagram and its elements.

    • diagramEvent: IDiagramEvent The current event that is involved in the refresh of the diagram.

  • overflowStrategy: LabelOverflowStrategy Used to indicate how the label is supposed to behave if its size becomes larger the the size of the node.

    • NONE The node should grow to display the entire label

    • WRAP The label should be wrapped to create a new line

    • ELLIPSIS The end of the label should be replaced with "…​"

  • textAlign: LabelTextAlign How the text in the label should be aligned

    • LEFT

    • RIGHT

    • CENTER

    • JUSTIFY

  • position: InsideLabelPosition: Used to specify the position of the label within the node

    • TOP_CENTER

    • TOP_LEFT

    • TOP_RIGHT

    • MIDDLE_LEFT

    • MIDDLE_CENTER

    • MIDDLE_RIGHT

    • BOTTOM_LEFT

    • BOTTOM_CENTER

    • BOTTOM_RIGHT

3.1.2. Styling

  • style: InsideLabelStyle

  • conditionalStyles: ConditionalInsideLabelStyle

3.2. Outside Label Description

OutsideLabelDescription specializes LabelDescription for labels displayed outside a node. A node description can have multiple outside label description.

3.2.1. Rendering

  • labelExpression: InterpretedExpression Used to compute the text of the label.

    • self: Object The semantic element used as the target of the node being rendered

    • editingContext: IEditingContext The editing context of the workbench. It can be used with core services to retrieve information about the semantic elements.

    • ancestors: List<Object> The list of all the semantic elements used to create the parents of the current node.

    • collapsingState: CollapsingState Indicates if the node is collapsed or expanded.

    • isBorderNode: boolean Indicates if the node being created is a border node or not.

    • previousDiagram: Diagram The previously rendered diagram. It can be used to retrieve information about the previous state of the diagram and its elements.

    • diagramEvent: IDiagramEvent The current event that is involved in the refresh of the diagram.

  • overflowStrategy: LabelOverflowStrategy Used to indicate how the label is supposed to behave if its size becomes larger the the size of the node.

    • NONE The node should grow to display the entire label

    • WRAP The label should be wrapped to create a new line

    • ELLIPSIS The end of the label should be replaced with "…​"

  • textAlign: LabelTextAlign How the text in the label should be aligned

    • LEFT

    • RIGHT

    • CENTER

    • JUSTIFY

  • position: OutsideLabelPosition Where the label can be positioned outside of the node

    • BOTTOM_CENTER

3.2.2. Styling

  • style: OutsideLabelStyle

  • conditionalStyles: ConditionalOutsideLabelStyle

4. Structure

A node can contain child nodes and border nodes. To configure this structure, a node description can contain various child node descriptions and reuse existing node descriptions as its children too. One can for example, create a node description that reuses itself as a child node description to create a recursive structure of nodes in a diagram.

  • childrenDescriptions: NodeDescription The list of child node descriptions which can be used to render child nodes

  • borderNodesDescriptions: NodeDescription The list of border node descriptions which can be used to render nodes on the border of the current node.

  • reusedChildNodeDescriptions: NodeDescription The list of existing node descriptions that should be reused as child node descriptions

  • reusedBorderNodeDescriptions: NodeDescription The list of existing node descriptions that should be reused as boder node descriptions

5. Styling

  • style: NodeStyleDescription The default style of the node

  • conditionalStyles: ConditionalNodeStyle A list of conditional styles that can be applied to the node based on its state

  • isHiddenByDefaultExpression: InterpretedExpression Used to configure if the node should be hidden by default.

    • self: Object The semantic element used as the target of the node being rendered

    • editingContext: IEditingContext The editing context of the workbench. It can be used with core services to retrieve information about the semantic elements.

    • previousDiagram: Diagram The previously rendered diagram. It can be used to retrieve information about the previous state of the diagram and its elements.

    • diagramEvent: IDiagramEvent The current event that is involved in the refresh of the diagram.

  • isFadedByDefaultExpression: InterpretedExpression Used to configure if the node should be faded by default.

    • self: Object The semantic element used as the target of the node being rendered

    • editingContext: IEditingContext The editing context of the workbench. It can be used with core services to retrieve information about the semantic elements.

    • previousDiagram: Diagram The previously rendered diagram. It can be used to retrieve information about the previous state of the diagram and its elements.

    • diagramEvent: IDiagramEvent The current event that is involved in the refresh of the diagram.

5.1. Node Style Description

The style of a node being rendered is compute thanks to a node style description. All the node style descriptions are sharing some common properties:

  • description: String Some documentation to let the studio makers understand the purpose of the node style description.

  • childrenLayoutStrategy: LayoutStrategyDescription

  • borderColor: UserColor

  • borderRadius: int

  • borderSize: int

  • borderLineStyle: LineStyle which can take one of the following values

    • SOLID

    • DASH

    • DOT

    • DASH_DOT

5.1.1. Rectangular Node Style Description

Use this node style description to create rectangular nodes. On top of the properties of all node style descriptions, the rectangular one adds the following properties:

  • background: UserColor

5.1.2. Image Node Style Description

Use this node style description to create nodes using an image. On top of the properties of all node style descriptions, the image one adds the following properties:

  • shape: String

  • isPositionDependentRotation: boolean

5.1.3. Icon Label Node Style Description

Use this node style description to create nodes composed of an icon and a label. On top of the properties of all node style descriptions, the icon label one adds the following properties:

  • background: UserColor

5.1.4. Ellipse Node Style Description

Use this node style description to create nodes as an ellipse. On top of the properties of all node style descriptions, the ellipse one adds the following properties:

  • background: UserColor

6. Interaction

  • palette: NodePalette Used to configure the palette of the node. This palette is accessible thanks to a right click on a node. It can contain tools to create new elements in the diagram or to perform actions on the node or its target semantic element.

  • actions: Action Used to display actions on the node being rendered. Actions are displayed as a clickable icon to trigger some specific behavior.

7. Layout

  • collapsible: boolean Indicate if the node is collapsible. A collapsed node does not display its child nodes.

  • isCollapsedByDefaultExpression: InterpretedExpression Used to indicate if the node should be collapsed by default.

    • self: Object The semantic element used as the target of the node being rendered

    • editingContext: IEditingContext The editing context of the workbench. It can be used with core services to retrieve information about the semantic elements.

    • previousDiagram: Diagram The previously rendered diagram. It can be used to retrieve information about the previous state of the diagram and its elements.

    • diagramEvent: IDiagramEvent The current event that is involved in the refresh of the diagram.

  • userResizable: UserResizableDirection Used to indicate if the node can be resized by end users.

  • keepAspectRatio: boolean Used to indicate that resizing a node should keep the same aspect ratio. Use it with defaultWidthExpression and defaultHeightExpression to control precisely the size of the node.

  • defaultWidthExpression: InterpretedExpression Used to configure the default width of the node.

    • self: Object The semantic element used as the target of the node being rendered

    • editingContext: IEditingContext The editing context of the workbench. It can be used with core services to retrieve information about the semantic elements.

    • previousDiagram: Diagram The previously rendered diagram. It can be used to retrieve information about the previous state of the diagram and its elements.

    • diagramEvent: IDiagramEvent The current event that is involved in the refresh of the diagram.

  • defaultHeightExpression: InterpretedExpression Used to configure the default height of the node.

    • self: Object The semantic element used as the target of the node being rendered

    • editingContext: IEditingContext The editing context of the workbench. It can be used with core services to retrieve information about the semantic elements.

    • previousDiagram: Diagram The previously rendered diagram. It can be used to retrieve information about the previous state of the diagram and its elements.

    • diagramEvent: IDiagramEvent The current event that is involved in the refresh of the diagram.