Skip to content

Commit 0c697d1

Browse files
committed
version 1.0.00
1 parent 437179c commit 0c697d1

File tree

9 files changed

+130
-67
lines changed

9 files changed

+130
-67
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<!-- definition -->
66
<groupId>fr.softeam</groupId>
77
<artifactId>cameldesigner</artifactId>
8-
<version>0.1.06</version>
8+
<version>1.0.00</version>
99
<name>CamelDesigner</name>
1010
<repositories>
1111
<repository>

src/main/conf/module.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ command.UnitModel.tooltip=
6666
command.Unit_Model_Diagram.label=Unit_Model_Diagram
6767
command.Unit_Model_Diagram.tooltip=
6868

69-
group.Camel_Sub_Models.label=Camel_Sub_Models
69+
group.Camel_Sub_Models.label=Camel Sub Models
7070
group.Common.label=Common
7171
group.Configuration.label=Configuration
7272
group.Constraint.label=Constraint
@@ -76,7 +76,7 @@ group.Data.label=Data
7676
group.Data_Instances.label=Data Instances
7777
group.Deployment_Type.label=Deployment Type
7878
group.Execution.label=Execution
79-
group.Free_Drawing.label=Free_Drawing
79+
group.Free_Drawing.label=Free Drawing
8080
group.Group0.label=Group0
8181
group.Import/Export.label=Import/Export
8282
group.Link.label=Link

src/main/conf/module.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
<Module id="${project.name}" class="fr.softeam.cameldesigner.impl.CamelDesignerModule" binaryversion="4.1.0" version="${project.version}" schema-level="2" uid="dc1688c2-8bd2-4585-a786-b1b5877996d7" author="Softeam" image="" url="">
33
<ClassPath>
44
<PathEntry path="lib/${project.artifactId}-${project.version}.jar"/>
5+
<PathEntry path="lib/com.google.guava-21.0.0-SNAPSHOT.jar"/>
6+
<PathEntry path="lib/org.eclipse.emf.mwe.core-1.3.21-SNAPSHOT.jar"/>
7+
<PathEntry path="lib/org.eclipse.emf.mwe2.runtime-2.9.1-SNAPSHOT.jar"/>
8+
<PathEntry path="lib/org.eclipse.emf.mwe.utils-1.3.21-SNAPSHOT.jar"/>
9+
<PathEntry path="lib/CamelDSLExporter-3.0.0-SNAPSHOT.jar"/>
510
<PathEntry path="lib/uml-5.2.200.jar"/>
611
<PathEntry path="lib/inject-3.0.0.jar"/>
712
<PathEntry path="lib/registry-3.7.0.jar"/>
@@ -2321,8 +2326,6 @@
23212326
<ToolRef refid="CREATE_RELATED_DIAGRAM_LINK" group="%group.Common.label"/>
23222327
<ToolRef refid="CREATE_NOTE" group="%group.Common.label"/>
23232328
<ToolRef refid="CREATE_TRACEABILITY" group="%group.Common.label"/>
2324-
<ToolRef refid="PropertyDependency" group="%group.Common.label"/>
2325-
<ToolRef refid="CREATE_DEPENDENCY" group="%group.Common.label"/>
23262329
<ToolRef refid="CREATE_DRAWING_LINE" group="%group.Free_Drawing.label"/>
23272330
<ToolRef refid="CREATE_DRAWING_RECTANGLE" group="%group.Free_Drawing.label"/>
23282331
<ToolRef refid="CREATE_DRAWING_TEXT" group="%group.Free_Drawing.label"/>
0 Bytes
Binary file not shown.
507 KB
Binary file not shown.

src/main/java/fr/softeam/cameldesigner/conversion/process/reverse/ReverseProcessDeploymentType.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ private fr.softeam.cameldesigner.api.deploymentmodel.standard.port.Communication
271271
fr.softeam.cameldesigner.api.deploymentmodel.standard.port.CommunicationPort requiredCommunication = fr.softeam.cameldesigner.api.deploymentmodel.standard.port.CommunicationPort.create();
272272
requiredCommunication.getElement().setDirection(PortOrientation.IN);
273273
requiredCommunication.getElement().setValue(Integer.toString(element.getPortNumber()));
274+
requiredCommunication.setIsMandatory(requiredCommunication.isIsMandatory());
274275
return requiredCommunication;
275276
}
276277

Lines changed: 95 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
package fr.softeam.cameldesigner.conversion.process.reverse;
22

33
import java.util.Map;
4-
import camel.core.MeasurableAttribute;
5-
import camel.metric.CompositeMetric;
6-
import camel.metric.CompositeMetricContext;
7-
import camel.metric.MetricTemplate;
8-
import camel.metric.MetricVariable;
9-
import camel.metric.ObjectContext;
10-
import camel.metric.RawMetric;
11-
import camel.metric.RawMetricContext;
12-
import camel.metric.Schedule;
13-
import camel.metric.Sensor;
14-
import camel.metric.Window;
4+
import camel.metric.WindowSizeType;
5+
import camel.metric.WindowType;
156
import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement;
7+
import fr.softeam.cameldesigner.api.camelcore.standard.class_.MeasurableAttribute;
8+
import fr.softeam.cameldesigner.api.metricmodel.standard.class_.CompositeMetric;
9+
import fr.softeam.cameldesigner.api.metricmodel.standard.class_.CompositeMetricContext;
10+
import fr.softeam.cameldesigner.api.metricmodel.standard.class_.MetricTemplate;
11+
import fr.softeam.cameldesigner.api.metricmodel.standard.class_.MetricVariable;
12+
import fr.softeam.cameldesigner.api.metricmodel.standard.class_.ObjectContext;
13+
import fr.softeam.cameldesigner.api.metricmodel.standard.class_.RawMetric;
14+
import fr.softeam.cameldesigner.api.metricmodel.standard.class_.RawMetricContext;
15+
import fr.softeam.cameldesigner.api.metricmodel.standard.class_.Schedule;
16+
import fr.softeam.cameldesigner.api.metricmodel.standard.class_.Window;
17+
import fr.softeam.cameldesigner.api.typemodel.standard.datatype.ValueType;
18+
import fr.softeam.cameldesigner.api.unitmodel.standard.datatype.Unit;
1619
import org.eclipse.emf.cdo.CDOObject;
1720
import org.modelio.metamodel.uml.infrastructure.ModelElement;
1821

@@ -23,71 +26,78 @@ public ReverseProcessMetricType(ModelElement umlElementParent, Map<CDOObject, Ca
2326

2427
@Override
2528
protected CamelElement switchReverse(CDOObject element) {
26-
if(element instanceof MeasurableAttribute) {
27-
return reverse ((MeasurableAttribute)element);
28-
} else if (element instanceof RawMetricContext) {
29-
return reverse ((RawMetricContext)element);
30-
} else if (element instanceof CompositeMetricContext) {
31-
return reverse ((CompositeMetricContext)element);
32-
} else if (element instanceof ObjectContext) {
33-
return reverse ((ObjectContext)element);
34-
} else if (element instanceof RawMetric) {
35-
return reverse ((RawMetric)element);
36-
} else if (element instanceof CompositeMetric) {
37-
return reverse ((CompositeMetric)element);
38-
} else if (element instanceof MetricVariable) {
39-
return reverse ((MetricVariable)element);
40-
} else if (element instanceof Window) {
41-
return reverse ((Window)element);
42-
} else if (element instanceof Schedule) {
43-
return reverse ((Schedule)element);
44-
} else if (element instanceof Sensor) {
45-
return reverse ((Sensor)element);
46-
} else if (element instanceof MetricTemplate) {
47-
return reverse ((MetricTemplate)element);
29+
if(element instanceof camel.core.MeasurableAttribute) {
30+
return reverse ((camel.core.MeasurableAttribute)element);
31+
} else if (element instanceof camel.metric.RawMetricContext) {
32+
return reverse ((camel.metric.RawMetricContext)element);
33+
} else if (element instanceof camel.metric.CompositeMetricContext) {
34+
return reverse ((camel.metric.CompositeMetricContext)element);
35+
} else if (element instanceof camel.metric.ObjectContext) {
36+
return reverse ((camel.metric.ObjectContext)element);
37+
} else if (element instanceof camel.metric.RawMetric) {
38+
return reverse ((camel.metric.RawMetric)element);
39+
} else if (element instanceof camel.metric.CompositeMetric) {
40+
return reverse ((camel.metric.CompositeMetric)element);
41+
} else if (element instanceof camel.metric.MetricVariable) {
42+
return reverse ((camel.metric.MetricVariable)element);
43+
} else if (element instanceof camel.metric.Window) {
44+
return reverse ((camel.metric.Window)element);
45+
} else if (element instanceof camel.metric.Schedule) {
46+
return reverse ((camel.metric.Schedule)element);
47+
} else if (element instanceof camel.metric.Sensor) {
48+
return reverse ((camel.metric.Sensor)element);
49+
} else if (element instanceof camel.metric.MetricTemplate) {
50+
return reverse ((camel.metric.MetricTemplate)element);
4851
}
4952
return null;
5053
}
5154

52-
private fr.softeam.cameldesigner.api.metricmodel.standard.class_.MetricTemplate reverse(MetricTemplate element) {
53-
fr.softeam.cameldesigner.api.metricmodel.standard.class_.MetricTemplate metricTemplateProxy = fr.softeam.cameldesigner.api.metricmodel.standard.class_.MetricTemplate.create();
55+
private MetricTemplate reverse(camel.metric.MetricTemplate element) {
56+
MetricTemplate metricTemplateProxy = MetricTemplate.create();
5457

5558
if(element.getAttribute() != null) {
5659
MeasurableAttribute referencedMeasurableAttribute = retrievReferencedMeasurableAttribute(element.getAttribute());
5760
if(referencedMeasurableAttribute != null) {
58-
// TODO
61+
metricTemplateProxy.setAttribute(referencedMeasurableAttribute);
5962
}
6063
}
6164

6265
if(element.getUnit() != null) {
63-
// TODO
66+
Unit referencedUnit = retrieveReferencedUnit(element.getUnit());
67+
if(referencedUnit != null) {
68+
metricTemplateProxy.setUnit(referencedUnit);
69+
}
6470
}
6571

6672
if(element.getValueType() != null) {
6773
// TODO
74+
//ValueType referencedValueType = retrievReferencedValueType(element.getUnit());
75+
// if(referencedValueType != null) {
76+
// metricTemplateProxy.set(referencedValueType);
77+
// }
6878
}
6979
metricTemplateProxy.setValueDirection(Short.toString(element.getValueDirection()));
7080
return metricTemplateProxy;
7181
}
7282

73-
private fr.softeam.cameldesigner.api.metricmodel.standard.component.Sensor reverse(Sensor element) {
83+
private fr.softeam.cameldesigner.api.metricmodel.standard.component.Sensor reverse(camel.metric.Sensor element) {
7484
fr.softeam.cameldesigner.api.metricmodel.standard.component.Sensor sensorProxy = fr.softeam.cameldesigner.api.metricmodel.standard.component.Sensor.create() ; //sensorProxy
7585
sensorProxy.setIsPush(Boolean.toString(element.isIsPush()));
7686
sensorProxy.setConfiguration(element.getConfiguration());
7787
return sensorProxy;
7888
}
7989

80-
private fr.softeam.cameldesigner.api.metricmodel.standard.class_.Schedule reverse(Schedule element) {
81-
return fr.softeam.cameldesigner.api.metricmodel.standard.class_.Schedule.create();
90+
private Schedule reverse(camel.metric.Schedule element) {
91+
return Schedule.create();
8292
}
8393

84-
private fr.softeam.cameldesigner.api.metricmodel.standard.class_.Window reverse(Window element) {
85-
fr.softeam.cameldesigner.api.metricmodel.standard.class_.Window windowProxy = fr.softeam.cameldesigner.api.metricmodel.standard.class_.Window.create();
94+
private Window reverse(camel.metric.Window element) {
95+
Window windowProxy = Window.create();
8696

8797
windowProxy.setMeasurementSize(Long.toString(element.getMeasurementSize()));
8898

8999
if(element.getSizeType() != null) {
90-
// TODO
100+
windowProxy.setWindowType(element.getSizeType().toString());
91101
}
92102

93103
windowProxy.setTimeSize(Long.toString(element.getTimeSize()));
@@ -98,45 +108,72 @@ private fr.softeam.cameldesigner.api.metricmodel.standard.class_.Window reverse(
98108
}
99109

100110
if(element.getWindowType() != null) {
101-
// TODO
111+
windowProxy.setWindowType(element.getWindowType().toString());
102112
}
103113
return windowProxy;
104114
}
105115

106-
private fr.softeam.cameldesigner.api.metricmodel.standard.class_.MetricVariable reverse(MetricVariable element) {
107-
return fr.softeam.cameldesigner.api.metricmodel.standard.class_.MetricVariable.create();
116+
private MetricVariable reverse(camel.metric.MetricVariable element) {
117+
return MetricVariable.create();
108118
}
109119

110-
private fr.softeam.cameldesigner.api.metricmodel.standard.class_.CompositeMetric reverse(CompositeMetric element) {
111-
return fr.softeam.cameldesigner.api.metricmodel.standard.class_.CompositeMetric.create();
120+
private CompositeMetric reverse(camel.metric.CompositeMetric element) {
121+
return CompositeMetric.create();
112122
}
113123

114-
private fr.softeam.cameldesigner.api.metricmodel.standard.class_.RawMetric reverse(RawMetric element) {
124+
private RawMetric reverse(camel.metric.RawMetric element) {
115125
// TODO add dependencies
116-
return fr.softeam.cameldesigner.api.metricmodel.standard.class_.RawMetric.create();
126+
return RawMetric.create();
117127
}
118128

119-
private fr.softeam.cameldesigner.api.metricmodel.standard.class_.ObjectContext reverse(ObjectContext element) {
120-
return fr.softeam.cameldesigner.api.metricmodel.standard.class_.ObjectContext.create();
129+
private ObjectContext reverse(camel.metric.ObjectContext element) {
130+
return ObjectContext.create();
121131
}
122132

123-
private fr.softeam.cameldesigner.api.metricmodel.standard.class_.CompositeMetricContext reverse(CompositeMetricContext element) {
133+
private CompositeMetricContext reverse(camel.metric.CompositeMetricContext element) {
124134
// TODO add dependencies
125-
return fr.softeam.cameldesigner.api.metricmodel.standard.class_.CompositeMetricContext.create();
135+
return CompositeMetricContext.create();
126136
}
127137

128-
private fr.softeam.cameldesigner.api.metricmodel.standard.class_.RawMetricContext reverse(RawMetricContext element) {
129-
return fr.softeam.cameldesigner.api.metricmodel.standard.class_.RawMetricContext.create();
138+
private RawMetricContext reverse(camel.metric.RawMetricContext element) {
139+
return RawMetricContext.create();
130140
}
131141

132-
private fr.softeam.cameldesigner.api.camelcore.standard.class_.MeasurableAttribute reverse(MeasurableAttribute element) {
142+
private MeasurableAttribute reverse(camel.core.MeasurableAttribute element) {
133143
fr.softeam.cameldesigner.api.camelcore.standard.class_.MeasurableAttribute measurableAttributeProxy = fr.softeam.cameldesigner.api.camelcore.standard.class_.MeasurableAttribute.create();
134144
return measurableAttributeProxy;
135145
}
136146

137-
private MeasurableAttribute retrievReferencedMeasurableAttribute(MeasurableAttribute attribute) {
147+
private MeasurableAttribute retrievReferencedMeasurableAttribute(camel.core.MeasurableAttribute measurableAttribute) {
148+
MeasurableAttribute referencedMeasurableAttribute = null;
149+
if(this.processedCamelElements.containsKey(measurableAttribute)) {
150+
referencedMeasurableAttribute = (MeasurableAttribute) this.processedCamelElements.get(measurableAttribute);
151+
} else {
152+
referencedMeasurableAttribute = (MeasurableAttribute) this.switchReverse(measurableAttribute);
153+
referencedMeasurableAttribute.getElement().setName(measurableAttribute.getName());
154+
this.processedCamelElements.put(measurableAttribute, referencedMeasurableAttribute);
155+
}
156+
return referencedMeasurableAttribute;
157+
}
158+
159+
private ValueType retrieveReferencedValueType(camel.unit.Unit unit) {
160+
// TODO Auto-generated method stub
161+
return null;
162+
}
163+
164+
private Unit retrieveReferencedUnit(camel.unit.Unit unit) {
138165
// TODO Auto-generated method stub
139166
return null;
140167
}
141168

169+
170+
// private String retrieveWindowType(WindowType windowType) {
171+
// // TODO Auto-generated method stub
172+
// return null;
173+
// }
174+
//
175+
// private String retrieveSizeType(WindowSizeType sizeType) {
176+
// // TODO Auto-generated method stub
177+
// return null;
178+
// }
142179
}

src/main/java/fr/softeam/cameldesigner/impl/CamelDesignerLifeCycleHandler.java

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
package fr.softeam.cameldesigner.impl;
22

3+
import java.io.File;
4+
import java.nio.file.Path;
35
import java.util.Map;
6+
import org.eclipse.core.runtime.NullProgressMonitor;
7+
import org.modelio.api.modelio.mc.IModelComponentDescriptor;
8+
import org.modelio.api.modelio.mc.IModelComponentService;
49
import org.modelio.api.module.lifecycle.DefaultModuleLifeCycleHandler;
510
import org.modelio.api.module.lifecycle.ModuleException;
611
import org.modelio.vbasic.version.Version;
@@ -14,9 +19,7 @@ public CamelDesignerLifeCycleHandler(final CamelDesignerModule module) {
1419

1520
@Override
1621
public boolean start() throws ModuleException {
17-
//IModelingSession modelingSession = this.module.getModuleContext().getModelingSession();
18-
//this.modelChangeHandler = new CamelModelChangeHandler();
19-
//modelingSession.addModelHandler(this.modelChangeHandler);
22+
installRamc();
2023
return super.start();
2124
}
2225

@@ -47,4 +50,23 @@ public void unselect() throws ModuleException {
4750
super.unselect();
4851
}
4952

53+
private void installRamc() {
54+
Path mdaplugsPath = this.module.getModuleContext().getConfiguration().getModuleResourcesPath();
55+
56+
final IModelComponentService modelComponentService = CamelDesignerModule.getInstance().getModuleContext().getModelioServices().getModelComponentService();
57+
for (IModelComponentDescriptor mc : modelComponentService.getModelComponents()) {
58+
if (mc.getName().equals("MetaDataSchema")) {
59+
if (new Version(mc.getVersion()).isOlderThan(new Version("1.0.00"))) {
60+
modelComponentService.deployModelComponent(new File(mdaplugsPath.resolve("res" + File.separator + "ramc" + File.separator + "MetaDataSchema.ramc").toString()), new NullProgressMonitor());
61+
} else {
62+
// Ramc already deployed...
63+
return;
64+
}
65+
}
66+
}
67+
68+
// No ramc found, deploy it
69+
modelComponentService.deployModelComponent(new File(mdaplugsPath.resolve("res" + File.separator + "ramc" + File.separator + "MetaDataSchema.ramc").toString()), new NullProgressMonitor());
70+
}
71+
5072
}

src/main/java/fr/softeam/cameldesigner/impl/CamelDesignerModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public IMdaExpert getMdaExpert(final Stereotype st) {
7777
*/
7878
private IMdaExpert getGeneratedMdaExpert(final Stereotype st) {
7979
switch (st.getUuid()) {
80-
default: return null;
80+
default: return null;
8181
}
8282
}
8383

0 commit comments

Comments
 (0)