Search in sources :

Example 1 with Family2PersonTransformation

use of bitrafo.eval.familyperson.rules.Family2PersonTransformation in project benchmarx by eMoflon.

the class UbtXtendFamiliesToPersons method initiateSynchronisationDialogue.

/**
	 * Initiates a synchronization between a source and a target model. The BXtend Transformation is
	 * initialized and empty source, target and correspondence models are created.
	 * Finally a FamilyRegister is added to the source model and an initial forward transformation is issued
	 * to create a corresponding PersonRegister.
	 */
@Override
public void initiateSynchronisationDialogue() {
    // Fix default preferences (which can be overwritten)
    setConfigurator(new Configurator<Decisions>().makeDecision(Decisions.PREFER_CREATING_PARENT_TO_CHILD, true).makeDecision(Decisions.PREFER_EXISTING_FAMILY_TO_NEW, true));
    set.getResourceFactoryRegistry().getExtensionToFactoryMap().put("family", new XMIResourceFactoryImpl());
    set.getResourceFactoryRegistry().getExtensionToFactoryMap().put("person", new XMIResourceFactoryImpl());
    set.getResourceFactoryRegistry().getExtensionToFactoryMap().put("corr", new XMIResourceFactoryImpl());
    source = set.createResource(URI.createURI("sourceModel.family"));
    target = set.createResource(URI.createURI("targetModel.person"));
    corr = set.createResource(URI.createURI("corrModel.corr"));
    FamilyRegister familiesRoot = FamiliesFactory.eINSTANCE.createFamilyRegister();
    source.getContents().add(familiesRoot);
    f2pt = new Family2PersonTransformation(source, target, corr);
    // Fix default preferences (which can be overwritten)
    setConfigurator(new Configurator<Decisions>().makeDecision(Decisions.PREFER_CREATING_PARENT_TO_CHILD, true).makeDecision(Decisions.PREFER_EXISTING_FAMILY_TO_NEW, true));
    // perform batch to establish consistent starting state
    f2pt.Family2Person();
}
Also used : Family2PersonTransformation(bitrafo.eval.familyperson.rules.Family2PersonTransformation) FamilyRegister(Families.FamilyRegister) Decisions(org.benchmarx.examples.familiestopersons.testsuite.Decisions) XMIResourceFactoryImpl(org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl)

Aggregations

FamilyRegister (Families.FamilyRegister)1 Family2PersonTransformation (bitrafo.eval.familyperson.rules.Family2PersonTransformation)1 Decisions (org.benchmarx.examples.familiestopersons.testsuite.Decisions)1 XMIResourceFactoryImpl (org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl)1