Using DPO With Edge Styles

With Dynamic Property Overriders, it is possible to override the static edge styles of the diagram reference figures (both ReferenceFigures and RichReferenceFigures).

The edge styles belong to an Enumeration of the graphdesc meta-model.

Let's imagine in the school sample that we want to associate the edge styles of the classrooms reference with the capacity of the classroom. For example, if the capacity is > 1, we want a dashed edge style, and in other cases, we want the default one.

To get this result, we have to :

  1. Add a Dynamic Property Overrider to the classrooms ReferenceFigure (which is a child of the School ClassFigure)
  2. Select the sourceArrowType in the Property To Override entry
  3. Enter the following expression in the Overriding Expression entry (comments may be ommited) :
    -- if the classroom's capacity is more than 1
    if capacity > 1
    then
    	-- the edge style is dashed
    	graphdesc::EdgeStyle::dashed
    else
    	-- else we use the static arrow type that has been defined
    	defaultPropertyValue
    endif
    

You should get the following result (without the DPO on the left, and with the DPO on the right) :