Using DPO With Arrow Types

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

The arrow types belong to an Enumeration of the graphdesc meta-model.

Let's imagine in the school sample that we want to associate the source arrow type of the classrooms reference with the number of students of the classroom. For example, if the students count is 0, we want a normal source arrow type, and in other cases, we want the default one (diamond).

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 there is no student
    if students->size() = 0
    then
    	-- the arrow type is none
    	graphdesc::ArrowType::none
    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) :