|Re: Problems with another pattern I need to implement [message #1066064 is a reply to message #1066032]
||Sat, 29 June 2013 16:52
| Abel Hegedus
Registered: September 2015
Alexander Fülleborn wrote on Sat, 29 June 2013 03:43|
E.g. in the spec and tutorial that I have I cannot find the description of the syntax
"uml.metamodel.uml.Element.appliedStereotype(AppliedST, DomainSpecificProblemStatement, StType);"
as you told me in one of your last answers.
For a quick introduction to pattern syntax, read http://wiki.eclipse.org/VIATRA2/Activity_Diagrams_to_Petri_Nets
For more details, see the language specification (http://www.eclipse.org/viatra2/doc/ViatraSpecification.pdf), where the detailed syntax of graph patterns are described from page 54, Section 5.4.
You can see that the gtpattern has a body, and the pattern body (page 58) contains local pattern body elements, pattern calls, check conditions, etc. First, local elements are model elements or relationships, model elements are either entities (e.g. uml.Element(DomainSpecificProblemStatement), where Element is the type and DomainSpecificProblemStatement is the variable which will be matched to an entity with the Element type) or relations (which is the one above uml.Element.appliedStereotype(AppliedST, DomainSpecificProblemStatement, StType), where appliedStereotype is a relation defined in the uml.Element entitiy, AppliedSt is the variable that matches the _relation itself_, DomainSpecificProblemStatement is the variable that will match the source element of the relation and StType is the target element of the relation).
It is important, that you won't find a specific syntax for UML profiles, as the pattern and transformation language does not have such extensions. The UML models and metamodel and profiles are all represented with VPM and thus can be handled with standard VTCL code. So the uml.Element.appliedStereotype(Rel,Src,Trg) is not a special syntax, it just means that:
- there is an Element named entity under the uml named entity under the metamodel named entity under the uml named entity (which is under the model space root)
- there is an appliedStereotype named relation under this Element entity, with the source being the Element entity itself and the target the Stereotype named entity (under the same entity as the Element).
- we are looking for relations which have the appliedStereotype named relation as their _type_ and we will substitute this relations into the variable Rel (so typeOf(Element.appliedStereotype,Rel) is true).
- if the Rel variable is substituted to a given relation (say uml.models.sample.elem1.asRel), then variable Src will be substituted to entity uml.models.sample.elem1 and variable Trg will be substituted to entity uml.models.sampleProfile.st1 for example.
The above is also explained in the tutorial example that I linked with UML activity diagrams and Petri nets.
Powered by FUDForum
. Page generated in 0.02507 seconds