Skip to content

Commit

Permalink
Camel Designer 1.0.12
Browse files Browse the repository at this point in the history
Adds rules.
Fixes import, export.
  • Loading branch information
etiennebrosse committed Oct 14, 2022
1 parent 343ad2f commit 5dc68b4
Show file tree
Hide file tree
Showing 178 changed files with 5,881 additions and 2,253 deletions.
23 changes: 16 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@
<type>pom</type>
<scope>provided</scope>
</dependency>

<!--
<dependency>
<groupId>com.google</groupId>
<artifactId>inject</artifactId>
<version>3.0.0</version>
<type>jar</type>
</dependency>

-->
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>registry</artifactId>
Expand All @@ -63,14 +63,14 @@
<version>1.0.0</version>
<type>jar</type>
</dependency>

<!--
<dependency>
<groupId>org.eclipse.orbit.bundles</groupId>
<artifactId>com.google.guava</artifactId>
<version>21.0.0-SNAPSHOT</version>
<type>jar</type>
</dependency>

-->
<dependency>
<groupId>org.eclipse.ocl.xtext</groupId>
<artifactId>oclstdlib</artifactId>
Expand Down Expand Up @@ -151,14 +151,14 @@
<artifactId>net4j</artifactId>
<version>4.1.500</version>
</dependency>

<!--
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>multibindings</artifactId>
<version>3.0.0</version>
<type>jar</type>
</dependency>

-->
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>app</artifactId>
Expand Down Expand Up @@ -538,4 +538,13 @@
</pluginManagement>
</build>
<description>Modelio Module for designing the Cloud Application Modelling and Execution Language (CAMEL). For more information about CAMEL see http://camel-dsl.org/</description>
</project>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google</groupId>
<artifactId>inject</artifactId>
<version>3.0.0</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
273 changes: 264 additions & 9 deletions src/main/conf/module.xml

Large diffs are not rendered by default.

Binary file modified src/main/conf/res/generated/patterns/framework.umlt
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ public List<FeatureClassifier> getSubFeatures() {
if (OptimisationRequirement.canInstantiate(mObj))
results.add((OptimisationRequirement)CamelDesignerProxyFactory.instantiate(mObj, OptimisationRequirement.STEREOTYPE_NAME));
}
return Collections.unmodifiableList(results);
return (results);
}

@objid ("9a96fc7d-4040-4ea0-8b72-c6e6e3e7fea2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,19 @@
import java.util.List;
import java.util.Objects;
import com.modeliosoft.modelio.javadesigner.annotations.objid;
import fr.softeam.cameldesigner.api.CamelDesignerProxyFactory;
import fr.softeam.cameldesigner.api.ICamelDesignerPeerModule;
import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement;
import fr.softeam.cameldesigner.impl.CamelDesignerModule;
import org.modelio.api.modelio.model.IModelingSession;
import org.modelio.api.modelio.model.PropertyConverter;
import org.modelio.api.module.context.IModuleContext;
import org.modelio.metamodel.mmextensions.infrastructure.ExtensionNotFoundException;
import org.modelio.metamodel.uml.infrastructure.Dependency;
import org.modelio.metamodel.uml.infrastructure.ModelElement;
import org.modelio.metamodel.uml.infrastructure.Stereotype;
import org.modelio.metamodel.uml.infrastructure.TagType;
import org.modelio.metamodel.uml.infrastructure.properties.PropertyDefinition;
import org.modelio.metamodel.uml.infrastructure.properties.PropertyTableDefinition;
import org.modelio.metamodel.uml.statik.Enumeration;
import org.modelio.metamodel.uml.statik.EnumerationLiteral;
import org.modelio.vcore.smkernel.mapi.MObject;
import fr.softeam.cameldesigner.api.CamelDesignerProxyFactory;
import fr.softeam.cameldesigner.api.ICamelDesignerPeerModule;
import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement;
import fr.softeam.cameldesigner.impl.CamelDesignerModule;

/**
* Proxy class to handle a {@link Enumeration} with << GeographicalRegion >> stereotype.
Expand All @@ -43,7 +39,7 @@ public class GeographicalRegion extends Location {
* Tells whether a {@link GeographicalRegion proxy} can be instantiated from a {@link MObject} checking it is a {@link Enumeration} stereotyped << GeographicalRegion >>.
* <p>
* The method returns <code>false</code> if the instantiation cannot be carried out.
*
*
* @param elt a model object
* @return <code>true</code> if the instantiation can be carried out else <code>false</code>.
*/
Expand All @@ -54,7 +50,7 @@ public static boolean canInstantiate(final MObject elt) {

/**
* Create a new {@link Enumeration} stereotyped << GeographicalRegion >> then instantiate a {@link GeographicalRegion} proxy.
*
*
* @return a {@link GeographicalRegion} proxy on the created {@link Enumeration}.
*/
@objid ("35865ac2-47bd-40b3-8f8a-16ba3b74f46d")
Expand All @@ -68,7 +64,7 @@ public static GeographicalRegion create() {
* Tries to instantiate a {@link GeographicalRegion} proxy from a {@link Enumeration} stereotyped << GeographicalRegion >> checking its metaclass and its stereotype.
* <p>
* The method returns <i>null</i> if the instantiation cannot be carried out.
*
*
* @param obj a Enumeration
* @return a {@link GeographicalRegion} proxy or <i>null</i>.
*/
Expand All @@ -81,7 +77,7 @@ public static GeographicalRegion instantiate(final Enumeration obj) {
* Tries to instantiate a {@link GeographicalRegion} proxy from a {@link Enumeration} stereotyped << GeographicalRegion >> checking its metaclass and its stereotype.
* <p>
* The method throws an {@link IllegalArgumentException} if the instantiation cannot be carried out.
*
*
* @param obj a {@link Enumeration}
* @return a {@link GeographicalRegion} proxy.
* @throws java.lang.IllegalArgumentException if the instantiation cannot be carried out.
Expand Down Expand Up @@ -127,7 +123,7 @@ public boolean equals(final Object obj) {

/**
* Get the underlying {@link Enumeration}.
*
*
* @return the Enumeration represented by this proxy, never null.
*/
@objid ("a423e5ed-fdb7-41d0-906c-c0782f9a3052")
Expand Down
174 changes: 174 additions & 0 deletions src/main/java/fr/softeam/cameldesigner/audit/CheckerPlan.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,85 @@
import com.modeliosoft.modelio.javadesigner.annotations.objid;
import fr.softeam.cameldesigner.api.camelcore.infrastructure.modelelement.CamelElement;
import fr.softeam.cameldesigner.audit.rule.IRule;
import fr.softeam.cameldesigner.audit.rule.constraint.Rule1301;
import fr.softeam.cameldesigner.audit.rule.constraint.Rule1302;
import fr.softeam.cameldesigner.audit.rule.constraint.Rule1303;
import fr.softeam.cameldesigner.audit.rule.constraint.Rule1304;
import fr.softeam.cameldesigner.audit.rule.constraint.Rule1305;
import fr.softeam.cameldesigner.audit.rule.constraint.Rule1306;
import fr.softeam.cameldesigner.audit.rule.constraint.Rule1307;
import fr.softeam.cameldesigner.audit.rule.constraint.Rule1308;
import fr.softeam.cameldesigner.audit.rule.constraint.Rule1309;
import fr.softeam.cameldesigner.audit.rule.core.Rule0101;
import fr.softeam.cameldesigner.audit.rule.core.Rule0102;
import fr.softeam.cameldesigner.audit.rule.data.Rule1401;
import fr.softeam.cameldesigner.audit.rule.data.Rule1402;
import fr.softeam.cameldesigner.audit.rule.data.Rule1403;
import fr.softeam.cameldesigner.audit.rule.deployment.Rule0301;
import fr.softeam.cameldesigner.audit.rule.deployment.Rule0302;
import fr.softeam.cameldesigner.audit.rule.deployment.Rule0303;
import fr.softeam.cameldesigner.audit.rule.deployment.Rule0304;
import fr.softeam.cameldesigner.audit.rule.deployment.Rule0305;
import fr.softeam.cameldesigner.audit.rule.deployment.Rule0306;
import fr.softeam.cameldesigner.audit.rule.deployment.Rule0307;
import fr.softeam.cameldesigner.audit.rule.deployment.Rule0308;
import fr.softeam.cameldesigner.audit.rule.deployment.Rule0309;
import fr.softeam.cameldesigner.audit.rule.deployment.Rule0310;
import fr.softeam.cameldesigner.audit.rule.deployment.Rule0311;
import fr.softeam.cameldesigner.audit.rule.deployment.Rule0312;
import fr.softeam.cameldesigner.audit.rule.deployment.Rule0313;
import fr.softeam.cameldesigner.audit.rule.deployment.Rule0314;
import fr.softeam.cameldesigner.audit.rule.deployment.Rule0315;
import fr.softeam.cameldesigner.audit.rule.location.Rule0501;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0601;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0602;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0603;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0604;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0605;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0606;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0607;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0608;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0609;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0610;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0611;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0612;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0613;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0614;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0615;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0616;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0617;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0618;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0619;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0620;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0621;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0622;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0623;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0624;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0625;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0626;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0627;
import fr.softeam.cameldesigner.audit.rule.metric.Rule0628;
import fr.softeam.cameldesigner.audit.rule.mms.Rule0201;
import fr.softeam.cameldesigner.audit.rule.mms.Rule0202;
import fr.softeam.cameldesigner.audit.rule.mms.Rule0203;
import fr.softeam.cameldesigner.audit.rule.mms.Rule0204;
import fr.softeam.cameldesigner.audit.rule.mms.Rule0205;
import fr.softeam.cameldesigner.audit.rule.mms.Rule0206;
import fr.softeam.cameldesigner.audit.rule.mms.Rule0207;
import fr.softeam.cameldesigner.audit.rule.requirement.Rule0801;
import fr.softeam.cameldesigner.audit.rule.requirement.Rule0802;
import fr.softeam.cameldesigner.audit.rule.requirement.Rule0803;
import fr.softeam.cameldesigner.audit.rule.requirement.Rule0804;
import fr.softeam.cameldesigner.audit.rule.requirement.Rule0805;
import fr.softeam.cameldesigner.audit.rule.requirement.Rule0806;
import fr.softeam.cameldesigner.audit.rule.requirement.Rule0807;
import fr.softeam.cameldesigner.audit.rule.requirement.Rule0808;
import fr.softeam.cameldesigner.audit.rule.requirement.Rule0809;
import fr.softeam.cameldesigner.audit.rule.requirement.Rule0810;
import fr.softeam.cameldesigner.audit.rule.requirement.Rule0811;
import fr.softeam.cameldesigner.audit.rule.requirement.Rule0812;
import fr.softeam.cameldesigner.audit.rule.requirement.Rule0813;
import fr.softeam.cameldesigner.audit.rule.unit.Rule1201;
import fr.softeam.cameldesigner.impl.CamelDesignerModule;
import org.modelio.metamodel.uml.infrastructure.Stereotype;

Expand All @@ -20,9 +96,107 @@ public class CheckerPlan {

@objid ("b24979d2-4590-48da-b62e-1ea155d79f31")
public CheckerPlan() {
//Core
new Rule0101<>().registerRule(this);
new Rule0102<>().registerRule(this);

//mms
new Rule0201<>().registerRule(this);
new Rule0202<>().registerRule(this);
new Rule0203<>().registerRule(this);
new Rule0204<>().registerRule(this);
new Rule0205<>().registerRule(this);
new Rule0206<>().registerRule(this);
new Rule0207<>().registerRule(this);



//Deployment
new Rule0301<>().registerRule(this);
new Rule0302<>().registerRule(this);
new Rule0303<>().registerRule(this);
new Rule0304<>().registerRule(this);
new Rule0305<>().registerRule(this);
new Rule0306<>().registerRule(this);
new Rule0307<>().registerRule(this);
new Rule0308<>().registerRule(this);
new Rule0309<>().registerRule(this);
new Rule0310<>().registerRule(this);
new Rule0311<>().registerRule(this);
new Rule0312<>().registerRule(this);
new Rule0313<>().registerRule(this);
new Rule0314<>().registerRule(this);
new Rule0315<>().registerRule(this);


//Location
new Rule0501<>().registerRule(this);


//Metric
new Rule0601<>().registerRule(this);
new Rule0602<>().registerRule(this);
new Rule0603<>().registerRule(this);
new Rule0604<>().registerRule(this);
new Rule0605<>().registerRule(this);
new Rule0606<>().registerRule(this);
new Rule0607<>().registerRule(this);
new Rule0608<>().registerRule(this);
new Rule0609<>().registerRule(this);
new Rule0610<>().registerRule(this);
new Rule0611<>().registerRule(this);
new Rule0612<>().registerRule(this);
new Rule0613<>().registerRule(this);
new Rule0614<>().registerRule(this);
new Rule0615<>().registerRule(this);
new Rule0616<>().registerRule(this);
new Rule0617<>().registerRule(this);
new Rule0618<>().registerRule(this);
new Rule0619<>().registerRule(this);
new Rule0620<>().registerRule(this);
new Rule0621<>().registerRule(this);
new Rule0622<>().registerRule(this);
new Rule0623<>().registerRule(this);
new Rule0624<>().registerRule(this);
new Rule0625<>().registerRule(this);
new Rule0626<>().registerRule(this);
new Rule0627<>().registerRule(this);
new Rule0628<>().registerRule(this);

//Requirement
new Rule0801<>().registerRule(this);
new Rule0802<>().registerRule(this);
new Rule0803<>().registerRule(this);
new Rule0804<>().registerRule(this);
new Rule0805<>().registerRule(this);
new Rule0806<>().registerRule(this);
new Rule0807<>().registerRule(this);
new Rule0808<>().registerRule(this);
new Rule0809<>().registerRule(this);
new Rule0810<>().registerRule(this);
new Rule0811<>().registerRule(this);
new Rule0812<>().registerRule(this);
new Rule0813<>().registerRule(this);

//Unit
new Rule1201<>().registerRule(this);

//Constraint
new Rule1301<>().registerRule(this);
new Rule1302<>().registerRule(this);
new Rule1303<>().registerRule(this);
new Rule1304<>().registerRule(this);
new Rule1305<>().registerRule(this);
new Rule1306<>().registerRule(this);
new Rule1307<>().registerRule(this);
new Rule1308<>().registerRule(this);
new Rule1309<>().registerRule(this);


//Data
new Rule1401<>().registerRule(this);
new Rule1402<>().registerRule(this);
new Rule1403<>().registerRule(this);
}

@objid ("1436be35-7866-4bd2-9f0c-1923493700b7")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
package fr.softeam.cameldesigner.audit.rule.constraint;

import camel.constraint.ComparisonOperatorType;
import com.modeliosoft.modelio.javadesigner.annotations.objid;
import fr.softeam.cameldesigner.api.deploymentinstancemodel.standard.package_.DeploymentInstanceModel;
import fr.softeam.cameldesigner.api.constraintmodel.standard.constraint.UnaryConstraint;
import fr.softeam.cameldesigner.audit.CheckerPlan;
import fr.softeam.cameldesigner.audit.rule.AbstractRule;

@objid ("295c6494-24a8-4479-99a9-17b63e2dbaef")
public class Rule1301<T extends DeploymentInstanceModel> extends AbstractRule<T> {
public class Rule1301<T extends UnaryConstraint> extends AbstractRule<T> {
@objid ("eb51ef03-33af-4216-8c54-ea5a53cee54b")
private static final String RULEID = "R0301";
private static final String RULEID = "R1301";

@objid ("60916abb-ccee-4255-bb10-c481d17f061c")
@Override
public boolean isViolated(T context) {
return (context.getType() == null);
String operator = context.getComparisonOperator();
if ((operator == null) ||(operator.equals(""))){
return true;
}else {
try {
ComparisonOperatorType.valueOf(operator);
}catch(@SuppressWarnings ("unused") Exception e) {
return true;
}
}
return false;
}

@objid ("ce02a125-33f7-485f-ab2e-1f51ec219fa8")
@Override
public String getDescription(T elt) {
return "Type of " + elt.getName() + " has not been defined.";
return "Comparison Operator of " + elt.getName() + " is not valid.";
}

@objid ("cd75f47d-0ade-48ed-8713-270b5cef46e3")
Expand Down
Loading

0 comments on commit 5dc68b4

Please sign in to comment.