Pre-condition and post condition

Hello! How to include the pre-condition and postCondition’s linked Text with m2doc?

I’ve tried this but failed.

You gat this error because the ERference preCondition type is Constraint. And Constraint doesn’t have any EStructuralFeature named bodies. You need to cast to the specific sub type OpaqueExpression to access the bodies feature:


You can find this by looking at the serialized XMI:

          <ownedConstraints xsi:type=""
              id="939caad8-95c8-4a42-b36e-e7dc55321b95" name="">
            <ownedSpecification xsi:type=""

Another solution using the getConstraintLbal() is described here. It will handle any kind of Constraint which is better.

1 Like