Skip to content

Commit

Permalink
eclipse-capella#143 Regenerate EGF code
Browse files Browse the repository at this point in the history
EGF code regenerated using EGF 1.6.3
Update TP to 6.0.0
Migrated test models to 6.0.0

Change-Id: I0000000000000000000000000000000000000000
Signed-off-by: Arnaud Dieumegard <[email protected]>
  • Loading branch information
arnauddieumegard committed Dec 20, 2021
1 parent 1765825 commit e7fd1fa
Show file tree
Hide file tree
Showing 34 changed files with 490 additions and 633 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//Generated with EGF 1.6.0.201805040915
//Generated with EGF 1.6.3.202110291409
package org.polarsys.capella.extension.genchain.patterns;

import java.util.HashMap;
Expand Down Expand Up @@ -110,7 +110,8 @@ public boolean preCondition(PatternContext ctx) throws Exception {

protected org.polarsys.capella.extension.genchain.capellaextension.CapellaCdoEmfGeneration parameter;

public void set_parameter(org.polarsys.capella.extension.genchain.capellaextension.CapellaCdoEmfGeneration parameter) {
public void set_parameter(
org.polarsys.capella.extension.genchain.capellaextension.CapellaCdoEmfGeneration parameter) {
this.parameter = parameter;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//Generated with EGF 1.2.0.v20150211-1405
//Generated with EGF 1.6.3.202110291409
package org.polarsys.capella.extension.genchain.patterns;

import java.util.HashMap;
Expand Down Expand Up @@ -36,6 +36,7 @@ public CapellaGenerationPattern() {
this.editorActivity = "platform:/plugin/org.polarsys.capella.extension.tools/egf/capellaTools.fcore#_eBZesB_3EeCuNfuGnuOPDw";
this.testActivity = "platform:/plugin/org.polarsys.kitalpha.emde.portfolio.emf.egf/egf/emf.gen.tests.fcore#_79dGwDYdEeGWF-mrFIsVzA";
this.javadocActivity = "platform:/plugin/org.polarsys.kitalpha.emde.portfolio.emf.egf/egf/javadoc.fcore#_CycMIDYfEeGWF-mrFIsVzA";

}

public void generate(Object argument) throws Exception {
Expand All @@ -57,8 +58,7 @@ public void generate(Object argument) throws Exception {
}
}
if (ctx.useReporter()) {
ctx.getReporter().executionFinished(
OutputManager.computeExecutionOutput(ctx), ctx);
ctx.getReporter().executionFinished(OutputManager.computeExecutionOutput(ctx), ctx);
}
}

Expand All @@ -72,28 +72,23 @@ public String orchestration(PatternContext ctx) throws Exception {
parameterValues.put("parameter", this.parameter);
String outputWithCallBack = OutputManager.computeLoopOutput(ictx);
String loop = OutputManager.computeLoopOutputWithoutCallback(ictx);
ictx.getReporter().loopFinished(loop, outputWithCallBack, ictx,
parameterValues);
ictx.getReporter().loopFinished(loop, outputWithCallBack, ictx, parameterValues);
}
return null;
}

protected void method_body(final StringBuffer out, final PatternContext ctx)
throws Exception {
protected void method_body(final StringBuffer out, final PatternContext ctx) throws Exception {
Map<GenerationElement, FactoryComponent> fcs = (Map<GenerationElement, FactoryComponent>) ctx
.getValue(FcoreBuilderConstants.CURRENT_FCORE);

FactoryComponent fc = fcs.get((GenerationElement) (parameter
.eContainer()));
FactoryComponent fc = fcs.get((GenerationElement) (parameter.eContainer()));

ProductionPlan pp = (ProductionPlan) fc.getOrchestration();
DomainViewpoint dvp = (DomainViewpoint) fc.getViewpointContainer()
.getViewpoint(DomainViewpoint.class);
DomainViewpoint dvp = (DomainViewpoint) fc.getViewpointContainer().getViewpoint(DomainViewpoint.class);

EMFDomain genModelDomain = null;
URI uri = ((HashMap<String, URI>) ctx
.getValue(FcoreBuilderConstants.GENMODEL_URIS)).get(parameter
.getModelPath());
URI uri = ((HashMap<String, URI>) ctx.getValue(FcoreBuilderConstants.GENMODEL_URIS))
.get(parameter.getModelPath());
genModelDomain = ActivityInvocationHelper.getDomain(dvp, uri);
if (genModelDomain == null) {
genModelDomain = DomainFactory.eINSTANCE.createEMFDomain();
Expand All @@ -105,8 +100,7 @@ protected void method_body(final StringBuffer out, final PatternContext ctx)
Map<String, OrchestrationParameter> parameters = new HashMap<String, OrchestrationParameter>();

for (OrchestrationParameter param : pp.getOrchestrationParameters()) {
if (ActivityInvocationHelper.GENERATION_EXTENSION_PARAMETER_NAME
.equals(param.getName())) {
if (ActivityInvocationHelper.GENERATION_EXTENSION_PARAMETER_NAME.equals(param.getName())) {
parameters.put("pattern.substitutions", param);
}
}
Expand All @@ -116,53 +110,41 @@ protected void method_body(final StringBuffer out, final PatternContext ctx)
TypeDomain typeDomain = DomainFactory.eINSTANCE.createTypeDomain();
typeDomain.setDomain(genModelDomain);
contracts.put("genModelURI", typeDomain);
ActivityInvocationHelper.addInvocation(
pp,
(Activity) resourceSet.getEObject(
URI.createURI(this.modelActivity, false), true),
contracts, parameters);
ActivityInvocationHelper.addInvocation(pp,
(Activity) resourceSet.getEObject(URI.createURI(this.modelActivity, false), true), contracts,
parameters);
}
if (parameter.isGenerateEdit()) {
TypeDomain typeDomain = DomainFactory.eINSTANCE.createTypeDomain();
typeDomain.setDomain(genModelDomain);
contracts.put("genModelURI", typeDomain);
ActivityInvocationHelper.addInvocation(
pp,
(Activity) resourceSet.getEObject(
URI.createURI(this.editActivity, false), true),
contracts, parameters);
ActivityInvocationHelper.addInvocation(pp,
(Activity) resourceSet.getEObject(URI.createURI(this.editActivity, false), true), contracts,
parameters);
}
if (parameter.isGenerateEditor()) {
TypeDomain typeDomain = DomainFactory.eINSTANCE.createTypeDomain();
typeDomain.setDomain(genModelDomain);
contracts.put("genModelURI", typeDomain);
ActivityInvocationHelper.addInvocation(
pp,
(Activity) resourceSet.getEObject(
URI.createURI(this.editorActivity, false), true),
contracts, parameters);
ActivityInvocationHelper.addInvocation(pp,
(Activity) resourceSet.getEObject(URI.createURI(this.editorActivity, false), true), contracts,
parameters);
}
if (parameter.isGenerateTest()) {
TypeDomain typeEMFDomain = DomainFactory.eINSTANCE
.createTypeDomain();
TypeDomain typeEMFDomain = DomainFactory.eINSTANCE.createTypeDomain();
typeEMFDomain.setDomain(genModelDomain);
contracts.put("genModelURI", typeEMFDomain);
ActivityInvocationHelper.addInvocation(
pp,
(Activity) resourceSet.getEObject(
URI.createURI(this.testActivity, false), true),
contracts, parameters);
ActivityInvocationHelper.addInvocation(pp,
(Activity) resourceSet.getEObject(URI.createURI(this.testActivity, false), true), contracts,
parameters);
}
if (parameter.isGenerateJavadoc()) {
TypeDomain typeEMFDomain = DomainFactory.eINSTANCE
.createTypeDomain();
TypeDomain typeEMFDomain = DomainFactory.eINSTANCE.createTypeDomain();
typeEMFDomain.setDomain(genModelDomain);
contracts.put("genModelURI", typeEMFDomain);
ActivityInvocationHelper.addInvocation(
pp,
(Activity) resourceSet.getEObject(
URI.createURI(this.javadocActivity, false), true),
contracts, parameters);
ActivityInvocationHelper.addInvocation(pp,
(Activity) resourceSet.getEObject(URI.createURI(this.javadocActivity, false), true), contracts,
parameters);
}

InternalPatternContext ictx = (InternalPatternContext) ctx;
Expand All @@ -175,8 +157,7 @@ public boolean preCondition(PatternContext ctx) throws Exception {

protected org.polarsys.capella.extension.genchain.capellaextension.CapellaEmfGeneration parameter;

public void set_parameter(
org.polarsys.capella.extension.genchain.capellaextension.CapellaEmfGeneration parameter) {
public void set_parameter(org.polarsys.capella.extension.genchain.capellaextension.CapellaEmfGeneration parameter) {
this.parameter = parameter;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//Generated with EGF 1.6.0.201805040915
//Generated with EGF 1.6.3.202110291409
package org.polarsys.capella.extension.genchain.patterns;

import java.util.HashMap;
Expand Down Expand Up @@ -44,6 +44,7 @@ public class CapellaGenmodelPattern {
public CapellaGenmodelPattern() {
//Here is the constructor
// add initialisation of the pattern variables (declaration has been already done).

}

public void generate(Object argument) throws Exception {
Expand Down
Loading

0 comments on commit e7fd1fa

Please sign in to comment.