@Override
public void handleRestartInstance(UUID automationCompositionId, AcElementDeploy element,
Map<String, Object> properties, DeployState deployState, LockState lockState) throws PfModelException {
if (DeployState.DEPLOYING.equals(deployState)) {
deploy(automationCompositionId, element, properties);
return;
}
if (DeployState.UNDEPLOYING.equals(deployState) || DeployState.DEPLOYED.equals(deployState)
|| DeployState.UPDATING.equals(deployState)) {
var automationCompositionDefinition = element.getToscaServiceTemplateFragment();
serviceTemplateMap.put(element.getId(), automationCompositionDefinition);
}
if (DeployState.UNDEPLOYING.equals(deployState)) {
undeploy(automationCompositionId, element.getId());
return;
}
deployState = AcmUtils.deployCompleted(deployState);
lockState = AcmUtils.lockCompleted(deployState, lockState);
intermediaryApi.updateAutomationCompositionElementState(automationCompositionId, element.getId(), deployState,
lockState, StateChangeResult.NO_ERROR, "Restarted");
} |