Search in sources :

Example 1 with UpdateNodePropertyValueOperation

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);
}
Also used : UpdateNodePropertyValueOperation(org.alien4cloud.tosca.editor.operations.nodetemplate.UpdateNodePropertyValueOperation) AbstractPropertyValue(org.alien4cloud.tosca.model.definitions.AbstractPropertyValue)

Aggregations

UpdateNodePropertyValueOperation (org.alien4cloud.tosca.editor.operations.nodetemplate.UpdateNodePropertyValueOperation)1 AbstractPropertyValue (org.alien4cloud.tosca.model.definitions.AbstractPropertyValue)1