X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.structural2%2Fsrc%2Forg%2Fsimantics%2Fstructural2%2Fvariables%2FStandardProceduralChildVariable.java;h=e7ba5ab7879c8749ffc527597e47c205629539f6;hp=e96fd050a021ee1c9451efe19c1ee88d112d5855;hb=c433e87787fb162d3f5d966678aaedf491266080;hpb=09d124e089c1b352cf1d9f723fd0f465fb12a31f diff --git a/bundles/org.simantics.structural2/src/org/simantics/structural2/variables/StandardProceduralChildVariable.java b/bundles/org.simantics.structural2/src/org/simantics/structural2/variables/StandardProceduralChildVariable.java index e96fd050a..e7ba5ab78 100644 --- a/bundles/org.simantics.structural2/src/org/simantics/structural2/variables/StandardProceduralChildVariable.java +++ b/bundles/org.simantics.structural2/src/org/simantics/structural2/variables/StandardProceduralChildVariable.java @@ -7,6 +7,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import org.simantics.databoard.Bindings; @@ -115,6 +116,14 @@ public class StandardProceduralChildVariable extends AbstractChildVariable { } else if (p.value instanceof Expression) { Expression expression = (Expression)p.value; this.properties.put(pn, new StructuralProceduralExpressionPropertyVariable(graph, this, p.relation, expression.text) ); + } else if (this.properties.containsKey(pn)) { + // The property overrides the value of an asserted property variable + StandardAssertedGraphPropertyVariable assertedValue = (StandardAssertedGraphPropertyVariable) this.properties.get(pn); + if (Objects.equals(assertedValue.property.predicate, p.relation)) { + this.properties.put(pn, new StandardProdeduralPropertyVariable(graph, this, assertedValue, p.value)); + } else { + LOGGER.warn("Ignored attempt to override asserted property {}/{}#{} with a different relation", parent.getURI(graph), name, pn); + } } else { this.properties.put(pn, new StandardConstantGraphPropertyVariable(graph, this, p.relation, p.value) ); }