Bug 508226 - The Domain Specification of Service is a must, ...
When defining a Service, the user is prompted to select a domain. This
makes it clear to the user that a domain property is necessary for a
Service.
Change-Id: I79299414ff3a1b960baf3bfe1148b94e2974bef3
Signed-off-by: Jad El-khoury <jad@kth.se>
diff --git a/org.eclipse.lyo.tools.toolchain.design/description/ToolChainModel.odesign b/org.eclipse.lyo.tools.toolchain.design/description/ToolChainModel.odesign
index 3dd40f3..42140d0 100644
--- a/org.eclipse.lyo.tools.toolchain.design/description/ToolChainModel.odesign
+++ b/org.eclipse.lyo.tools.toolchain.design/description/ToolChainModel.odesign
@@ -283,7 +283,9 @@
</containerMappings>
<toolSections name="Operations">
<ownedTools xsi:type="tool_1:ContainerCreationDescription" name="Toolchain.CreateAdaptorInterface" containerMappings="//@ownedViewpoints[name='ToolchainViewpoint']/@ownedRepresentations[name='ToolchainDiagram']/@defaultLayer/@containerMappings[name='Toolchain.AdaptorInterface']" iconPath="/org.eclipse.lyo.tools.toolchain.design/images/IconNewAdaptor.png">
- <variable name="container"/>
+ <variable name="container">
+ <subVariables xsi:type="tool:SelectModelElementVariable" name="domainSpecification" candidatesExpression="[container.oclAsType(Toolchain).specification.domainSpecifications/]" message="Select the domain that is implemented by the services of this adaptor. (If no domains are available, first define domains in the SpecificationDiagram view)"/>
+ </variable>
<viewVariable name="containerView"/>
<initialOperation>
<firstModelOperations xsi:type="tool:CreateInstance" typeName="adaptorinterface.AdaptorInterface" referenceName="adaptorInterfaces" variableName="adaptorInterface">
@@ -301,6 +303,7 @@
<subModelOperations xsi:type="tool:SetValue" featureName="description" valueExpression="['Service Provider'/]"/>
<subModelOperations xsi:type="tool:CreateInstance" typeName="adaptorinterface.Service" referenceName="services">
<subModelOperations xsi:type="tool:CreateInstance" typeName="adaptorinterface.BasicCapability" referenceName="basicCapabilities"/>
+ <subModelOperations xsi:type="tool:SetValue" featureName="domainSpecification" valueExpression="[domainSpecification/]"/>
</subModelOperations>
</subModelOperations>
</subModelOperations>
@@ -562,11 +565,15 @@
</initialOperation>
</ownedTools>
<ownedTools xsi:type="tool_1:NodeCreationDescription" name="AdaptorInterface.CreateService" precondition="[not container.oclIsTypeOf(AdaptorInterface) /]" nodeMappings="//@ownedViewpoints[name='ToolchainViewpoint']/@ownedRepresentations[name='AdaptorInterfaceDiagram']/@defaultLayer/@nodeMappings[name='AdaptorInterface.Service']" extraMappings="//@ownedViewpoints[name='ToolchainViewpoint']/@ownedRepresentations[name='AdaptorInterfaceDiagram']/@defaultLayer/@nodeMappings[name='AdaptorInterface.ServiceProvider']">
- <variable name="container"/>
+ <variable name="container">
+ <subVariables xsi:type="tool:SelectModelElementVariable" name="domainSpecification" candidatesExpression="[container.oclAsType(ServiceProvider).eContainer(Toolchain).specification.domainSpecifications/]" message="Select the domain that is implemented by this service. (If no domains are available, first define domains in the SpecificationDiagram view)"/>
+ </variable>
<viewVariable name="containerView"/>
<initialOperation>
<firstModelOperations xsi:type="tool:ChangeContext" browseExpression="var:container">
- <subModelOperations xsi:type="tool:CreateInstance" typeName="adaptorinterface.Service" referenceName="services"/>
+ <subModelOperations xsi:type="tool:CreateInstance" typeName="adaptorinterface.Service" referenceName="services">
+ <subModelOperations xsi:type="tool:SetValue" featureName="domainSpecification" valueExpression="[domainSpecification/]"/>
+ </subModelOperations>
</firstModelOperations>
</initialOperation>
</ownedTools>