I have several questions about using Document Composer that I hope are easy to answer.
I am iterating through the attributes of classes to produce the documentation for each of them. I use a <> stereotype to indicate required fields. To print ‘N’ for an attribute that is marked as such I use this:N
Is there a better way to check for the existence of that stereotype without iterating through all stereotypes. I’ve tried a number of tests with <Has…> elements with no success so far.
To indicate that an attribute must have a unique value, we check the “Unique” box in the attribute’s specification dialog. I haven’t been able to figure out the proper tests/conditions to determine whether that box is checked or not. I was able to see that a ‘unique’ property exists within the ‘multiplicityDetail’ property but could not seem to access the value.
This one’s harder but also maybe more interesting. For attributes whose value is constrained to an enumeration, we model that attribute’s data type as an associated enumeration class:
For the attribute’s documentation, we want to list the allowable values like this:
So the logical flow would be
1. Identify the association that matches the attribute’s data type
2. Identify the enumeration class at the other end of the association (
3. Iterate through the attributes of the enumeration class and output the attribute names
Is this even possible?
Anyways, I’m really enjoying learning about this language and bending it to my will.
Thanks in advance for any advice!