|Re: Help needed for implementing entity match pattern [message #1063802 is a reply to message #1063790]
||Fri, 14 June 2013 09:58
| Abel Hegedus
Registered: September 2015
I will try to walk you through the pattern creation process so you will be able to create other patterns on your own.
pattern isProblemStatement(DomainSpecificProblemStatement) =
// The entity/model element 'PSL problem statement' needs to be
// found according to the following constraints:
// => 'PSL problem statement is the source element of
// => 'DomainSpecificProblemStatement' is the relation named "uN19363_47"
// of type 'appliedStereotype'
// => with the target "PSL problem statement". }
If I understand right:
- there is an uml.metamodel.uml.Element typed entity with name "PSL problem statement"
-> Let's call this variable Elem
- there is an uml.metamodel.uml.Stereotype typed entity with name "MyStereoType" (I intentionally changed it to avoid confusion)
-> Let's call this variable StType
- there is a relation with type uml.metamodel.uml.Element.appliedStereotype between Elem and StType
-> Let's call the variable representing the relation AppliedSt
Then, taking advantage of the declarative nature of the pattern language, you just convert each line to a statement, like this:
pattern isProblemStatement(Elem) =
check(name(StType) == "MyStereoType");
The above pattern will match on the entity which has the stereotype with the given name applied on it.
Unfortunately the links on the main site are broken, but the main wiki page has the correct links: http://wiki.eclipse.org/VIATRA2 (under Documentation, the language specfication, though outdated should still help in finding the details that are not covered by the wiki).
Powered by FUDForum
. Page generated in 0.02029 seconds