blob: 488a9d37258dc6b367737ae954c55ecbd9d02ff2 [file] [log] [blame]
/**
* <copyright>
*
* Copyright (c) 2010 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
*
* </copyright>
*
* $Id: GeneratePivotModel.mwe2,v 1.3 2011/02/15 10:36:50 ewillink Exp $
*
* Run As->MWE2 Workflow to regenerate the pivot model.
*/
module GeneratePivotModel
import org.eclipse.ocl.examples.build.utilities.*
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 ecoreSlot = "ecore"
var umlSlot = "uml"
var projectName = "org.eclipse.ocl.examples.pivot"
/**
* 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 = ProjectMapSetup { resourceSet = resourceSet }
bean = UMLStandaloneSetup { resourceSet = resourceSet }
bean = OCLStandaloneSetup {}
bean = UMLGenModelSetup { resourceSet = resourceSet }
component = ResourceReader { resourceSet = resourceSet skipOnErrors = true
modelSlot = "${umlSlot}"
uri = "/${projectName}/model/Pivot.cmof"
}
component = PackageMerger { skipOnErrors = true
modelSlot = "${umlSlot}"
}
component = PackageAlphabetizer { skipOnErrors = true
modelSlot = "${umlSlot}"
}
component = ConstraintRemover { skipOnErrors = true
modelSlot = "${umlSlot}"
}
component = ResourceWriter { resourceSet = resourceSet skipOnErrors = true
modelSlot = "${umlSlot}"
uri = "/${projectName}/model/Pivot.merged.uml"
contentTypeIdentifier = "org.eclipse.uml2.uml_4_0_0" // UMLResource.UML_CONTENT_TYPE_IDENTIFIER
}
component = GenmodelReloader { resourceSet = resourceSet skipOnErrors = true
projectName = "${projectName}"
modelSlot = "${ecoreSlot}"
genModel = "/${projectName}/model/Pivot.merged.genmodel"
ecoreFile = "/${projectName}/model/Pivot.ecore"
// modelImporter = "org.eclipse.uml2.uml.ecore.importer.UMLImporter"
// modelImporter = "org.eclipse.ocl.examples.build.utilities.UMLImporterWithDelegates"
}
component = ResourceReader { resourceSet = resourceSet skipOnErrors = true
modelSlot = "${ecoreSlot}"
uri = "/${projectName}/model/Pivot.ecore"
}
component = ConstraintMerger { resourceSet = resourceSet skipOnErrors = true
projectName = "${projectName}"
modelSlot = "${ecoreSlot}"
uri = "model/Pivot.ocl"
}
component = EPackageAlphabetizer { skipOnErrors = true
modelSlot = "${ecoreSlot}"
}
component = PruneSuperClasses { skipOnErrors = true
modelSlot = "${ecoreSlot}"
}
// component = OCLDelegateActivator { skipOnErrors = true
// modelSlot = "${pivotSlot}"
// }
// component = VisitableAcceptGenerator { skipOnErrors = true
// modelSlot = "${pivotSlot}"
// }
component = ResourceWriter { resourceSet = resourceSet skipOnErrors = true
modelSlot = "${ecoreSlot}"
}
component = GenerateModel { resourceSet = resourceSet skipOnErrors = true
// projectName = "${projectName}"
genModel = "/${projectName}/model/Pivot.merged.genmodel"
// modelSlot = "${ecoreSlot}"
}
// component = @GeneratePivotVisitors {}
component = PivotVisitorCodeGenerator { resourceSet = resourceSet
projectName = "${projectName}"
ecoreFile = "model/Pivot.ecore"
javaFolder = "emf-gen"
javaPackageName = "${projectName}"
javaClassName = "Visitor"
}
// component = @GenerateOclMetaModel {}
component = OclMetaModelCodeGenerator { resourceSet = resourceSet
projectName = "${projectName}"
libraryFile = "model/Pivot.ecore"
javaFolder = "emf-gen"
javaPackageName = "${projectName}.model"
javaClassName = "OclMetaModel"
}
// component = @GeneratePivotTables {}
// component = Model2tablesGenerator { resourceSet = resourceSet
// genModelFile = "/${projectName}/model/Pivot.merged.genmodel"
// }
}