Skip to content

Commit

Permalink
update on UUID v4 resource generation on creating resource
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe Gourdin committed Mar 8, 2016
1 parent 43fe335 commit 35e1d94
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<description:Group xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:tool="http://www.eclipse.org/sirius/diagram/description/tool/1.1.0" xmlns:tool_1="http://www.eclipse.org/sirius/description/tool/1.1.0" name="OCCIware" version="10.0.0.201505222000">
<description:Group xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:tool="http://www.eclipse.org/sirius/diagram/description/tool/1.1.0" xmlns:tool_1="http://www.eclipse.org/sirius/description/tool/1.1.0" name="OCCIware" version="10.1.0.201507271600">
<ownedViewpoints name="OCCI Extension" modelFileExtension="occie">
<ownedRepresentations xsi:type="description_1:DiagramDescription" name="Extension diagram" domainClass="occi.Extension">
<metamodel href="../../org.occiware.clouddesigner.occi/model/OCCI.ecore#/"/>
Expand Down Expand Up @@ -37,7 +37,7 @@
</style>
</edgeMappings>
<containerMappings name="ImportContainer" semanticCandidatesExpression="feature:import" domainClass="occi.Extension" reusedContainerMappings="//@ownedViewpoints[name='OCCI%20Extension']/@ownedRepresentations[name='Extension%20diagram']/@defaultLayer/@containerMappings[name='KindContainer'] //@ownedViewpoints[name='OCCI%20Extension']/@ownedRepresentations[name='Extension%20diagram']/@defaultLayer/@containerMappings[name='MixinContainer'] //@ownedViewpoints[name='OCCI%20Extension']/@ownedRepresentations[name='Extension%20diagram']/@defaultLayer/@containerMappings[name='EC%20EDataType'] //@ownedViewpoints[name='OCCI%20Extension']/@ownedRepresentations[name='Extension%20diagram']/@defaultLayer/@containerMappings[name='EC%20EEnum']">
<style xsi:type="style:FlatContainerStyleDescription" arcWidth="1" arcHeight="1" labelSize="12" foregroundColor="//@userColorsPalettes[name='CloudDesigner']/@entries[name='ImportColor']">
<style xsi:type="style:FlatContainerStyleDescription" arcWidth="1" arcHeight="1" borderSizeComputationExpression="1" labelSize="12" foregroundColor="//@userColorsPalettes[name='CloudDesigner']/@entries[name='ImportColor']">
<borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
<labelFormat>bold</labelFormat>
<labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
Expand Down Expand Up @@ -87,7 +87,7 @@
<color xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='gray']"/>
</style>
</subNodeMappings>
<style xsi:type="style:FlatContainerStyleDescription" arcWidth="8" arcHeight="8" borderColor="//@userColorsPalettes[name='CloudDesigner']/@entries[name='KindBorderColor']" labelSize="12" showIcon="false" labelExpression="feature:term" roundedCorner="true" backgroundStyle="GradientTopToBottom" backgroundColor="//@userColorsPalettes[name='CloudDesigner']/@entries[name='KindColor']">
<style xsi:type="style:FlatContainerStyleDescription" arcWidth="8" arcHeight="8" borderSizeComputationExpression="1" borderColor="//@userColorsPalettes[name='CloudDesigner']/@entries[name='KindBorderColor']" labelSize="12" showIcon="false" labelExpression="feature:term" roundedCorner="true" backgroundStyle="GradientTopToBottom" backgroundColor="//@userColorsPalettes[name='CloudDesigner']/@entries[name='KindColor']">
<labelFormat>bold</labelFormat>
<labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
<foregroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='white']"/>
Expand Down Expand Up @@ -136,7 +136,7 @@
<color xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='gray']"/>
</style>
</subNodeMappings>
<style xsi:type="style:FlatContainerStyleDescription" arcWidth="8" arcHeight="8" borderColor="//@userColorsPalettes[name='CloudDesigner']/@entries[name='MixinBorderColor']" labelSize="12" showIcon="false" labelExpression="feature:term" roundedCorner="true" backgroundStyle="GradientTopToBottom" backgroundColor="//@userColorsPalettes[name='CloudDesigner']/@entries[name='MixinColor']">
<style xsi:type="style:FlatContainerStyleDescription" arcWidth="8" arcHeight="8" borderSizeComputationExpression="1" borderColor="//@userColorsPalettes[name='CloudDesigner']/@entries[name='MixinBorderColor']" labelSize="12" showIcon="false" labelExpression="feature:term" roundedCorner="true" backgroundStyle="GradientTopToBottom" backgroundColor="//@userColorsPalettes[name='CloudDesigner']/@entries[name='MixinColor']">
<labelFormat>bold</labelFormat>
<labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
<foregroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='white']"/>
Expand All @@ -158,7 +158,7 @@
<color xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
</style>
</subNodeMappings>
<style xsi:type="style:FlatContainerStyleDescription" arcWidth="1" arcHeight="1" labelSize="10" widthComputationExpression="14" heightComputationExpression="5" backgroundStyle="Liquid" foregroundColor="//@userColorsPalettes[name='CloudDesigner']/@entries[name='DataTypeColor']">
<style xsi:type="style:FlatContainerStyleDescription" arcWidth="1" arcHeight="1" borderSizeComputationExpression="1" labelSize="10" widthComputationExpression="14" heightComputationExpression="5" backgroundStyle="Liquid" foregroundColor="//@userColorsPalettes[name='CloudDesigner']/@entries[name='DataTypeColor']">
<borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
<labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
<backgroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='white']"/>
Expand All @@ -172,7 +172,7 @@
<color xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
</style>
</subNodeMappings>
<style xsi:type="style:FlatContainerStyleDescription" arcWidth="1" arcHeight="1" labelSize="10" backgroundStyle="Liquid" foregroundColor="//@userColorsPalettes[name='CloudDesigner']/@entries[name='DataTypeColor']">
<style xsi:type="style:FlatContainerStyleDescription" arcWidth="1" arcHeight="1" borderSizeComputationExpression="1" labelSize="10" backgroundStyle="Liquid" foregroundColor="//@userColorsPalettes[name='CloudDesigner']/@entries[name='DataTypeColor']">
<borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
<labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
<backgroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='white']"/>
Expand Down Expand Up @@ -377,7 +377,7 @@
<color xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='gray']"/>
</style>
</subNodeMappings>
<style xsi:type="style:FlatContainerStyleDescription" arcWidth="1" arcHeight="1" labelSize="10" labelExpression="[id+': '+kind.term/]" foregroundColor="//@userColorsPalettes[name='CloudDesigner']/@entries[name='ResourceColor']">
<style xsi:type="style:FlatContainerStyleDescription" arcWidth="1" arcHeight="1" borderSizeComputationExpression="1" labelSize="10" labelExpression="[id+': '+kind.term/]" foregroundColor="//@userColorsPalettes[name='CloudDesigner']/@entries[name='ResourceColor']">
<borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
<labelFormat>bold</labelFormat>
<labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
Expand Down Expand Up @@ -407,7 +407,7 @@
<color xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='gray']"/>
</style>
</subNodeMappings>
<style xsi:type="style:FlatContainerStyleDescription" arcWidth="1" arcHeight="1" labelSize="10" showIcon="false" labelExpression="[id+': '+kind.term/]">
<style xsi:type="style:FlatContainerStyleDescription" arcWidth="1" arcHeight="1" borderSizeComputationExpression="1" labelSize="10" showIcon="false" labelExpression="[id+': '+kind.term/]">
<borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
<labelFormat>bold</labelFormat>
<labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
Expand All @@ -429,9 +429,7 @@
<viewVariable name="containerView"/>
<initialOperation>
<firstModelOperations xsi:type="tool_1:ChangeContext" browseExpression="var:container">
<subModelOperations xsi:type="tool_1:CreateInstance" typeName="occi.Resource" referenceName="resources">
<subModelOperations xsi:type="tool_1:SetValue" featureName="id" valueExpression="['r' + container.oclAsType(Configuration).resources->size().toString()/]"/>
</subModelOperations>
<subModelOperations xsi:type="tool_1:CreateInstance" typeName="occi.Resource" referenceName="resources"/>
</firstModelOperations>
</initialOperation>
</ownedTools>
Expand All @@ -443,9 +441,7 @@
<initialOperation>
<firstModelOperations xsi:type="tool_1:ChangeContext" browseExpression="var:source">
<subModelOperations xsi:type="tool_1:CreateInstance" typeName="occi.Link" referenceName="links" variableName="link">
<subModelOperations xsi:type="tool_1:SetValue" featureName="id" valueExpression="['l' + source.oclAsType(Resource).links->size().toString()/]">
<subModelOperations xsi:type="tool_1:SetValue" featureName="target" valueExpression="var:target"/>
</subModelOperations>
<subModelOperations xsi:type="tool_1:SetValue" featureName="target" valueExpression="var:target"/>
</subModelOperations>
</firstModelOperations>
</initialOperation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.DiagnosticChain;
Expand Down Expand Up @@ -135,7 +137,7 @@ public abstract class EntityImpl extends MinimalEObjectImpl.Container implements
protected EntityImpl() {
super();
// Generate a new ID for this entity.
setId(EcoreUtil.generateUUID());
setId(UUID.randomUUID().toString());
// If kind is not set then
if(kind == null) {
try {
Expand Down

0 comments on commit 35e1d94

Please sign in to comment.