Domain Diagram Type

Table of Contents

logo-large

Tutorial Actifsource Tutorial – Domain Diagram Type
Required Time - 30 Minutes
Prerequisites - Actifsource Tutorial – Installing Actifsource
- Actifsource Tutorial – Simple Service
- Actifsource Tutorial – Statemachine
Goal - Define Diagram Types to create and edit domain models in a graphical editor
Topics covered - Create a user defined diagram type to display and edit domain specific diagrams
- Create a domain diagram based on the diagram type to edit the underlying root resource
- Define a highlight path from node to node over any edge
- Define a tooltip for elements on the domain diagram
Notation ↪ To do
ⓘ Information
Bold: Terms from actifsource or other technologies and tools
Bold underlined: actifsource Resources
Monospaced: User input
Italics: Important terms in current situation
Disclaimer The authors do not accept any liability arising out of the application or use of any information or equipment described herein. The information contained within this document is by its very nature incomplete. Therefore the authors accept no responsibility for the precise accuracy of the documentation contained herein. It should be used rather as a guide and starting point.
Contact Actifsource AG
Täfernstrasse 37
5405 Baden-Dättwil
Switzerland
www.actifsource.com
Trademark Actifsource is a registered trademark of Actifsource AG in Switzerland, the EU, USA, and China. other names appearing on the site may be trademarks of their respective owners.

Overview

  • Create a user defined diagram type to display and edit domain specific diagrams
  • Create a domain diagram based on the diagram type to edit the underlying root resource
  • Define a highlight path from node to node over any edge
  • Define a tooltip for elements on the domain diagram

Part I Preparation

image2 image2

  • Prepare a new actifsource Project as seen in the Actifsource Tutorial Statemachine
  • Create a generic Domain Model as shown above
  • State.transition 🡪 Decorating Relation with Decorator State.-state.event
  • Transition.targetState 🡪 Use Relation with RangeRestriction Transistion.-transition.-state.state

Part II Create a Diagram Type

  • Create a user defined diagram type to display and edit domain specific diagrams

Create a Diagram Type

image3 image3

  • Create a new DiagramType named Statemachine in the Package generic

image4 image4

  • The Root Class defines the Resource which contains the elements that shall be managed on your domain diagram

  • Select Statemachine as Root Class

image5 image5

  • The Allowed Class defines all the Resources which shall be managed on your domain diagram

  • Select State as Allowed Class since we want to design a state machine

image6 image6

  • Allowed Classes might be created using the domain diagram editor via a Palette Tool

    • HidePaletteEntry: No Palette Entry to create this Allowed Class
    • ShowPaletteEntry: Palette Entry named as the Allowed Class
    • ShowRenamedPaletteEntry: Palette Entry named as defined
  • Select the PaletteEntry ShowPaletteEntry or ShowRenamedPaletteEntry

image7 image7

  • Allowed Relations are relations that shall be displayed on the domain diagram

    • AllowedDependencyRelation: Dotted Line that shows dependencies between components
    • AllowedDirectRelation: Direct relation between resources A and B
    • AllowedIndirectRelation: Indirect relation between resources A and B via X
  • We like to see a transition from state to state just as a simple arrow

  • Define the Selector State.transition.targetState for the Indirect Relation

  • Define openEditor as false if you do not want to open the Resource Editor automatically after creating the transition via domain diagram editor.

Info

Note that the resource Transition is displayed as an arrow

Part III Create a Domain Diagram

  • Create a domain diagram based on the diagram type to edit the underlying root resource

image8 image8

  • Create a new Statemachine named Statemachine1 in the Package specific

image9 image9

  • We could now define Event, State and Transition using the Resource Editor
  • Let’s now try the Domain Diagram Editor

image10 image10

  • Create a new Domain Diagram named Statemachine1 for the Statemachine Statemachine1 in the Package specific
  • Use the context menu directly on the Statemachine Statemachine1

image11 image11

  • The domain diagram shall be named Statemachine1
  • DiagramType is detected automatically based on the Root Resource
  • Single Root is filled in automatically based on the context of new Domain Diagram

image12 image12

  • Create new States named Open Close Opening and Closing using the State Tool from the Palette
Info

Note that the palette entry is influenced by DiagramType.allowedClass.paletteEntry

image13 image13

Info

Note that the dependent Statemachine Statemachine1 is modified accordingly

image14 image14

  • Start adding Transitions using the Relation Tool from the Palette

image15 image15

  • Therefore you are asked for an Event when creating a new Transition
  • Create a new Event called Command_Close using Content Assist (or choose an existing Event
Info

Note that Transitions are based on Events by using the Decorating Relation

image16 image16

  • The Event Command_Close has been created
  • The Transition based on the Event Command_Close with targetState Closing has been created

image17 image17

  • Add some more Transitions based on the new Events Command_Open Sensor_Closed Sensor_Opened

image18 image18

  • Add two more Transitions based on the existing Events Command_Close and Command_Open
  • Use Context Assist to choose the existing Events

Part IV Define a Highlight Path

  • Define a highlight path from node to node over any edge

image19 image19

  • Let’s see where transitions are leading to from source to target state
  • Define a HighlightPath for the Allowed Class State as shown in the example above

image20 image20

  • Hoover your cursor on any State to activate the HighlightPath from State via Transition to TargetState

Part V Define a Tooltip

  • Define a tooltip for elements on the domain diagram

image21 image21

  • Create a new FunctionSpace named Tooltip in the Package generic

image22 image22

  • Create a new ResourceInfo with typeRef State
  • Create a new TemplateFunction named tooltip

image23 image23

  • Open the Template Editor by double clicking Tooltip.State.tooltip in the Project Explorer

image24 image24

  • Print the State.name
  • For every Transition in State: Print Transition.event.name
  • For every Transition in State: Print Transition.targetState.name

image25 image25

  • Use the TemplateFunction tooltip@Tooltip by using a SelectorTooltip in the Diagram Type

image26 image26

  • Hoover your cursor on any State to activate the Tooltip

actifsource-point-large