Fixing infinte loop of flow
[so.git] / bpmn / so-bpmn-tasks / src / main / java / org / onap / so / bpmn / infrastructure / adapter / vnfm / tasks / MonitorVnfmCreateJobTask.java
index 4645680..4c84bca 100644 (file)
@@ -55,11 +55,18 @@ public class MonitorVnfmCreateJobTask extends MonitorVnfmJobTask {
      * @param execution {@link org.onap.so.bpmn.common.DelegateExecutionImpl}
      */
     public void getCurrentOperationStatus(final BuildingBlockExecution execution) {
-        LOGGER.debug("Executing getCurrentOperationStatus  ...");
-        final CreateVnfResponse vnfInstantiateResponse = execution.getVariable(CREATE_VNF_RESPONSE_PARAM_NAME);
-        execution.setVariable(OPERATION_STATUS_PARAM_NAME,
-                getOperationStatus(execution, vnfInstantiateResponse.getJobId()));
-        LOGGER.debug("Finished executing getCurrentOperationStatus ...");
+        try {
+            LOGGER.debug("Executing getCurrentOperationStatus  ...");
+            final CreateVnfResponse vnfInstantiateResponse = execution.getVariable(CREATE_VNF_RESPONSE_PARAM_NAME);
+            execution.setVariable(OPERATION_STATUS_PARAM_NAME,
+                    getOperationStatus(execution, vnfInstantiateResponse.getJobId()));
+            LOGGER.debug("Finished executing getCurrentOperationStatus ...");
+        } catch (final Exception exception) {
+            final String message = "Unable to invoke get current Operation status";
+            LOGGER.error(message);
+            exceptionUtil.buildAndThrowWorkflowException(execution, 1209, message);
+
+        }
     }
 
     /**