Open Matt-81 opened 2 years ago
I like the idea, but we must agree about how. The Cardinality
class has multiple methods for retrieving lower and upper bounds in different ways. Replicating these methods on the Relation
class API will add a dozen methods approximately.
P.s.: you may be interested in the method isMandatory(): boolean
.
const isTheSouceLowerBoundGreaterThanZero : boolean = relation.getSourceEnd().isMandatory();
Great, thanks, Claudenir. Meanwhile, I accessed the needed data by extracting all the relation properties:
const relationProperties = relations.map(relation => relation.getSourceEnd());
const sourceCardinalities = relationProperties.map(sourceCardinality => sourceCardinality.cardinality);
Just to keep track of an issue we already discussed. At the current state, to get relation cardinalities information we have to get the relation properties and then get information about cardinalities. It would be nice in the future to get information directly from a relation type.