Thanks for your reply. First of all, I would like to know more about your last question:
- Is there any way to sort object in “iteration loop” ?..
Which model’s template do you want to customize?
And below are the answers for all your remaining questions:
What are purpose of and blocks ?
ElementBaseInitiationBlock represents the xmlNodes inside ElementBaseInitiationBlock is working for Model.
DiagramBaseInitiationBlock represents the xmlNodes inside DiagramBaseInitiationBlock is working for Diagram.
In addition, ElementBaseInitiationBlock and DiagramBaseInitiationBlock can be seen as entrances of the template content. Without them, the template will result in no content. If user is writing templates for model elements, ElementBaseInitiationBlock should be used. For diagram, DiagramBaseInitiationBlock should be used.
How to use and ? What other these kind of blocks I can use?
There are “ForEachSimpleRelationship”, “ForEachRelationshipEnd”, “ForEachSubDiagram”, “ForEach”, “IteractionBlock”
about ForEachSimpleRelationship and ForEachRelationshipEnd, need to understand what is SimpleRelationship, what is EndRelationshipa nd RelationshipEnd first
SimpleRelationship is the relationship which has no from/to ‘end’, e.g. Generalization, Dependency, etc…
EndRelationship is the relationship which has from/to ‘end’, e.g. Association.
RelationshipEnd is the ‘end’ of EndRelationship. Basically, it has properties “name”, and “direction [from/to]”, and some RelationshipEnd will have more properties. e.g. AssociationEnd (Association’s ‘end’) has Multiplicity, Navigable, etc…
ForEachSimpleRelationship: (refer: …/Report/Default/Class/Abstractions.xml)
- used to iterate the SimpleRelationship of a Model.
@type [Generalization, Dependency, Abstraction, etc…], which type of SimpleRelationship will be iterated
@direction [all/from/to], iterate from or to or both from/to SimpleRelationships (‘from’ means the SimpleRelationship is connected from this model to other model)
@ignoreParagraphBreakForLastModel [true/false], if false, will add paragraph break after generated for the last SimpleRelationship. (default value is false)
ForEachRelationshipEnd: (refer: …/Report/Default/Class/Association.xml)
- used to iterate the RelationshipEnd of a Model. PS: iterate the RelationshipEnd, not iterate EndRelationship.
@type [AssociationEnd, MessageEnd (SequenceDiagram’s message), etc…], which type of RelationshipEnd will be iterated
@endPointer [self/other/both], iterate the RelationshipEnd that refer to this model or other model. (‘self’ means the RelationshipEnd connects to this model no matter which direction, refer to capture01.png)
ForEachSubDiagram (refer: …/Report/Default/Class/SubDiagrams.xml and …/Report/Default/Subtemplate/SubDiagrams.xml) (Class/SubDiagrams.xml refer to Subtemplate/SubDiagrams.xml)
- used to iterative the subDiagram of the model.
@diagramType [ClassDiagram, UseCaseDiagram, etc…], represents which diagramType will be iterated, if no @diagramType, all diagram types will be iterated
ForEach: (refer: …/Report/Default/Class/TemplateParameters.xml)
- used to iterative the “values” of a property of the Model. Always used with HasMetaModelPropertyChecker (if HasMetaModelPropertyChecker return ture, then iterate its values)
@property [templateParametes (Class’s templateParameter), deferrableTriggers (State’s deferrableTrigger)]: represents iterate which property of the model.
IteractionBlock: (refer: …/Report/Default/Class/Attributes.xml)
- used to iterative the “children” of the Model. Always used with HasChildElementChecker (if HasChildElementChecker return ture, then iterate its children)
@elementType [Attribute, Operation (Class’s child), DBColumn (DBTable’s column)]: represents iterate which type of the children. (if no @elementType, all types will be iterated.
What are differences between and ?
If you want to check is the property’s value equal to its default value, then you can use DefaultConditionChecker.
If you wanna check is the property’ value equals/greater than/less than a specified value, then you can ValueConditionChecker
@property [visibility, etc…], the property you are looking for
@equalFlag [true/false], if “false”, it will be generated if the property’s value is NOT EQUAL to default value.
@property (same as DefaultConditionChecker)
@propertyType [string/int/boolean], the value should be in type “string”, “int”, “boolean”? (e.g. attribute’s visibility is “string (private/protected/etc…)”, DBColumn’s length is “int”)
@value, the value specified in this checker
@operator [EQUAL/NOT EQUAL/LIKE], check does the property value equals/not equals/like the value specified in this checker
e.g. check is the Attribute’s type equals “String” then
What is purpose of ?
refer to Question 2 ForEachRelationshipEnd, and …/Report/Default/Class/Associations.xml, and a.png
on line 8, <ForEachRelationshipEnd endPointer=“self” …>, it iterates AssociationEnd “a1”, “a2”
on line 10, , it get the EndRelationship from the RelationshipEnd (get “association 1” from “a1”, “association 2” from a2"),
that means, on line 8, 9, the model is AssociationEnd, but after line 10, the model is Association.
then on line 24, , it get the AssociationEnd from Association again. (model become “a1” for “association 1”, become “c” for “association 2”)
then on line 86, , it get the AssociationEnd from Association again. (model become “b” for “association 1”, become “a2” for “association 2”)
that means the Associations.xml will generate all Associations withs all theirs AssociationEnds to report.
How does works? Does it check if current object has at least one attribute? What is flag?
refer to Question 2, ForEach
@flag=“true” means if have Attribute, then the following xmlNodes will be executed
@flag=“false” mean if have NO Attribute, then the following xmlNodes will be executed
Is it similar for ?
Yes, you are correct.
Is there any way to find out parent of current object?
Yes, by .
What is purpose for ?
change the current model to the property’s value (if the property’s value is a Model)
PS: Class’s property “taggedValues”, it value is a model called TaggedValueContainer, not collection of TaggedValue.
so, if want to get TaggedValue(s) from Class, need get the TaggedValueContainer first, then get the children of TaggedValueContainer for TaggedValue.
I hope these will help. I’m looking forward to your response towards my question.