Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "VIATRA/Integration/UMLSupport"

(surrogate queries link changed)
 
(16 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== User Guide ==
+
{{caution|Old information|This page is not updated anymore; for more up-to-date details look at the language specification at https://www.eclipse.org/viatra/documentation/addons.html instead.}}
 +
== Derived feature support ==
  
The EMF metamodel for UML 2 contains several derived features which are not supported in IncQuery patterns by default. This optional integration provides support for them via marking [[EMFIncQuery/UserDocumentation/Query_Based_Features#Well-behaving_structural_features|well-behaving features]] as such and defining [[EMFIncQuery/UserDocumentation/Surrogate_Queries|surrogate queries]] for the not well-behaving ones.
+
The EMF metamodel for UML 2 contains several derived features which are not supported in VIATRA patterns by default. This optional integration component provides support for them via defining appropriate [[VIATRA/Addon/Surrogate_Queries|surrogate queries]].
  
* Install the feature ''UML Support for EMF-IncQuery'' from the IncQuery update site.
+
* Install the feature ''UML Support for VIATRA'' from the VIATRA update site.
 
[[File:EMF-IncQuery_UML_Install.png]]
 
[[File:EMF-IncQuery_UML_Install.png]]
* Add the following plugins to your dependencies:
+
* Add the ''org.eclipse.viatra.integration.uml'' plugin to your dependencies.
** ''org.eclipse.incquery.runtime''
+
** ''org.eclipse.incquery.uml''
+
 
[[File:EMF-IncQuery_UML_Dependencies.png]]
 
[[File:EMF-IncQuery_UML_Dependencies.png]]
 
* Now you can use most of the derived features like every other feature.
 
* Now you can use most of the derived features like every other feature.
 
[[File:EMF-IncQuery_UML_Queries.png|815px]]
 
[[File:EMF-IncQuery_UML_Queries.png|815px]]
  
== Status of derived features ==
+
=== Status of derived features ===
 
{| border="1"
 
{| border="1"
 +
!Derived feature
 +
!Status
 +
!Remark
 
|-
 
|-
|Action.input||Done  
+
|Action.context || Done || Since 1.1.0
 
|-
 
|-
|Action.context||TODO
+
|Action.input || Done || Since 1.0.0
 
|-
 
|-
|Action.output||Done  
+
|Action.output || Done || Since 1.0.0
 
|-
 
|-
|Activity.group||Done  
+
|Activity.group || Done || Since 1.0.0
 
|-
 
|-
|Activity.node||Done  
+
|Activity.node || Done || Since 1.0.0
 
|-
 
|-
|ActivityEdge.inGroup||Done  
+
|ActivityEdge.inGroup || Done || Since 1.0.0
 
|-
 
|-
|ActivityGroup.containedEdge||Done  
+
|ActivityGroup.containedEdge || Done || Since 1.0.0
 
|-
 
|-
|ActivityGroup.containedNode||Done  
+
|ActivityGroup.containedNode||Done || Since 1.0.0
 
|-
 
|-
|ActivityGroup.inActivity||Done  
+
|ActivityGroup.inActivity || Done || Since 1.1.0
 
|-
 
|-
|ActivityGroup.subgroup||Done  
+
|ActivityGroup.subgroup ||Done || Since 1.0.0
 
|-
 
|-
|ActivityGroup.superGroup||Done  
+
|ActivityGroup.superGroup ||Done || Since 1.0.0
 
|-
 
|-
|ActivityNode.activity||Done  
+
|ActivityNode.activity || Done || Since 1.1.0
 
|-
 
|-
|ActivityNode.inGroup||Done  
+
|ActivityNode.inGroup || Done || Since 1.0.0
 
|-
 
|-
|Association.endType||Done  
+
|Association.endType || Done || Since 1.0.0
 
|-
 
|-
|Behavior.context||TODO
+
|Behavior.context || Done || Since 1.1.0
 
|-
 
|-
|Class.extension||Done
+
|Class.extension || TODO || Buggy in 1.0.0, disabled in 1.1.0 (implementation checks Metaclass stereotype application, so it will be incorrect if used on classes that are _not_ metaclasses)
 
|-
 
|-
|Class.superClass||Done  
+
|Class.superClass || Done || Since 1.0.0
 
|-
 
|-
|Classifier.attribute||Done  
+
|Classifier.attribute || Done || Since 1.0.0
 
|-
 
|-
|Classifier.feature||Done  
+
|Classifier.feature || Done || Since 1.0.0
 
|-
 
|-
|Classifier.general||Done  
+
|Classifier.general || Done || Since 1.0.0
 
|-
 
|-
|Classifier.inheritedMember||TODO  
+
|Classifier.inheritedMember || TODO  
 
|-
 
|-
|Component.provided||TODO  
+
|Component.provided || TODO  
 
|-
 
|-
|Component.required||TODO  
+
|Component.required || TODO  
 
|-
 
|-
|ConnectableElement.end||Done  
+
|ConnectableElement.end || Done || Since 1.0.0
 
|-
 
|-
|Connector.kind||Done  
+
|Connector.kind || Done || Since 1.0.0
 
|-
 
|-
|ConnectorEnd.definingEnd||TODO  
+
|ConnectorEnd.definingEnd || TODO  
 
|-
 
|-
|DeploymentTarget.deployedElement||Done  
+
|DeploymentTarget.deployedElement || Done || Since 1.0.0
 
|-
 
|-
|DirectedRelationship.source||Done  
+
|DirectedRelationship.source || Done || Since 1.0.0
 
|-
 
|-
|DirectedRelationship.target||Done  
+
|DirectedRelationship.target || Done || Since 1.0.0
 
|-
 
|-
|Element.ownedElement||Done  
+
|Element.ownedElement || Done || Since 1.0.0
 
|-
 
|-
|Element.owner||Done  
+
|Element.owner || Done || Since 1.0.0
 
|-
 
|-
|EncapsulatedClassifier.ownedPort||Done  
+
|EncapsulatedClassifier.ownedPort || Done || Since 1.0.0
 
|-
 
|-
|Extension.isRequired||TODO  
+
|Extension.isRequired || TODO  
 
|-
 
|-
|Extension.metaclass||Done  
+
|Extension.metaclass || Done || Since 1.0.0
 
|-
 
|-
|Feature.featuringClassifier||Done
+
|Feature.featuringClassifier || Incorrect || Since 1.0.0, known problems (opposite of Classifier.feature according to specification, but implementation gives different result in some corner cases involving signals)
 
|-
 
|-
|Message.messageKind||Done  
+
|Message.messageKind || Done || Since 1.0.0
 
|-
 
|-
|MultiplicityElement.lower||TODO  
+
|MultiplicityElement.lower || TODO  
 
|-
 
|-
|MultiplicityElement.upper||TODO  
+
|MultiplicityElement.upper || TODO  
 
|-
 
|-
|NamedElement.clientDependency||Done  
+
|NamedElement.clientDependency || Done || Since 1.0.0
 
|-
 
|-
|NamedElement.namespace||Done  
+
|NamedElement.namespace || Done || Since 1.0.0
 
|-
 
|-
|NamedElement.qualifiedName||Done  
+
|NamedElement.qualifiedName || Done || Incorrect in 1.0.0, fixed in 1.1.0
 
|-
 
|-
|Namespace.importedMember||Done
+
|Namespace.importedMember || Incorrect || Since 1.0.0, known problems (imported members of Profiles are not fully correct)
 
|-
 
|-
|Namespace.member||Done
+
|Namespace.member || Incorrect || Since 1.0.0, known problems (inherited class members are not included)
 
|-
 
|-
|Namespace.ownedMember||Done  
+
|Namespace.ownedMember || Done || Since 1.0.0
 
|-
 
|-
|OpaqueExpression.result||Done  
+
|OpaqueExpression.result || Done || Since 1.0.0
 
|-
 
|-
|Operation.isOrdered||TODO  
+
|Operation.isOrdered || TODO  
 
|-
 
|-
|Operation.isUnique||TODO  
+
|Operation.isUnique || TODO  
 
|-
 
|-
|Operation.lower||TODO  
+
|Operation.lower || TODO  
 
|-
 
|-
|Operation.type||TODO  
+
|Operation.type || TODO  
 
|-
 
|-
|Operation.upper||TODO  
+
|Operation.upper || TODO  
 
|-
 
|-
|Package.nestedPackage||Done  
+
|Package.nestedPackage || Done || Since 1.0.0
 
|-
 
|-
|Package.nestingPackage||Done  
+
|Package.nestingPackage || Done || Since 1.1.0
 
|-
 
|-
|Package.ownedStereotype||Done  
+
|Package.ownedStereotype || Done || Since 1.0.0
 
|-
 
|-
|Package.ownedType||Done  
+
|Package.ownedType || Done || Since 1.0.0
 
|-
 
|-
|Parameter.default||TODO  
+
|Parameter.default || TODO  
 
|-
 
|-
|Port.provided||TODO  
+
|Port.provided || TODO  
 
|-
 
|-
|Port.required||TODO  
+
|Port.required || TODO  
 
|-
 
|-
|Property.default||Done
+
|Property.default || TODO
 
|-
 
|-
|Property.isComposite||Done  
+
|Property.isComposite || Done  
 
|-
 
|-
|Property.opposite||TODO  
+
|Property.opposite || TODO  
 
|-
 
|-
|ProtocolTransition.referred||Done  
+
|ProtocolTransition.referred || Done || Since 1.0.0
 
|-
 
|-
|RedefinableElement.redefinedElement||Done  
+
|RedefinableElement.redefinedElement || Done || Since 1.0.0
 
|-
 
|-
|RedefinableElement.redefinitionContext||Done  
+
|RedefinableElement.redefinitionContext || Done || Since 1.0.0
 
|-
 
|-
|RedefinableTemplateSignature.inheritedParameter||Done  
+
|RedefinableTemplateSignature.inheritedParameter || Done || Since 1.0.0
 
|-
 
|-
|Relationship.relatedElement||Done  
+
|Relationship.relatedElement || Done || Since 1.0.0
 
|-
 
|-
|State.isComposite||Done  
+
|State.isComposite || Done || Since 1.0.0
 
|-
 
|-
|State.isOrthogonal||Done  
+
|State.isOrthogonal || Done || Since 1.0.0
 
|-
 
|-
|State.isSimple||TODO  
+
|State.isSimple || TODO  
 
|-
 
|-
|State.isSubmachineState||TODO  
+
|State.isSubmachineState || TODO  
 
|-
 
|-
|Stereotype.profile||TODO  
+
|Stereotype.profile || TODO  
 
|-
 
|-
|StructuredClassifier.part||Done  
+
|StructuredClassifier.part || Done || Since 1.0.0
 
|-
 
|-
|StructuredClassifier.role||Done  
+
|StructuredClassifier.role || Done || Since 1.0.0
 
|-
 
|-
|Type.package||Done  
+
|Type.package || Done || Since 1.0.0
 
|-
 
|-
|Vertex.incoming||Done  
+
|Vertex.incoming || Done || Since 1.0.0
 
|-
 
|-
|Vertex.outgoing||Done  
+
|Vertex.outgoing || Done || Since 1.0.0
 
|}
 
|}
  
Summary: 54/75 (72%)
+
== Static profile support ==
 +
 
 +
If you have an EMF-UML profile, you can query over applications of its stereotypes and their tagged values as if they were ordinary EClasses and EAttributes. As of 1.1.0, VIATRA only supports static profiles, so you have to define one as described in [http://nyssen.blogspot.hu/2009/09/defining-static-profiles-with-eclipse.html this blog post].
 +
 
 +
On the example below continuing the blog post, in the started runtime Eclipse, we created a pattern that matches <tt>ExampleStereotype</tt> applications, and as we can see in the Query Explorer, it has matches on a simple UML instance model:
 +
 
 +
[[File:Static-profile.png]]
 +
 
 +
Note for Papyrus users: it is recommended to also register your profile with Papyrus. To accomplish this, add an extension for the <tt>org.eclipse.papyrus.uml.extensionpoints.UMLProfile</tt> extension point, pointing to the UML model file containing your profile. For more information, refer to [https://www.eclipse.org/forums/index.php/t/604098/ this thread].
 +
 
 +
The code for this example can be found in [https://github.com/thSoft/viatra-uml-support this repository].

Latest revision as of 09:33, 30 November 2017

Stop.png
Old information
This page is not updated anymore; for more up-to-date details look at the language specification at https://www.eclipse.org/viatra/documentation/addons.html instead.

Derived feature support

The EMF metamodel for UML 2 contains several derived features which are not supported in VIATRA patterns by default. This optional integration component provides support for them via defining appropriate surrogate queries.

  • Install the feature UML Support for VIATRA from the VIATRA update site.

EMF-IncQuery UML Install.png

  • Add the org.eclipse.viatra.integration.uml plugin to your dependencies.

EMF-IncQuery UML Dependencies.png

  • Now you can use most of the derived features like every other feature.

EMF-IncQuery UML Queries.png

Status of derived features

Derived feature Status Remark
Action.context Done Since 1.1.0
Action.input Done Since 1.0.0
Action.output Done Since 1.0.0
Activity.group Done Since 1.0.0
Activity.node Done Since 1.0.0
ActivityEdge.inGroup Done Since 1.0.0
ActivityGroup.containedEdge Done Since 1.0.0
ActivityGroup.containedNode Done Since 1.0.0
ActivityGroup.inActivity Done Since 1.1.0
ActivityGroup.subgroup Done Since 1.0.0
ActivityGroup.superGroup Done Since 1.0.0
ActivityNode.activity Done Since 1.1.0
ActivityNode.inGroup Done Since 1.0.0
Association.endType Done Since 1.0.0
Behavior.context Done Since 1.1.0
Class.extension TODO Buggy in 1.0.0, disabled in 1.1.0 (implementation checks Metaclass stereotype application, so it will be incorrect if used on classes that are _not_ metaclasses)
Class.superClass Done Since 1.0.0
Classifier.attribute Done Since 1.0.0
Classifier.feature Done Since 1.0.0
Classifier.general Done Since 1.0.0
Classifier.inheritedMember TODO
Component.provided TODO
Component.required TODO
ConnectableElement.end Done Since 1.0.0
Connector.kind Done Since 1.0.0
ConnectorEnd.definingEnd TODO
DeploymentTarget.deployedElement Done Since 1.0.0
DirectedRelationship.source Done Since 1.0.0
DirectedRelationship.target Done Since 1.0.0
Element.ownedElement Done Since 1.0.0
Element.owner Done Since 1.0.0
EncapsulatedClassifier.ownedPort Done Since 1.0.0
Extension.isRequired TODO
Extension.metaclass Done Since 1.0.0
Feature.featuringClassifier Incorrect Since 1.0.0, known problems (opposite of Classifier.feature according to specification, but implementation gives different result in some corner cases involving signals)
Message.messageKind Done Since 1.0.0
MultiplicityElement.lower TODO
MultiplicityElement.upper TODO
NamedElement.clientDependency Done Since 1.0.0
NamedElement.namespace Done Since 1.0.0
NamedElement.qualifiedName Done Incorrect in 1.0.0, fixed in 1.1.0
Namespace.importedMember Incorrect Since 1.0.0, known problems (imported members of Profiles are not fully correct)
Namespace.member Incorrect Since 1.0.0, known problems (inherited class members are not included)
Namespace.ownedMember Done Since 1.0.0
OpaqueExpression.result Done Since 1.0.0
Operation.isOrdered TODO
Operation.isUnique TODO
Operation.lower TODO
Operation.type TODO
Operation.upper TODO
Package.nestedPackage Done Since 1.0.0
Package.nestingPackage Done Since 1.1.0
Package.ownedStereotype Done Since 1.0.0
Package.ownedType Done Since 1.0.0
Parameter.default TODO
Port.provided TODO
Port.required TODO
Property.default TODO
Property.isComposite Done
Property.opposite TODO
ProtocolTransition.referred Done Since 1.0.0
RedefinableElement.redefinedElement Done Since 1.0.0
RedefinableElement.redefinitionContext Done Since 1.0.0
RedefinableTemplateSignature.inheritedParameter Done Since 1.0.0
Relationship.relatedElement Done Since 1.0.0
State.isComposite Done Since 1.0.0
State.isOrthogonal Done Since 1.0.0
State.isSimple TODO
State.isSubmachineState TODO
Stereotype.profile TODO
StructuredClassifier.part Done Since 1.0.0
StructuredClassifier.role Done Since 1.0.0
Type.package Done Since 1.0.0
Vertex.incoming Done Since 1.0.0
Vertex.outgoing Done Since 1.0.0

Static profile support

If you have an EMF-UML profile, you can query over applications of its stereotypes and their tagged values as if they were ordinary EClasses and EAttributes. As of 1.1.0, VIATRA only supports static profiles, so you have to define one as described in this blog post.

On the example below continuing the blog post, in the started runtime Eclipse, we created a pattern that matches ExampleStereotype applications, and as we can see in the Query Explorer, it has matches on a simple UML instance model:

Static-profile.png

Note for Papyrus users: it is recommended to also register your profile with Papyrus. To accomplish this, add an extension for the org.eclipse.papyrus.uml.extensionpoints.UMLProfile extension point, pointing to the UML model file containing your profile. For more information, refer to this thread.

The code for this example can be found in this repository.

Back to the top