| /******************************************************************************* |
| * Copyright (c) 2013 Willink Transformations and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v2.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v20.html |
| * |
| * Contributors: |
| * E.D.Willink - initial API and implementation |
| * |
| * Run As->MWE2 Workflow to regenerate the pivot model. |
| *******************************************************************************/ |
| module SaveUML |
| |
| 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 ecoreSlot = "ecore" |
| var umlSlot = "uml" |
| //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 |
| uriMap = Mapping { |
| from = "http://www.omg.org/spec/UML/20131001/PrimitiveTypes.xmi" |
| to = "platform:/resource/${projectName}/model/PrimitiveTypes.xmi" |
| } |
| // 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#/" |
| } |
| } |
| |
| |
| component = ResourceReader { resourceSet = resourceSet skipOnErrors = true |
| modelSlot = "${ecoreSlot}" |
| uri = "/${projectName}/model-gen/NewPivot.ecore" |
| } |
| /* component = ConstraintMerger { resourceSet = resourceSet skipOnErrors = true |
| projectName = "${projectName}" |
| modelSlot = "${ecoreSlot}" |
| uri = "model/Pivot.ocl" |
| } */ |
| component = Ecore2UMLConverter { skipOnErrors = true |
| ecoreSlot = "${ecoreSlot}" |
| umlSlot = "${umlSlot}" |
| } |
| component = PackageAlphabetizer { skipOnErrors = true |
| modelSlot = "${umlSlot}" |
| } |
| component = ResourceWriter { resourceSet = resourceSet skipOnErrors = true |
| modelSlot = "${umlSlot}" |
| uri = "/${projectName}/model-gen/NewPivot.uml" |
| } |
| // |
| // Make manually copied Pivot.uml stable for diagrams |
| // |
| component = IdAssigner { resourceSet = resourceSet skipOnErrors = true |
| assignFlatIds = false |
| mapping = Mapping { |
| from = "/${projectName}/model-gen/NewPivot.uml" |
| to = "/${projectName}/model-gen/NewPivot2.uml" |
| } |
| } |
| } |
| |