use of fr.gouv.mindef.safran.database.transfo.Transformation in project InformationSystem by ObeoNetwork.
the class ScaffoldingOperation method execute.
@Override
protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException {
if (scaffoldInfo.eResource() == null) {
// We have to create a scaffold model
Resource scaffoldResource = createScaffoldResource();
EObject newInfo = scaffoldResource.getContents().get(0);
if (newInfo instanceof ScaffoldInfo) {
scaffoldInfo = (ScaffoldInfo) newInfo;
}
}
final Transformation transformation = createTransformation();
try {
RecordingCommand transformCommand = new RecordingCommand(session.getTransactionalEditingDomain(), "Scaffolding transformation") {
@Override
protected void doExecute() {
success = transformation.transform(scaffoldInfo, scaffoldType);
}
};
session.getTransactionalEditingDomain().getCommandStack().execute(transformCommand);
} catch (RuntimeException e) {
logError("An error occured during the transformation", e);
return;
}
}
Aggregations