/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * ============LICENSE_START======================================================= Copyright (C) 2019 Nordix
+ * Foundation. ================================================================================ Licensed under the
+ * Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may
+ * obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific language governing permissions and limitations under the
+ * License.
*
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
+ * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END=========================================================
*/
package org.onap.so.bpmn.infrastructure.pnf.delegate;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PRC_INSTANCE_NAME;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SERVICE_MODEL_INFO;
import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SKIP_POST_INSTANTIATION_CONFIGURATION;
-
import java.util.List;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
private Logger logger = LoggerFactory.getLogger(ConfigCheckerDelegate.class);
- //ERROR CODE for variable not found in the delegation Context
+ // ERROR CODE for variable not found in the delegation Context
private static int ERROR_CODE = 601;
@Autowired
public void execute(DelegateExecution delegateExecution) throws Exception {
logger.debug("Running execute block for activity id:{}, name:{}", delegateExecution.getCurrentActivityId(),
- delegateExecution.getCurrentActivityName());
+ delegateExecution.getCurrentActivityName());
if (delegateExecution.hasVariable(SERVICE_MODEL_INFO)) {
String serviceModelInfo = (String) delegateExecution.getVariable(SERVICE_MODEL_INFO);
String serviceModelUuid = JsonUtils.getJsonValue(serviceModelInfo, MODEL_UUID);
delegateExecution.setVariable(MODEL_UUID, serviceModelUuid);
- List<PnfResourceCustomization> pnfCustomizations = catalogDbClient
- .getPnfResourceCustomizationByModelUuid(serviceModelUuid);
+ List<PnfResourceCustomization> pnfCustomizations =
+ catalogDbClient.getPnfResourceCustomizationByModelUuid(serviceModelUuid);
if (pnfCustomizations != null && pnfCustomizations.size() >= 1) {
PnfResourceCustomization pnfResourceCustomization = pnfCustomizations.get(0);
boolean skipPostInstantiationConfiguration = pnfResourceCustomization.isSkipPostInstConf();
- delegateExecution
- .setVariable(SKIP_POST_INSTANTIATION_CONFIGURATION, skipPostInstantiationConfiguration);
+ delegateExecution.setVariable(SKIP_POST_INSTANTIATION_CONFIGURATION,
+ skipPostInstantiationConfiguration);
delegateExecution.setVariable(PRC_BLUEPRINT_NAME, pnfResourceCustomization.getBlueprintName());
delegateExecution.setVariable(PRC_BLUEPRINT_VERSION, pnfResourceCustomization.getBlueprintVersion());
- delegateExecution
- .setVariable(PRC_CUSTOMIZATION_UUID, pnfResourceCustomization.getModelCustomizationUUID());
+ delegateExecution.setVariable(PRC_CUSTOMIZATION_UUID,
+ pnfResourceCustomization.getModelCustomizationUUID());
delegateExecution.setVariable(PRC_INSTANCE_NAME, pnfResourceCustomization.getModelInstanceName());
} else {
- logger
- .warn("Unable to find the PNF resource customizations of model service UUID: {}", serviceModelUuid);
+ logger.warn("Unable to find the PNF resource customizations of model service UUID: {}",
+ serviceModelUuid);
exceptionUtil.buildAndThrowWorkflowException(delegateExecution, ERROR_CODE,
- "Unable to find the PNF resource customizations of model service UUID: " + serviceModelUuid);
+ "Unable to find the PNF resource customizations of model service UUID: " + serviceModelUuid);
}
} else {
logger.warn("Unable to find the parameter: {} in the execution context", SERVICE_MODEL_INFO);
- exceptionUtil
- .buildAndThrowWorkflowException(delegateExecution, ERROR_CODE,
+ exceptionUtil.buildAndThrowWorkflowException(delegateExecution, ERROR_CODE,
"Unable to find parameter " + SERVICE_MODEL_INFO);
}
}