diff --git a/bundles/tools.vitruv.applications.smarthomeuml/.classpath b/bundles/tools.vitruv.applications.smarthomeuml/.classpath new file mode 100644 index 000000000..946fb3d34 --- /dev/null +++ b/bundles/tools.vitruv.applications.smarthomeuml/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/bundles/tools.vitruv.applications.smarthomeuml/.maven_enable_dsls-compiler b/bundles/tools.vitruv.applications.smarthomeuml/.maven_enable_dsls-compiler new file mode 100644 index 000000000..e69de29bb diff --git a/bundles/tools.vitruv.applications.smarthomeuml/.project b/bundles/tools.vitruv.applications.smarthomeuml/.project new file mode 100644 index 000000000..c42ee3cad --- /dev/null +++ b/bundles/tools.vitruv.applications.smarthomeuml/.project @@ -0,0 +1,51 @@ + + + tools.vitruv.applications.smarthomeuml + + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.xtext.ui.shared.xtextNature + + + + 1720168160022 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/bundles/tools.vitruv.applications.smarthomeuml/.settings/org.eclipse.core.resources.prefs b/bundles/tools.vitruv.applications.smarthomeuml/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/bundles/tools.vitruv.applications.smarthomeuml/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/bundles/tools.vitruv.applications.smarthomeuml/META-INF/MANIFEST.MF b/bundles/tools.vitruv.applications.smarthomeuml/META-INF/MANIFEST.MF new file mode 100644 index 000000000..9636d2307 --- /dev/null +++ b/bundles/tools.vitruv.applications.smarthomeuml/META-INF/MANIFEST.MF @@ -0,0 +1,13 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Smarthomeuml +Bundle-SymbolicName: tools.vitruv.applications.smarthomeuml;singleton:=true +Bundle-Version: 3.0.1.qualifier +Bundle-Vendor: vitruv.tools +Export-Package: tools.vitruv.applications.smarthomeuml +Automatic-Module-Name: tools.vitruv.applications.smarthomeuml +Bundle-RequiredExecutionEnvironment: JavaSE-17 +Require-Bundle: edu.kit.ipd.sdq.metamodels.smarthome;visibility:=reexport, + org.eclipse.uml2.uml;visibility:=reexport, + tools.vitruv.framework.applications, + tools.vitruv.dsls.reactions.runtime diff --git a/bundles/tools.vitruv.applications.smarthomeuml/build.properties b/bundles/tools.vitruv.applications.smarthomeuml/build.properties new file mode 100644 index 000000000..547fc3655 --- /dev/null +++ b/bundles/tools.vitruv.applications.smarthomeuml/build.properties @@ -0,0 +1,7 @@ +source.. = src/,\ + src-gen/,\ + xtend-gen/ +output.. = target/classes/ +bin.includes = META-INF/,\ + .,\ + plugin.xml diff --git a/bundles/tools.vitruv.applications.smarthomeuml/plugin.xml b/bundles/tools.vitruv.applications.smarthomeuml/plugin.xml new file mode 100644 index 000000000..8608e29a8 --- /dev/null +++ b/bundles/tools.vitruv.applications.smarthomeuml/plugin.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + diff --git a/bundles/tools.vitruv.applications.smarthomeuml/src/tools/vitruv/applications/smarthomeuml/SmarthomeToUml.reactions b/bundles/tools.vitruv.applications.smarthomeuml/src/tools/vitruv/applications/smarthomeuml/SmarthomeToUml.reactions new file mode 100644 index 000000000..bc4cf8e5d --- /dev/null +++ b/bundles/tools.vitruv.applications.smarthomeuml/src/tools/vitruv/applications/smarthomeuml/SmarthomeToUml.reactions @@ -0,0 +1,108 @@ +import org.eclipse.emf.common.util.URI +import edu.kit.ipd.sdq.metamodels.smarthome.SmarthomePackage +import org.eclipse.uml2.uml.UMLPackage +import edu.kit.ipd.sdq.metamodels.smarthome.impl.SmarthomeFactoryImpl + +import "http://www.eclipse.org/uml2/5.0.0/UML" as uml +import "edu.kit.ipd.sdq.metamodels.smarthome" as smarthome + +reactions: smarthomeToUml +in reaction to changes in smarthome +execute actions in uml + +reaction SystemArchitectureCreation { + after element smarthome::SmartHomeSystem created + call createUmlModel(affectedEObject) +} + +routine createUmlModel(smarthome::SmartHomeSystem smartHomeSystem) { + match { + require absence of uml::Model corresponding to smartHomeSystem + } + create { + val model = new uml::Model + } + update { + addCorrespondenceBetween(smartHomeSystem, model) + addCorrespondenceBetween(SmarthomePackage.eINSTANCE, smartHomeSystem) + addCorrespondenceBetween(UMLPackage.eINSTANCE, model) + model.URI = smartHomeSystem.eResource.URI.appendFileExtension("uml").toString + var res = smartHomeSystem.eResource.resourceSet.createResource(URI.createURI(model.URI)) + res.contents.add(model) + createComponentUmlInterface() + createProtocolUmlInterface(smartHomeSystem) + } +} + + +routine createProtocolUmlInterface(smarthome::SmartHomeSystem smartHomeSystem) { + match { +// require absence of uml::Action corresponding to service + val model = retrieve uml::Model corresponding to UMLPackage.eINSTANCE + } + create { + val interf = new uml::Interface + } + update { + addCorrespondenceBetween(smartHomeSystem, interf) + model.packagedElements += interf + } +} + +routine createComponentUmlInterface() { + match { +// require absence of uml::Action corresponding to service + val model = retrieve uml::Model corresponding to UMLPackage.eINSTANCE + } + create { + val interf = new uml::Interface + } + update { + val smartHomeFactory = SmarthomeFactoryImpl.init() + val component = smartHomeFactory.createComponent() + addCorrespondenceBetween(component, interf) + model.packagedElements += interf + } +} + +reaction DeviceInserted { + after element smarthome::Device inserted in smarthome::SmartHomeSystem[components] + call { + createDeviceUmlClass(newValue) + } +} + +routine createDeviceUmlClass(smarthome::Device device) { + match { +// require absence of uml::Action corresponding to service + val model = retrieve uml::Model corresponding to UMLPackage.eINSTANCE + } + create { + val class = new uml::Class + } + update { + addCorrespondenceBetween(device, class) + model.packagedElements += class + } +} + +reaction ServerInserted { + after element smarthome::Server inserted in smarthome::SmartHomeSystem[components] + call { + createServerUmlClass(newValue) + } +} + +routine createServerUmlClass(smarthome::Server server) { + match { +// require absence of uml::Action corresponding to service + val model = retrieve uml::Model corresponding to UMLPackage.eINSTANCE + } + create { + val class = new uml::Class + } + update { + addCorrespondenceBetween(server, class) + model.packagedElements += class + } +} \ No newline at end of file diff --git a/bundles/tools.vitruv.applications.smarthomeuml/src/tools/vitruv/applications/smarthomeuml/SmarthomeToUmlChangePropagationSpecification.xtend b/bundles/tools.vitruv.applications.smarthomeuml/src/tools/vitruv/applications/smarthomeuml/SmarthomeToUmlChangePropagationSpecification.xtend new file mode 100644 index 000000000..2dec97cfb --- /dev/null +++ b/bundles/tools.vitruv.applications.smarthomeuml/src/tools/vitruv/applications/smarthomeuml/SmarthomeToUmlChangePropagationSpecification.xtend @@ -0,0 +1,4 @@ +package tools.vitruv.applications.smarthomeuml + +class SmarthomeToUmlChangePropagationSpecification extends mir.reactions.smarthomeToUml.SmarthomeToUmlChangePropagationSpecification { +} diff --git a/bundles/tools.vitruv.applications.smarthomeuml/src/tools/vitruv/applications/smarthomeuml/SmarthomeUmlApplication.java b/bundles/tools.vitruv.applications.smarthomeuml/src/tools/vitruv/applications/smarthomeuml/SmarthomeUmlApplication.java new file mode 100644 index 000000000..51fc4f5b6 --- /dev/null +++ b/bundles/tools.vitruv.applications.smarthomeuml/src/tools/vitruv/applications/smarthomeuml/SmarthomeUmlApplication.java @@ -0,0 +1,26 @@ +package tools.vitruv.applications.smarthomeuml; + +import java.util.HashSet; +import java.util.Set; + +import tools.vitruv.change.propagation.ChangePropagationSpecification; +import tools.vitruv.framework.applications.VitruvApplication; + +import tools.vitruv.applications.smarthomeuml.*; + +public class SmarthomeUmlApplication implements VitruvApplication{ + + @Override + public Set getChangePropagationSpecifications() { + Set specs = new HashSet(); + specs.add(new SmarthomeToUmlChangePropagationSpecification()); +// specs.add(new CombinedUmlClassToPcmReactionsChangePropagationSpecification()); + return specs; + } + + @Override + public String getName() { + return "Smarthome <-> UML Class"; + } + +} diff --git a/features/tools.vitruv.applications.smarthomeuml.feature/.project b/features/tools.vitruv.applications.smarthomeuml.feature/.project new file mode 100644 index 000000000..e8b195cb6 --- /dev/null +++ b/features/tools.vitruv.applications.smarthomeuml.feature/.project @@ -0,0 +1,34 @@ + + + tools.vitruv.applications.smarthomeuml.feature + + + + + + org.eclipse.pde.FeatureBuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.pde.FeatureNature + + + + 1720168160024 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/features/tools.vitruv.applications.smarthomeuml.feature/.settings/org.eclipse.core.resources.prefs b/features/tools.vitruv.applications.smarthomeuml.feature/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/features/tools.vitruv.applications.smarthomeuml.feature/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/features/tools.vitruv.applications.smarthomeuml.feature/.settings/org.eclipse.m2e.core.prefs b/features/tools.vitruv.applications.smarthomeuml.feature/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 000000000..f897a7f1c --- /dev/null +++ b/features/tools.vitruv.applications.smarthomeuml.feature/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/features/tools.vitruv.applications.smarthomeuml.feature/build.properties b/features/tools.vitruv.applications.smarthomeuml.feature/build.properties new file mode 100644 index 000000000..b3a611b5c --- /dev/null +++ b/features/tools.vitruv.applications.smarthomeuml.feature/build.properties @@ -0,0 +1,2 @@ +bin.includes = feature.xml,\ + feature.properties diff --git a/features/tools.vitruv.applications.smarthomeuml.feature/feature.properties b/features/tools.vitruv.applications.smarthomeuml.feature/feature.properties new file mode 100644 index 000000000..03a1d700d --- /dev/null +++ b/features/tools.vitruv.applications.smarthomeuml.feature/feature.properties @@ -0,0 +1,7 @@ +featureName=Vitruv SmartHome-UML Application +description=A Vitruv application for SmartHome and UML models +providerName=vitruv.tools +copyrightURL=http://vitruv.tools +copyright=\ +Copyright (c) 2014-2022 Vitruv Tools Team\n\ +Karlsruhe Institute of Technology (KIT), Karlsruhe, Germany \ No newline at end of file diff --git a/features/tools.vitruv.applications.smarthomeuml.feature/feature.xml b/features/tools.vitruv.applications.smarthomeuml.feature/feature.xml new file mode 100644 index 000000000..9d4512202 --- /dev/null +++ b/features/tools.vitruv.applications.smarthomeuml.feature/feature.xml @@ -0,0 +1,42 @@ + + + + + %description + + + + %copyright + + + + %license + + + + + + + + + + + + + + + + + + diff --git a/releng/tools.vitruv.casestudies.dependencywrapper/META-INF/MANIFEST.MF b/releng/tools.vitruv.casestudies.dependencywrapper/META-INF/MANIFEST.MF index 20df567e6..16e4fb373 100644 --- a/releng/tools.vitruv.casestudies.dependencywrapper/META-INF/MANIFEST.MF +++ b/releng/tools.vitruv.casestudies.dependencywrapper/META-INF/MANIFEST.MF @@ -24,5 +24,6 @@ Require-Bundle: tools.vitruv.dsls.reactions, tools.vitruv.dsls.demo.insurancepersons, edu.kit.ipd.sdq.metamodels.autosar, edu.kit.ipd.sdq.metamodels.simulink, + edu.kit.ipd.sdq.metamodels.smarthome, tools.vitruv.dsls.demo.insurancepersons.tests Bundle-Vendor: tools.vitruv diff --git a/releng/tools.vitruv.casestudies.parent/pom.xml b/releng/tools.vitruv.casestudies.parent/pom.xml index bfe13d74b..796fa34b3 100644 --- a/releng/tools.vitruv.casestudies.parent/pom.xml +++ b/releng/tools.vitruv.casestudies.parent/pom.xml @@ -17,6 +17,7 @@ https://vitruv-tools.github.io/updatesite/nightly/change https://vitruv-tools.github.io/updatesite/nightly/framework https://vitruv-tools.github.io/updatesite/nightly/dsls + https://kit-sdq.github.io/updatesite/release/metamodels/demo/${sdq.demometamodels.version} @@ -39,7 +40,7 @@ Demo Metamodels p2 - https://kit-sdq.github.io/updatesite/release/metamodels/demo/${sdq.demometamodels.version} + ${kit-sdq.demometamodels.url} SDQ Commons @@ -123,6 +124,18 @@ + + local-demometamodels + + + kit-sdq.demometamodels.path + + + + file:///${kit-sdq.demometamodels.path}/releng/edu.kit.ipd.sdq.metamodels.demo.updatesite/target/repository + + + compile-dsls diff --git a/tests/tools.vitruv.applications.smarthomeuml.tests/.classpath b/tests/tools.vitruv.applications.smarthomeuml.tests/.classpath new file mode 100644 index 000000000..2d8e2a152 --- /dev/null +++ b/tests/tools.vitruv.applications.smarthomeuml.tests/.classpath @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/tests/tools.vitruv.applications.smarthomeuml.tests/.project b/tests/tools.vitruv.applications.smarthomeuml.tests/.project new file mode 100644 index 000000000..6c29aa9b3 --- /dev/null +++ b/tests/tools.vitruv.applications.smarthomeuml.tests/.project @@ -0,0 +1,45 @@ + + + tools.vitruv.applications.smarthomeuml.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + + + 1720168160025 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/tests/tools.vitruv.applications.smarthomeuml.tests/.settings/org.eclipse.core.resources.prefs b/tests/tools.vitruv.applications.smarthomeuml.tests/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/tests/tools.vitruv.applications.smarthomeuml.tests/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/tests/tools.vitruv.applications.smarthomeuml.tests/.settings/org.eclipse.jdt.core.prefs b/tests/tools.vitruv.applications.smarthomeuml.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..62ef3488c --- /dev/null +++ b/tests/tools.vitruv.applications.smarthomeuml.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,9 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.compliance=17 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=17 diff --git a/tests/tools.vitruv.applications.smarthomeuml.tests/.settings/org.eclipse.m2e.core.prefs b/tests/tools.vitruv.applications.smarthomeuml.tests/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 000000000..f897a7f1c --- /dev/null +++ b/tests/tools.vitruv.applications.smarthomeuml.tests/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/tests/tools.vitruv.applications.smarthomeuml.tests/META-INF/MANIFEST.MF b/tests/tools.vitruv.applications.smarthomeuml.tests/META-INF/MANIFEST.MF new file mode 100644 index 000000000..be31ceb1e --- /dev/null +++ b/tests/tools.vitruv.applications.smarthomeuml.tests/META-INF/MANIFEST.MF @@ -0,0 +1,18 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Tests +Bundle-SymbolicName: tools.vitruv.applications.smarthomeuml.tests +Bundle-Version: 1.0.0.qualifier +Automatic-Module-Name: tools.vitruv.applications.smarthomeuml.tests +Bundle-RequiredExecutionEnvironment: JavaSE-17 +Require-Bundle: tools.vitruv.testutils.vsum, + tools.vitruv.applications.util.temporary, + tools.vitruv.applications.smarthomeuml, + org.junit, + junit-jupiter-api, + ch.qos.logback.core, + org.slf4j.api, + ch.qos.logback.classic, + edu.kit.ipd.sdq.commons.util.emf, + edu.kit.ipd.sdq.commons.util.java, + org.eclipse.emf.edit diff --git a/tests/tools.vitruv.applications.smarthomeuml.tests/build.properties b/tests/tools.vitruv.applications.smarthomeuml.tests/build.properties new file mode 100644 index 000000000..34d2e4d2d --- /dev/null +++ b/tests/tools.vitruv.applications.smarthomeuml.tests/build.properties @@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . diff --git a/tests/tools.vitruv.applications.smarthomeuml.tests/lib/slf4j-api-2.0.13.jar b/tests/tools.vitruv.applications.smarthomeuml.tests/lib/slf4j-api-2.0.13.jar new file mode 100644 index 000000000..a800cc2b5 Binary files /dev/null and b/tests/tools.vitruv.applications.smarthomeuml.tests/lib/slf4j-api-2.0.13.jar differ