use of org.alien4cloud.tosca.editor.operations.nodetemplate.UpdateNodePropertyValueOperation in project alien4cloud by alien4cloud.
the class TopologyModifierSupport method setNodePropertyPathValue.
private void setNodePropertyPathValue(Csar csar, Topology topology, NodeTemplate nodeTemplate, String propertyPath, AbstractPropertyValue propertyValue, boolean lastPropertyIsAList) {
Map<String, AbstractPropertyValue> propertyValues = nodeTemplate.getProperties();
String nodePropertyName = feedPropertyValue(propertyValues, propertyPath, propertyValue, lastPropertyIsAList);
Object nodePropertyValue = propertyValues.get(nodePropertyName);
UpdateNodePropertyValueOperation updateNodePropertyValueOperation = new UpdateNodePropertyValueOperation();
updateNodePropertyValueOperation.setNodeName(nodeTemplate.getName());
updateNodePropertyValueOperation.setPropertyName(nodePropertyName);
// TODO: can be necessary to serialize value before setting it in case of different types
updateNodePropertyValueOperation.setPropertyValue(nodePropertyValue);
updateNodePropertyValueProcessor.process(csar, topology, updateNodePropertyValueOperation);
}
Aggregations