Enhancement #5534

Support for NodeManager-based propeties and children for property nodes

Added by Reino Ruusu over 2 years ago. Updated about 2 years ago.

Status:ClosedStart date:2014-12-05
Priority:4Due date:2015-01-16
Assignee:Reino Ruusu% Done:

100%

Category:-Spent time:-
Target version:1.18.1
Release notes:Support for variables from by solver-provided node managers has been extended by allowing property nodes to contain sub-properties and child nodes.
Tags: variable
Story points-
Velocity based estimate-
ReleaseSimantics 1.18.1Release relationshipAuto

Description

Implementation of support in the Variable interface for access to sub-properties and children for property nodes provided by a NodeManager.
Additional Variable-related refactoring
  • Unification of the 'node' field in AbstractChildVariable and AbstractPropertyVariable into AbstractVariable
  • Generalization of some argument types to base classes in db.layer0.function/All
  • Introduction of private methods for small pieces of repeated code in db.layer0.function/All.

Associated revisions

Revision 30653
Added by tuorjr over 2 years ago

Support for NodeManager-based propeties and children for property nodes (refs #5534)

Revision 30654
Added by Tuukka Lehtonen over 2 years ago

Fixed os.db.layer0.function.All.getPossiblePropertyURI after r30653.

refs #5534

Revision 30897
Added by Tuukka Lehtonen over 2 years ago

Fixed wrong argument from org.simantis.db.layer0.function.All.getStandardChildDomainPropertyVariables introduced by r30653.
Changed null -> variable.resource.

The null argument caused the StandardGraphPropertyVariable implementation to not find domain properties and thus no subliteral variables (/i-0, ...) for array property variables.

At the same time, fixed one getValue vs. getPossibleValue problem from AbstractVariable.getPossiblePropertyValue and added PropertyInfo.toString.

refs #5534

Revision 30898
Added by Tuukka Lehtonen over 2 years ago

Merged trunk@30897 to branches/simantics-1.18 on 2015-02-10 for 1.18.1 release.

refs #5534

History

#1 Updated by Tuukka Lehtonen over 2 years ago

  • Project changed from Simantics to Platform
  • Due date set to 2015-01-16
  • Target version set to 1.18.1
  • Release set to 17

#2 Updated by Tuukka Lehtonen over 2 years ago

  • Status changed from New to In Progress

#3 Updated by Tuukka Lehtonen over 2 years ago

Reino, is this work done? If so, please close the issue with release notes if necessary.

#4 Updated by Reino Ruusu over 2 years ago

  • Status changed from In Progress to Closed
  • Release notes set to Support for variables from by solver-provided node managers has been extended by allowing property nodes to contain sub-properties and child nodes.

#5 Updated by Tuukka Lehtonen over 2 years ago

Tutkin eilen ongelmaa Variable-toteutuksissa ja havaitsin sen palautuvan tähän muutokseen:

https://www.simantics.org/redmine/projects/simantics-platform/repository/revisions/30653/diff/db/trunk/org.simantics.db.layer0/src/org/simantics/db/layer0/function/All.java

nykyisen tiedoston riviltä 375 alkaen

                 if (classification != null && !graphProperty.hasClassification(classification)) continue;
-                Variable var = graphProperty.builder.buildProperty(graph, variable, build(variable.node,nodeProperty), variable.resource, graphProperty.predicate); 
-                map.put(name, var);
+                
+                // Combine with identically named graph property
+                map.put(name, buildPropertyVariable(graph, variable, null, graphProperty, nodeProperty));
                 continue;

Tuossa ylemmän koodin variable.resource on vaihtunut vastaavassa paikassa null:ksi alempana. Sen vuoksi experiment-puolen #PROPERTY variableille ei tule ollenkaan parentResourcea tai resourcea. Tästä taas seuraa se, ettei tuo variable-toteutus pysty resolvaamaan näitä /i-N child-variableja enää.

Ongelma oli siis se, että experiment-puolen variableille ei toiminut ollenkaan array-tyyppisten propertyjen indeksointi (/i-N), koska tuossa buildPropertyVariable:ssa annetaan parentResourcena null sen sijaan että siinä annettaisiin variable.resource, kuten vanhassa koodissa annettiin. En tiedä oliko tämä tarkoituksellinen muutos, mutta jos ei ollut, muuttaisin sen niin, että annetaan variable.resource nullin sijaan. Tuleeko haittaa?

#6 Updated by Reino Ruusu over 2 years ago

Muutos ei ollut tarkoituksellinen, vaan selkeä virhe.

#7 Updated by Tuukka Lehtonen over 2 years ago

Kiitos, laitan tuon sisään muiden mukana.

#8 Updated by Tuukka Lehtonen about 2 years ago

  • % Done changed from 0 to 100

Also available in: Atom PDF