blob: b69bb44b9e20e2d4e91d6bb39cb0950902330703 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2013 E.D.Willink and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* E.D.Willink - initial API and implementation
*
* Run As->MWE2 Workflow to regenerate the pivot model.
*******************************************************************************/
module GenerateAlignedPivotModel
import org.eclipse.ocl.examples.build.utilities.*
import org.eclipse.ocl.examples.build.xtend.*
import org.eclipse.emf.mwe.utils.*
import org.eclipse.emf.mwe.utils.*
import org.eclipse.emf.ecore.resource.impl.*
import org.eclipse.uml2.uml.resource.XMI2UMLResource
var projectName = "org.eclipse.ocl.examples.build"
//var platformURI = ".."
/**
* Generate the Pivot Model, by performing the merge to create the flattened package
* with additional MDT/OCL content, alphabeticsing the classes, reloading the genmodel
* and finally generating the model code.
*/
Workflow {
bean = ResourceSetImpl : resourceSet {}
// bean = StandaloneSetup { resourceSet = resourceSet
// platformUri = ".."
// scanClassPath = true
// registerGeneratedEPackage = "org.eclipse.xtext.common.types.TypesPackage"
// }
bean = ProjectMapSetup { resourceSet = resourceSet }
bean = UMLStandaloneSetup { resourceSet = resourceSet }
bean = OCLStandaloneSetup { resourceSet = resourceSet
dynamicPackage = Mapping {
from = "http://www.eclipse.org/ocl/2012/UML2EcoreControl"
to = "platform:/resource/${projectName}/model/UML2EcoreControl.ecore#/"
}
dynamicPackage = Mapping {
from = "http://www.eclipse.org/ocl/2012/UML2EcoreMapping"
to = "platform:/resource/${projectName}/model/UML2EcoreMapping.ecore#/"
}
}
//
// Fixup xmi:ids and convert cmof to uml
//
component = IdAssigner { resourceSet = resourceSet skipOnErrors = true
mapping = Mapping {
from = "/${projectName}/model/PrimitiveTypes.uml"
to = "/${projectName}/model-gen/PrimitiveTypes.uml"
}
mapping = Mapping {
from = "/${projectName}/model/UML.uml"
to = "/${projectName}/model-gen/UML.uml"
}
mapping = Mapping {
from = "/${projectName}/model/OCL.cmof"
to = "/${projectName}/model-gen/OCL.uml"
}
mapping = Mapping {
from = "/${projectName}/model/MDTOCL.cmof"
to = "/${projectName}/model-gen/MDTOCL.uml"
}
}
component = QVToTransformationExecutor { resourceSet = resourceSet skipOnErrors = true
uri = "platform:/resource/${projectName}/src/org/eclipse/ocl/examples/build/qvto/UML2EcoreAnalyzer.qvto"
in = "platform:/resource/${projectName}/model/UML2PivotinEcore.xmi"
out = "platform:/resource/${projectName}/model-gen/UML2PivotAnalysis.xmi"
}
component = QVToTransformationExecutor { resourceSet = resourceSet skipOnErrors = true
uri = "platform:/resource/${projectName}/src/org/eclipse/ocl/examples/build/qvto/UML2EcoreSynthesizer.qvto"
in = "platform:/resource/${projectName}/model-gen/UML2PivotAnalysis.xmi"
out = "platform:/resource/${projectName}/model-gen/UML2Pivot.ecore"
}
}