use of org.cristalise.kernel.graph.model.BuiltInVertexProperties in project kernel by cristal-ise.
the class CompositeActivityDef method propagateCollectionProperties.
/**
* Reading collections during configureInstance() the properties of CAInstance can be updated to
* contain CastorHashMaps, which contain properties to be propagated to the Vertices of CAInstance.
*
* @param caInstance the CompAct instance beeing instantiated
* @throws InvalidDataException
*/
private void propagateCollectionProperties(CompositeActivity caInstance) throws InvalidDataException {
// Propagate now properties to Vertices
CastorHashMap caProps = caInstance.getProperties();
List<String> keysToDelete = new ArrayList<String>();
for (Entry<String, Object> aCAProp : caProps.entrySet()) {
if (aCAProp.getValue() instanceof CastorHashMap) {
for (Vertex vertex : caInstance.getChildrenGraphModel().getVertices()) {
CastorHashMap propsToPropagate = (CastorHashMap) aCAProp.getValue();
propsToPropagate.dump(8);
BuiltInVertexProperties builtInProp = BuiltInVertexProperties.getValue(aCAProp.getKey());
if (builtInProp == null) {
((GraphableVertex) vertex).updatePropertiesFromCollection(Integer.parseInt(aCAProp.getKey()), propsToPropagate);
} else {
((GraphableVertex) vertex).updatePropertiesFromCollection(builtInProp, propsToPropagate);
}
}
keysToDelete.add(aCAProp.getKey());
}
}
for (String key : keysToDelete) caProps.remove(key);
}
Aggregations