Skip to content

Commit

Permalink
Removed SystemModel purging on dependency changes
Browse files Browse the repository at this point in the history
The SystemModel is currently still used in to many places as identifier.
Therefore purging it on any dependency change can lead to inconsistent
states. This leads in the best case to not working monitoring or
deployment and in the worst case to data loss.
  • Loading branch information
azoitl committed Jun 24, 2024
1 parent f373967 commit 64b07ab
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.eclipse.fordiac.ide.model.dataimport.exceptions.TypeImportException;
import org.eclipse.fordiac.ide.model.helpers.PackageNameHelper;
import org.eclipse.fordiac.ide.model.libraryElement.LibraryElement;
import org.eclipse.fordiac.ide.model.libraryElement.LibraryElementPackage;
import org.eclipse.fordiac.ide.model.resource.FordiacTypeResource;
import org.eclipse.fordiac.ide.model.typelibrary.TypeEntry;
import org.eclipse.fordiac.ide.model.typelibrary.TypeLibrary;
Expand Down Expand Up @@ -311,12 +312,17 @@ public void notifyChanged(final Notification notification) {
&& dependencies.get().contains(notification.getNotifier())) {
synchronized (this) {

setType(null);
setTypeEditable(null);
if (!getTypeEClass().equals(LibraryElementPackage.Literals.AUTOMATION_SYSTEM)) {
// currently we only want to purge the models if it is not an automation system,
// as it is used as identification in system explorer and monitoring
// FIXME remove if when monitoring is fixed
setType(null);
setTypeEditable(null);
}

if (notification.getNewValue() != null && notification.getOldValue() != null) {
// if there is an editor opened then this notification will be delagted to the
// corresponding editor,
// if there is an editor opened then this notification will be delegated to the
// corresponding editor.
// If not, then nothing will happen
delagateNotifiactionToEditor(notification);
}
Expand Down

0 comments on commit 64b07ab

Please sign in to comment.