Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,28 @@ private static Resource loadModel(IExecutionContext<?, ?, ?> context, boolean wi
try {
// Killing + restarting Sirius session for animation
killPreviousSiriusSession(context.getRunConfiguration().getAnimatorURI());
openNewSiriusSession(context, context.getRunConfiguration().getAnimatorURI(), resourceSet, modelURI,
Session session = openNewSiriusSession(context, context.getRunConfiguration().getAnimatorURI(), resourceSet, modelURI,
subMonitor,nsURIMapping);

// At this point Sirius has loaded the model, we just need to
// find it
for (Resource r : resourceSet.getResources()) {
if (r.getURI().equals(modelURI)) {
return r;
if(session.getTransactionalEditingDomain().getResourceSet() != resourceSet) {
// the session has created a different resourceSet than the one we provided
//we need to use the resource from it instead of the one from our resourceSet
// TODO check if this is still compatible with melange
// TODO maybe some simplification is possible !
if(useMelange) {
Activator.getDefault().getLog().log(new Status(IStatus.WARNING, Activator.PLUGIN_ID, "Sirius Session returned a new ResourceSet and you are using a melange query, this scenario has not been validated yet", new Exception()));
}
for (Resource r : session.getTransactionalEditingDomain().getResourceSet().getResources()) {
if (r.getURI().equals(modelURI)) {
return r;
}
}
} else {
for (Resource r : resourceSet.getResources()) {
if (r.getURI().equals(modelURI)) {
return r;
}
}
}
} catch (CoreException e) {
Expand Down