Currently typical synchronization has a validation step that aborts the
whole diagram synchronization if there is even a single connection
missing from the instance diagram that cannot be copied from the typical
template because another instance-specific connection has been made to
the same functional terminal where the template connection is supposed
to be connected.
This changes the synchronization to simply report these cases as
WARNINGS in the verbose synchronization log and continue the
synchronization.
gitlab #323
Change-Id: I7661f6f069666fb0e6f724e6d0006e6632f93567
if(stm != null) {
if(graph.isInstanceOf(connectionPoint, L0.FunctionalRelation)) {
if(!isSynchronizedConnector(graph, templateElement, stm.getObject())) {
if(stm != null) {
if(graph.isInstanceOf(connectionPoint, L0.FunctionalRelation)) {
if(!isSynchronizedConnector(graph, templateElement, stm.getObject())) {
- messageLog.add("\t\tABORTED: tried to connect to an already connected terminal " + NameUtils.getSafeName(graph, counterPartElement) + " " + NameUtils.getSafeName(graph, connectionPoint));
- return;
+ messageLog.add("\t\tWARNING: skipping addition of template connection " + NameUtils.getSafeName(graph, templateElement, true) + " into instance.");
+ messageLog.add("\t\t\ttried to connect to an already connected terminal " + NameUtils.getSafeName(graph, counterPartElement, true) + " " + NameUtils.getSafeName(graph, connectionPoint));
+ templateElementsAddedToTemplate.remove(templateElement);
Resource instanceElement = typicalInfo.bean.templateToInstance.get(changedTemplateElement);
if (instanceElement == null) {
// There's an earlier problem in the sync process if this happens.
Resource instanceElement = typicalInfo.bean.templateToInstance.get(changedTemplateElement);
if (instanceElement == null) {
// There's an earlier problem in the sync process if this happens.
- typicalInfo.messageLog.add("SKIPPING SYNC OF CHANGED TEMPLATE ELEMENT DUE TO MISSING INSTANCE: " + safeNameAndType(graph, getElementNameResource(graph, changedTemplateElement)));
+ typicalInfo.messageLog.add("\t\tSKIPPING SYNC OF CHANGED TEMPLATE ELEMENT DUE TO MISSING INSTANCE: " + safeNameAndType(graph, getElementNameResource(graph, changedTemplateElement)));
package org.simantics.modeling.typicals;
package org.simantics.modeling.typicals;
-import java.util.Collection;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IProgressMonitor;
public TypicalInfoBean bean;
public IProgressMonitor monitor;
public TypicalInfoBean bean;
public IProgressMonitor monitor;
- public Collection<String> messageLog;
+ public List<String> messageLog;