diff options
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-common/src/main')
2 files changed, 10 insertions, 0 deletions
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java index 1407cb9211..c5caea5f2f 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java @@ -33,4 +33,5 @@ public class ExecutionVariableNames { public final static String DMAAP_MESSAGE = "dmaapMessage"; public final static String TIMEOUT_FOR_NOTIFICATION = "timeoutForPnfEntryNotification"; public final static String PNF_UUID = "pnfUuid"; + public final static String SERVICE_INSTANCE_ID = "serviceInstanceId"; } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java index c1ddf2e04e..a975339e58 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java @@ -24,6 +24,7 @@ package org.onap.so.bpmn.infrastructure.pnf.delegate; import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID; import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.PNF_UUID; +import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.SERVICE_INSTANCE_ID; import static org.onap.so.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.TIMEOUT_FOR_NOTIFICATION; import com.google.common.base.Strings; @@ -53,6 +54,7 @@ public class PnfCheckInputs implements JavaDelegate { validateCorrelationId(execution); validatePnfUuid(execution); validateTimeout(execution); + validateServiceInstanceId(execution); } private void validateCorrelationId(DelegateExecution execution) { @@ -83,4 +85,11 @@ public class PnfCheckInputs implements JavaDelegate { execution.setVariable(TIMEOUT_FOR_NOTIFICATION, defaultTimeout); } } + + private void validateServiceInstanceId(DelegateExecution execution) { + String serviceInstanceId = (String) execution.getVariable(SERVICE_INSTANCE_ID); + if (Strings.isNullOrEmpty(serviceInstanceId)) { + new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999, "serviceInstanceId variable not defined"); + } + } } |