diff options
author | Boslet, Cory <cory.boslet@att.com> | 2020-03-25 16:04:41 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@att.com> | 2020-03-26 11:44:39 -0400 |
commit | cd4e5b408603a13dabc58f832e4aae4194e81995 (patch) | |
tree | a53701a308644c0469b5242f7f8370766bd5a453 /bpmn/MSOCommonBPMN/src/main | |
parent | f5420060c758308df18a0e316d6ae214ef9eb5c6 (diff) |
convert openstack to external tasks
Use external tasks to communicate with openstack adapter
Will be more resilient to failures
Refactored all flows to use external tasks not REST calls
Rollback is now an external task
Ensured backwards compatibility
Issue-ID: SO-2767
Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com>
Change-Id: I8afdb89c688d756aed0f25f7d9a7fb898142554d
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main')
3 files changed, 719 insertions, 349 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy index a6aacc7ea5..e8f842471c 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy @@ -40,419 +40,419 @@ import java.util.UUID import org.onap.so.utils.Components - +@Deprecated //Use vnfAdapterRestV2 class VnfAdapterRestV1 extends AbstractServiceTaskProcessor { private static final Logger logger = LoggerFactory.getLogger( VnfAdapterRestV1.class); - ExceptionUtil exceptionUtil = new ExceptionUtil() + ExceptionUtil exceptionUtil = new ExceptionUtil() - // VNF Response Processing - public void preProcessRequest (DelegateExecution execution) { - def method = getClass().getSimpleName() + '.preProcessRequest(' + - 'execution=' + execution.getId() + - ')' - logger.trace('Entered ' + method) + // VNF Response Processing + public void preProcessRequest (DelegateExecution execution) { + def method = getClass().getSimpleName() + '.preProcessRequest(' + + 'execution=' + execution.getId() + + ')' + logger.trace('Entered ' + method) - def prefix="VNFREST_" - execution.setVariable("prefix", prefix) - setSuccessIndicator(execution, false) + def prefix="VNFREST_" + execution.setVariable("prefix", prefix) + setSuccessIndicator(execution, false) - try { - String request = validateRequest(execution, "mso-request-id") + try { + String request = validateRequest(execution, "mso-request-id") - // Get the request type (the name of the root element) from the request + // Get the request type (the name of the root element) from the request - Node root = new XmlParser().parseText(request) - String requestType = root.name() - execution.setVariable(prefix + 'requestType', requestType) - logger.debug(getProcessKey(execution) + ': ' + prefix + 'requestType = ' + requestType) + Node root = new XmlParser().parseText(request) + String requestType = root.name() + execution.setVariable(prefix + 'requestType', requestType) + logger.debug(getProcessKey(execution) + ': ' + prefix + 'requestType = ' + requestType) - logger.debug('VnfAdapterRestV1, request: ' + request) - // Get the messageId from the request + logger.debug('VnfAdapterRestV1, request: ' + request) + // Get the messageId from the request - String messageId = getChildText(root, 'messageId') + String messageId = getChildText(root, 'messageId') - if ('rollbackVolumeGroupRequest'.equals(requestType)) { - messageId = getMessageIdForVolumeGroupRollback(root) - } + if ('rollbackVolumeGroupRequest'.equals(requestType)) { + messageId = getMessageIdForVolumeGroupRollback(root) + } - if (messageId == null || messageId.isEmpty()) { - String msg = getProcessKey(execution) + ': no messageId in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); + if (messageId == null || messageId.isEmpty()) { + String msg = getProcessKey(execution) + ': no messageId in ' + requestType + logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + ErrorCode.UnknownError.getValue()); exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } + } - execution.setVariable('VNFAResponse_CORRELATOR', messageId) - logger.debug(getProcessKey(execution) + ': VNFAResponse_CORRELATOR = ' + messageId) + execution.setVariable('VNFAResponse_CORRELATOR', messageId) + logger.debug(getProcessKey(execution) + ': VNFAResponse_CORRELATOR = ' + messageId) - // Get the notificationUrl from the request + // Get the notificationUrl from the request - String notificationUrl = getChildText(root, 'notificationUrl') + String notificationUrl = getChildText(root, 'notificationUrl') - if (notificationUrl == null || notificationUrl.isEmpty()) { - String msg = getProcessKey(execution) + ': no notificationUrl in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); + if (notificationUrl == null || notificationUrl.isEmpty()) { + String msg = getProcessKey(execution) + ': no notificationUrl in ' + requestType + logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + ErrorCode.UnknownError.getValue()); exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } + } - execution.setVariable(prefix + 'notificationUrl', notificationUrl) - logger.debug(getProcessKey(execution) + ': ' + prefix + 'notificationUrl = ' + notificationUrl) + execution.setVariable(prefix + 'notificationUrl', notificationUrl) + logger.debug(getProcessKey(execution) + ': ' + prefix + 'notificationUrl = ' + notificationUrl) - // Determine the VnfAdapter endpoint + // Determine the VnfAdapter endpoint - String vnfAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.vnf.rest.endpoint", execution) + String vnfAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.vnf.rest.endpoint", execution) - if (vnfAdapterEndpoint == null || vnfAdapterEndpoint.isEmpty()) { - String msg = getProcessKey(execution) + ': mso:adapters:vnf:rest:endpoint URN mapping is not defined' - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); + if (vnfAdapterEndpoint == null || vnfAdapterEndpoint.isEmpty()) { + String msg = getProcessKey(execution) + ': mso:adapters:vnf:rest:endpoint URN mapping is not defined' + logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + ErrorCode.UnknownError.getValue()); exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } + } - while (vnfAdapterEndpoint.endsWith('/')) { - vnfAdapterEndpoint = vnfAdapterEndpoint.substring(0, vnfAdapterEndpoint.length()-1) - } + while (vnfAdapterEndpoint.endsWith('/')) { + vnfAdapterEndpoint = vnfAdapterEndpoint.substring(0, vnfAdapterEndpoint.length()-1) + } - String vnfAdapterMethod = null - String vnfAdapterUrl = null - String vnfAdapterRequest = request + String vnfAdapterMethod = null + String vnfAdapterUrl = null + String vnfAdapterRequest = request - if ('createVfModuleRequest'.equals(requestType)) { - String vnfId = getChildText(root, 'vnfId') + if ('createVfModuleRequest'.equals(requestType)) { + String vnfId = getChildText(root, 'vnfId') - if (vnfId == null || vnfId.isEmpty()) { - String msg = getProcessKey(execution) + ': no vnfId in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); + if (vnfId == null || vnfId.isEmpty()) { + String msg = getProcessKey(execution) + ': no vnfId in ' + requestType + logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + ErrorCode.UnknownError.getValue()); exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } + } - vnfAdapterMethod = 'POST' - vnfAdapterUrl = vnfAdapterEndpoint + '/' + URLEncoder.encode(vnfId, 'UTF-8') + '/vf-modules' + vnfAdapterMethod = 'POST' + vnfAdapterUrl = vnfAdapterEndpoint + '/' + URLEncoder.encode(vnfId, 'UTF-8') + '/vf-modules' - } else if ('updateVfModuleRequest'.equals(requestType)) { - String vnfId = getChildText(root, 'vnfId') + } else if ('updateVfModuleRequest'.equals(requestType)) { + String vnfId = getChildText(root, 'vnfId') - if (vnfId == null || vnfId.isEmpty()) { - String msg = getProcessKey(execution) + ': no vnfId in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); + if (vnfId == null || vnfId.isEmpty()) { + String msg = getProcessKey(execution) + ': no vnfId in ' + requestType + logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + ErrorCode.UnknownError.getValue()); exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } + } - String vfModuleId = getChildText(root, 'vfModuleId') + String vfModuleId = getChildText(root, 'vfModuleId') - if (vfModuleId == null || vfModuleId.isEmpty()) { - String msg = getProcessKey(execution) + ': no vfModuleId in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); + if (vfModuleId == null || vfModuleId.isEmpty()) { + String msg = getProcessKey(execution) + ': no vfModuleId in ' + requestType + logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + ErrorCode.UnknownError.getValue()); exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } + } - vnfAdapterMethod = 'PUT' - vnfAdapterUrl = vnfAdapterEndpoint + '/' + URLEncoder.encode(vnfId, 'UTF-8') + - '/vf-modules/' + URLEncoder.encode(vfModuleId, 'UTF-8') + vnfAdapterMethod = 'PUT' + vnfAdapterUrl = vnfAdapterEndpoint + '/' + URLEncoder.encode(vnfId, 'UTF-8') + + '/vf-modules/' + URLEncoder.encode(vfModuleId, 'UTF-8') - } else if ('deleteVfModuleRequest'.equals(requestType)) { - String vnfId = getChildText(root, 'vnfId') + } else if ('deleteVfModuleRequest'.equals(requestType)) { + String vnfId = getChildText(root, 'vnfId') - if (vnfId == null || vnfId.isEmpty()) { - String msg = getProcessKey(execution) + ': no vnfId in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); + if (vnfId == null || vnfId.isEmpty()) { + String msg = getProcessKey(execution) + ': no vnfId in ' + requestType + logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + ErrorCode.UnknownError.getValue()); exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } + } - String vfModuleId = getChildText(root, 'vfModuleId') + String vfModuleId = getChildText(root, 'vfModuleId') - if (vfModuleId == null || vfModuleId.isEmpty()) { - String msg = getProcessKey(execution) + ': no vfModuleId in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); + if (vfModuleId == null || vfModuleId.isEmpty()) { + String msg = getProcessKey(execution) + ': no vfModuleId in ' + requestType + logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + ErrorCode.UnknownError.getValue()); exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } + } - vnfAdapterMethod = 'DELETE' - vnfAdapterUrl = vnfAdapterEndpoint + '/' + URLEncoder.encode(vnfId, 'UTF-8') + - '/vf-modules/' + URLEncoder.encode(vfModuleId, 'UTF-8') + vnfAdapterMethod = 'DELETE' + vnfAdapterUrl = vnfAdapterEndpoint + '/' + URLEncoder.encode(vnfId, 'UTF-8') + + '/vf-modules/' + URLEncoder.encode(vfModuleId, 'UTF-8') - } else if ('rollbackVfModuleRequest'.equals(requestType)) { - Node vfModuleRollbackNode = getChild(root, 'vfModuleRollback') + } else if ('rollbackVfModuleRequest'.equals(requestType)) { + Node vfModuleRollbackNode = getChild(root, 'vfModuleRollback') - if (vfModuleRollbackNode == null) { - String msg = getProcessKey(execution) + ': no vfModuleRollback in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); + if (vfModuleRollbackNode == null) { + String msg = getProcessKey(execution) + ': no vfModuleRollback in ' + requestType + logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + ErrorCode.UnknownError.getValue()); exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } + } - String vnfId = getChildText(vfModuleRollbackNode, 'vnfId') + String vnfId = getChildText(vfModuleRollbackNode, 'vnfId') - if (vnfId == null || vnfId.isEmpty()) { - String msg = getProcessKey(execution) + ': no vnfId in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); + if (vnfId == null || vnfId.isEmpty()) { + String msg = getProcessKey(execution) + ': no vnfId in ' + requestType + logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + ErrorCode.UnknownError.getValue()); exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } + } - String vfModuleId = getChildText(vfModuleRollbackNode, 'vfModuleId') + String vfModuleId = getChildText(vfModuleRollbackNode, 'vfModuleId') - if (vfModuleId == null || vfModuleId.isEmpty()) { - String msg = getProcessKey(execution) + ': no vfModuleId in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); + if (vfModuleId == null || vfModuleId.isEmpty()) { + String msg = getProcessKey(execution) + ': no vfModuleId in ' + requestType + logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + ErrorCode.UnknownError.getValue()); exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - - vnfAdapterMethod = 'DELETE' - vnfAdapterUrl = vnfAdapterEndpoint + '/' + URLEncoder.encode(vnfId, 'UTF-8') + - '/vf-modules/' + URLEncoder.encode(vfModuleId, 'UTF-8') + '/rollback' - - } else if ('createVolumeGroupRequest'.equals(requestType)) { - vnfAdapterMethod = 'POST' - if (vnfAdapterEndpoint.endsWith('v1/vnfs')) { - vnfAdapterEndpoint = vnfAdapterEndpoint.substring(0, (vnfAdapterEndpoint.length()-'/vnfs'.length())) - } - vnfAdapterUrl = vnfAdapterEndpoint + '/volume-groups' - - } else if ('updateVolumeGroupRequest'.equals(requestType)) { - String volumeGroupId = getChildText(root, 'volumeGroupId') - - if (volumeGroupId == null || volumeGroupId.isEmpty()) { - String msg = getProcessKey(execution) + ': no volumeGroupId in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); + } + + vnfAdapterMethod = 'DELETE' + vnfAdapterUrl = vnfAdapterEndpoint + '/' + URLEncoder.encode(vnfId, 'UTF-8') + + '/vf-modules/' + URLEncoder.encode(vfModuleId, 'UTF-8') + '/rollback' + + } else if ('createVolumeGroupRequest'.equals(requestType)) { + vnfAdapterMethod = 'POST' + if (vnfAdapterEndpoint.endsWith('v1/vnfs')) { + vnfAdapterEndpoint = vnfAdapterEndpoint.substring(0, (vnfAdapterEndpoint.length()-'/vnfs'.length())) + } + vnfAdapterUrl = vnfAdapterEndpoint + '/volume-groups' + + } else if ('updateVolumeGroupRequest'.equals(requestType)) { + String volumeGroupId = getChildText(root, 'volumeGroupId') + + if (volumeGroupId == null || volumeGroupId.isEmpty()) { + String msg = getProcessKey(execution) + ': no volumeGroupId in ' + requestType + logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + ErrorCode.UnknownError.getValue()); exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } + } - vnfAdapterMethod = 'PUT' - if (vnfAdapterEndpoint.endsWith('v1/vnfs')) { - vnfAdapterEndpoint = vnfAdapterEndpoint.substring(0, (vnfAdapterEndpoint.length()-'/vnfs'.length())) - } - vnfAdapterUrl = vnfAdapterEndpoint + '/volume-groups/' + URLEncoder.encode(volumeGroupId, 'UTF-8') + vnfAdapterMethod = 'PUT' + if (vnfAdapterEndpoint.endsWith('v1/vnfs')) { + vnfAdapterEndpoint = vnfAdapterEndpoint.substring(0, (vnfAdapterEndpoint.length()-'/vnfs'.length())) + } + vnfAdapterUrl = vnfAdapterEndpoint + '/volume-groups/' + URLEncoder.encode(volumeGroupId, 'UTF-8') - } else if ('deleteVolumeGroupRequest'.equals(requestType)) { - String volumeGroupId = getChildText(root, 'volumeGroupId') + } else if ('deleteVolumeGroupRequest'.equals(requestType)) { + String volumeGroupId = getChildText(root, 'volumeGroupId') - if (volumeGroupId == null || volumeGroupId.isEmpty()) { - String msg = getProcessKey(execution) + ': no volumeGroupId in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); + if (volumeGroupId == null || volumeGroupId.isEmpty()) { + String msg = getProcessKey(execution) + ': no volumeGroupId in ' + requestType + logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + ErrorCode.UnknownError.getValue()); exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } + } - vnfAdapterMethod = 'DELETE' - if (vnfAdapterEndpoint.endsWith('v1/vnfs')) { - vnfAdapterEndpoint = vnfAdapterEndpoint.substring(0, (vnfAdapterEndpoint.length()-'/vnfs'.length())) - } - vnfAdapterUrl = vnfAdapterEndpoint + '/volume-groups/' + URLEncoder.encode(volumeGroupId, 'UTF-8') + vnfAdapterMethod = 'DELETE' + if (vnfAdapterEndpoint.endsWith('v1/vnfs')) { + vnfAdapterEndpoint = vnfAdapterEndpoint.substring(0, (vnfAdapterEndpoint.length()-'/vnfs'.length())) + } + vnfAdapterUrl = vnfAdapterEndpoint + '/volume-groups/' + URLEncoder.encode(volumeGroupId, 'UTF-8') - } else if ('rollbackVolumeGroupRequest'.equals(requestType)) { - String volumeGroupId = getVolumeGroupIdFromRollbackRequest(root) + } else if ('rollbackVolumeGroupRequest'.equals(requestType)) { + String volumeGroupId = getVolumeGroupIdFromRollbackRequest(root) - if (volumeGroupId == null || volumeGroupId.isEmpty()) { - String msg = getProcessKey(execution) + ': no volumeGroupId in ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); + if (volumeGroupId == null || volumeGroupId.isEmpty()) { + String msg = getProcessKey(execution) + ': no volumeGroupId in ' + requestType + logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + ErrorCode.UnknownError.getValue()); exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - - vnfAdapterMethod = 'DELETE' - if (vnfAdapterEndpoint.endsWith('v1/vnfs')) { - vnfAdapterEndpoint = vnfAdapterEndpoint.substring(0, (vnfAdapterEndpoint.length()-'/vnfs'.length())) - } - vnfAdapterUrl = vnfAdapterEndpoint + '/volume-groups/' + URLEncoder.encode(volumeGroupId, 'UTF-8') + '/rollback' - - } else { - String msg = getProcessKey(execution) + ': Unsupported request type: ' + requestType - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); + } + + vnfAdapterMethod = 'DELETE' + if (vnfAdapterEndpoint.endsWith('v1/vnfs')) { + vnfAdapterEndpoint = vnfAdapterEndpoint.substring(0, (vnfAdapterEndpoint.length()-'/vnfs'.length())) + } + vnfAdapterUrl = vnfAdapterEndpoint + '/volume-groups/' + URLEncoder.encode(volumeGroupId, 'UTF-8') + '/rollback' + + } else { + String msg = getProcessKey(execution) + ': Unsupported request type: ' + requestType + logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + ErrorCode.UnknownError.getValue()); exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - - execution.setVariable(prefix + 'vnfAdapterMethod', vnfAdapterMethod) - logger.debug(getProcessKey(execution) + ': ' + prefix + 'vnfAdapterMethod = ' + vnfAdapterMethod) - execution.setVariable(prefix + 'vnfAdapterUrl', vnfAdapterUrl) - logger.debug(getProcessKey(execution) + ': ' + prefix + 'vnfAdapterUrl = ' + vnfAdapterUrl) - execution.setVariable(prefix + 'vnfAdapterRequest', vnfAdapterRequest) - logger.debug(getProcessKey(execution) + ': ' + prefix + 'vnfAdapterRequest = \n' + vnfAdapterRequest) - - // Get the Basic Auth credentials for the VnfAdapter - - String basicAuthValue = UrnPropertiesReader.getVariable("mso.adapters.po.auth", execution) - - if (basicAuthValue == null || basicAuthValue.isEmpty()) { - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), - getProcessKey(execution) + ": mso:adapters:po:auth URN mapping is not defined", "BPMN", - ErrorCode.UnknownError.getValue()); - } else { - try { - def encodedString = utils.getBasicAuth(basicAuthValue, UrnPropertiesReader.getVariable("mso.msoKey", execution)) - execution.setVariable(prefix + 'basicAuthHeaderValue', encodedString) - } catch (IOException ex) { - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), - getProcessKey(execution) + ": Unable to encode BasicAuth credentials for VnfAdapter", - "BPMN", ErrorCode.UnknownError.getValue(), ex); - } - } - - } catch (BpmnError e) { - logger.debug(" Rethrowing MSOWorkflowException") - throw e - } catch (Exception e) { - String msg = 'Caught exception in ' + method + ": " + e - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); - logger.debug(msg) + } + + execution.setVariable(prefix + 'vnfAdapterMethod', vnfAdapterMethod) + logger.debug(getProcessKey(execution) + ': ' + prefix + 'vnfAdapterMethod = ' + vnfAdapterMethod) + execution.setVariable(prefix + 'vnfAdapterUrl', vnfAdapterUrl) + logger.debug(getProcessKey(execution) + ': ' + prefix + 'vnfAdapterUrl = ' + vnfAdapterUrl) + execution.setVariable(prefix + 'vnfAdapterRequest', vnfAdapterRequest) + logger.debug(getProcessKey(execution) + ': ' + prefix + 'vnfAdapterRequest = \n' + vnfAdapterRequest) + + // Get the Basic Auth credentials for the VnfAdapter + + String basicAuthValue = UrnPropertiesReader.getVariable("mso.adapters.po.auth", execution) + + if (basicAuthValue == null || basicAuthValue.isEmpty()) { + logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), + getProcessKey(execution) + ": mso:adapters:po:auth URN mapping is not defined", "BPMN", + ErrorCode.UnknownError.getValue()); + } else { + try { + def encodedString = utils.getBasicAuth(basicAuthValue, UrnPropertiesReader.getVariable("mso.msoKey", execution)) + execution.setVariable(prefix + 'basicAuthHeaderValue', encodedString) + } catch (IOException ex) { + logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), + getProcessKey(execution) + ": Unable to encode BasicAuth credentials for VnfAdapter", + "BPMN", ErrorCode.UnknownError.getValue(), ex); + } + } + + } catch (BpmnError e) { + logger.debug(" Rethrowing MSOWorkflowException") + throw e + } catch (Exception e) { + String msg = 'Caught exception in ' + method + ": " + e + logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + ErrorCode.UnknownError.getValue()); + logger.debug(msg) exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - } + } + } - public String getVolumeGroupIdFromRollbackRequest(Node root) { - return root.'volumeGroupRollback'.'volumeGroupId'.text() - } + public String getVolumeGroupIdFromRollbackRequest(Node root) { + return root.'volumeGroupRollback'.'volumeGroupId'.text() + } - public String getMessageIdForVolumeGroupRollback(Node root) { - return root.'volumeGroupRollback'.'messageId'.text() - } + public String getMessageIdForVolumeGroupRollback(Node root) { + return root.'volumeGroupRollback'.'messageId'.text() + } - /** - * This method is used instead of an HTTP Connector task because the - * connector does not allow DELETE with a body. - */ - public void sendRequestToVnfAdapter(DelegateExecution execution) { - def method = getClass().getSimpleName() + '.sendRequestToVnfAdapter(' + - 'execution=' + execution.getId() + - ')' - logger.trace('Entered ' + method) + /** + * This method is used instead of an HTTP Connector task because the + * connector does not allow DELETE with a body. + */ + public void sendRequestToVnfAdapter(DelegateExecution execution) { + def method = getClass().getSimpleName() + '.sendRequestToVnfAdapter(' + + 'execution=' + execution.getId() + + ')' + logger.trace('Entered ' + method) - String prefix = execution.getVariable('prefix') + String prefix = execution.getVariable('prefix') - try { - String vnfAdapterMethod = execution.getVariable(prefix + 'vnfAdapterMethod') - String vnfAdapterUrl = execution.getVariable(prefix + 'vnfAdapterUrl') - String vnfAdapterRequest = execution.getVariable(prefix + 'vnfAdapterRequest') + try { + String vnfAdapterMethod = execution.getVariable(prefix + 'vnfAdapterMethod') + String vnfAdapterUrl = execution.getVariable(prefix + 'vnfAdapterUrl') + String vnfAdapterRequest = execution.getVariable(prefix + 'vnfAdapterRequest') - URL url = new URL(vnfAdapterUrl); + URL url = new URL(vnfAdapterUrl); HttpClient httpClient = new HttpClientFactory().newXmlClient(url, ONAPComponents.VNF_ADAPTER) - httpClient.addAdditionalHeader("Authorization", execution.getVariable(prefix + "basicAuthHeaderValue")) - - httpClient.addAdditionalHeader("X-ONAP-RequestID", execution.getVariable("mso-request-id")) - httpClient.addAdditionalHeader("X-ONAP-InvocationID", UUID.randomUUID().toString()) - httpClient.addAdditionalHeader("X-ONAP-PartnerName", "SO-VNFAdapter") - Response response; - - if ("GET".equals(vnfAdapterMethod)) { - response = httpClient.get() - } else if ("PUT".equals(vnfAdapterMethod)) { - response = httpClient.put(vnfAdapterRequest) - } else if ("POST".equals(vnfAdapterMethod)) { - response = httpClient.post(vnfAdapterRequest) - } else if ("DELETE".equals(vnfAdapterMethod)) { - response = httpClient.delete(vnfAdapterRequest) - } else { - String msg = 'Unsupported HTTP method "' + vnfAdapterMethod + '" in ' + method + ": " + e - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); + httpClient.addAdditionalHeader("Authorization", execution.getVariable(prefix + "basicAuthHeaderValue")) + + httpClient.addAdditionalHeader("X-ONAP-RequestID", execution.getVariable("mso-request-id")) + httpClient.addAdditionalHeader("X-ONAP-InvocationID", UUID.randomUUID().toString()) + httpClient.addAdditionalHeader("X-ONAP-PartnerName", "SO-VNFAdapter") + Response response; + + if ("GET".equals(vnfAdapterMethod)) { + response = httpClient.get() + } else if ("PUT".equals(vnfAdapterMethod)) { + response = httpClient.put(vnfAdapterRequest) + } else if ("POST".equals(vnfAdapterMethod)) { + response = httpClient.post(vnfAdapterRequest) + } else if ("DELETE".equals(vnfAdapterMethod)) { + response = httpClient.delete(vnfAdapterRequest) + } else { + String msg = 'Unsupported HTTP method "' + vnfAdapterMethod + '" in ' + method + ": " + e + logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + ErrorCode.UnknownError.getValue()); exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - - execution.setVariable(prefix + "vnfAdapterStatusCode", response.getStatus()) - if(response.hasEntity()){ - execution.setVariable(prefix + "vnfAdapterResponse", response.readEntity(String.class)) - } - } catch (BpmnError e) { - throw e - } catch (Exception e) { - String msg = 'Caught exception in ' + method + ": " + e - logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", - ErrorCode.UnknownError.getValue()); + } + + execution.setVariable(prefix + "vnfAdapterStatusCode", response.getStatus()) + if(response.hasEntity()){ + execution.setVariable(prefix + "vnfAdapterResponse", response.readEntity(String.class)) + } + } catch (BpmnError e) { + throw e + } catch (Exception e) { + String msg = 'Caught exception in ' + method + ": " + e + logger.error(LoggingAnchor.FOUR, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + ErrorCode.UnknownError.getValue()); exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg, ONAPComponents.SO) - } - } - - public void processCallback(DelegateExecution execution){ - def method = getClass().getSimpleName() + '.processCallback(' + - 'execution=' + execution.getId() + - ')' - logger.trace('Entered ' + method) - - String callback = execution.getVariable('VNFAResponse_MESSAGE') - - try { - logger.debug(getProcessKey(execution) + ": received callback:\n" + callback) - - // The XML callback is available to the calling flow in any case, - // even if a WorkflowException is generated. - execution.setVariable(getProcessKey(execution) + 'Response', callback) - // TODO: Should deprecate use of processKey+Response variable for the response. Will use "WorkflowResponse" instead. - execution.setVariable("WorkflowResponse", callback) - - callback = utils.removeXmlPreamble(callback) - - Node root = new XmlParser().parseText(callback) - if (root.name().endsWith('Exception')) { - vnfAdapterWorkflowException(execution, callback) - } - } catch (Exception e) { - logger.debug("Error encountered within VnfAdapterRest ProcessCallback method: {}", e.getMessage(), e) + } + } + + public void processCallback(DelegateExecution execution){ + def method = getClass().getSimpleName() + '.processCallback(' + + 'execution=' + execution.getId() + + ')' + logger.trace('Entered ' + method) + + String callback = execution.getVariable('VNFAResponse_MESSAGE') + + try { + logger.debug(getProcessKey(execution) + ": received callback:\n" + callback) + + // The XML callback is available to the calling flow in any case, + // even if a WorkflowException is generated. + execution.setVariable(getProcessKey(execution) + 'Response', callback) + // TODO: Should deprecate use of processKey+Response variable for the response. Will use "WorkflowResponse" instead. + execution.setVariable("WorkflowResponse", callback) + + callback = utils.removeXmlPreamble(callback) + + Node root = new XmlParser().parseText(callback) + if (root.name().endsWith('Exception')) { + vnfAdapterWorkflowException(execution, callback) + } + } catch (Exception e) { + logger.debug("Error encountered within VnfAdapterRest ProcessCallback method: {}", e.getMessage(), e) exceptionUtil.buildAndThrowWorkflowException(execution, 7020, "Error encountered within VnfAdapterRest ProcessCallback method", ONAPComponents.SO) - } - } - - /** - * Tries to parse the response as XML to extract the information to create - * a WorkflowException. If the response cannot be parsed, a more generic - * WorkflowException is created. - */ - public void vnfAdapterWorkflowException(DelegateExecution execution, Object response) { - try { - Node root = new XmlParser().parseText(response) - String category = getChildText(root, "category") - category = category == null || category.isEmpty() ? "" : " category='" + category + "'" - String message = getChildText(root, "message") - message = message == null || message.isEmpty() ? "" : " message='" + message + "'" - String rolledBack = getChildText(root, "rolledBack") - rolledBack = rolledBack == null || rolledBack.isEmpty() ? "" : " rolledBack='" + rolledBack + "'" - exceptionUtil.buildWorkflowException(execution, 7020, "Received " + root.name() + + } + } + + /** + * Tries to parse the response as XML to extract the information to create + * a WorkflowException. If the response cannot be parsed, a more generic + * WorkflowException is created. + */ + public void vnfAdapterWorkflowException(DelegateExecution execution, Object response) { + try { + Node root = new XmlParser().parseText(response) + String category = getChildText(root, "category") + category = category == null || category.isEmpty() ? "" : " category='" + category + "'" + String message = getChildText(root, "message") + message = message == null || message.isEmpty() ? "" : " message='" + message + "'" + String rolledBack = getChildText(root, "rolledBack") + rolledBack = rolledBack == null || rolledBack.isEmpty() ? "" : " rolledBack='" + rolledBack + "'" + exceptionUtil.buildWorkflowException(execution, 7020, "Received " + root.name() + " from VnfAdapter:" + category + message + rolledBack, Components.OPENSTACK); - } catch (Exception e) { - response = response == null || String.valueOf(response).isEmpty() ? "NONE" : response + } catch (Exception e) { + response = response == null || String.valueOf(response).isEmpty() ? "NONE" : response exceptionUtil.buildWorkflowException(execution, 7020, "Received error from VnfAdapter: " + response, Components.OPENSTACK) - } - } - - /** - * Gets the named child of the specified node. - * @param node the node - * @param name the child name - * @return the child node, or null if no such child exists - */ - private Node getChild(Node node, String name) { - for (Node child : node.children()) { - if (child.name() == name) { - return child - } - } - return null - } - - /** - * Gets the text of the named child of the specified node. - * @param node the node - * @param name the child name - * @return the child node text, or null if no such child exists - */ - private String getChildText(Node node, String name) { - Node child = getChild(node, name) - return child == null ? null : child.text() - } - - public Logger getLogger() { - return logger; - } + } + } + + /** + * Gets the named child of the specified node. + * @param node the node + * @param name the child name + * @return the child node, or null if no such child exists + */ + private Node getChild(Node node, String name) { + for (Node child : node.children()) { + if (child.name() == name) { + return child + } + } + return null + } + + /** + * Gets the text of the named child of the specified node. + * @param node the node + * @param name the child name + * @return the child node text, or null if no such child exists + */ + private String getChildText(Node node, String name) { + Node child = getChild(node, name) + return child == null ? null : child.text() + } + + public Logger getLogger() { + return logger; + } } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java index 2e9d4b0117..30fd2c8770 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java @@ -45,6 +45,7 @@ import org.onap.so.logger.LoggingAnchor; import org.onap.so.logger.MessageEnum; import org.onap.so.objects.audit.AAIObjectAudit; import org.onap.so.objects.audit.AAIObjectAuditList; +import org.onap.so.utils.Components; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; @@ -207,26 +208,26 @@ public class ExceptionBuilder { } public void buildAndThrowWorkflowException(DelegateExecution execution, int errorCode, String errorMessage) { + + buildWorkflowException(execution, errorCode, errorMessage); + logger.info("Throwing MSOWorkflowException"); + throw new BpmnError("MSOWorkflowException"); + } + + public void buildWorkflowException(DelegateExecution execution, int errorCode, String errorMessage) { String processKey = getProcessKey(execution); - logger.info("Building a WorkflowException for Subflow"); + logger.info("Building a WorkflowException"); WorkflowException exception = new WorkflowException(processKey, errorCode, errorMessage); execution.setVariable("WorkflowException", exception); execution.setVariable("WorkflowExceptionErrorMessage", errorMessage); logger.info("Outgoing WorkflowException is {}", exception); - logger.info("Throwing MSOWorkflowException"); - throw new BpmnError("MSOWorkflowException"); } public void buildAndThrowWorkflowException(DelegateExecution execution, int errorCode, String errorMessage, ONAPComponentsList extSystemErrorSource) { - String processKey = getProcessKey(execution); - logger.info("Building a WorkflowException for Subflow"); - WorkflowException exception = new WorkflowException(processKey, errorCode, errorMessage, extSystemErrorSource); - execution.setVariable("WorkflowException", exception); - execution.setVariable("WorkflowExceptionErrorMessage", errorMessage); - logger.info("Outgoing WorkflowException is {}", exception); + buildWorkflowException(execution, errorCode, errorMessage, extSystemErrorSource); logger.info("Throwing MSOWorkflowException"); throw new BpmnError("MSOWorkflowException"); } @@ -313,7 +314,7 @@ public class ExceptionBuilder { execution.setVariable("WorkflowException", exception); execution.setVariable("WorkflowExceptionErrorMessage", errorMessage.toString()); logger.info("Outgoing WorkflowException is {}", exception); - logger.info("Throwing MSOWorkflowException"); + logger.info("Throwing AAIInventoryFailure"); throw new BpmnError("AAIInventoryFailure"); } @@ -323,9 +324,42 @@ public class ExceptionBuilder { execution.setVariable("WorkflowException", exception); execution.setVariable("WorkflowExceptionErrorMessage", errorMessage); logger.info("Outgoing WorkflowException is {}", exception); - logger.info("Throwing MSOWorkflowException"); + logger.info("Throwing AAIInventoryFailure"); throw new BpmnError("AAIInventoryFailure"); } } + public void processVnfAdapterException(DelegateExecution execution) { + StringBuilder workflowExceptionMessage = new StringBuilder(); + logger.debug("Processing Vnf Adapter Exception"); + try { + String errorMessage = (String) execution.getVariable("openstackAdapterErrorMessage"); + boolean openstackRollbackPollSuccess = (boolean) execution.getVariable("OpenstackPollSuccess"); + boolean rollbackPerformed = (boolean) execution.getVariable("rollbackPerformed"); + boolean openstackRollbackSuccess = (boolean) execution.getVariable("OpenstackRollbackSuccess"); + boolean pollRollbackStatus = (boolean) execution.getVariable("PollRollbackStatus"); + + workflowExceptionMessage.append("Exception occured during vnf adapter: " + errorMessage + "."); + + boolean rollbackCompleted = false; + if (rollbackPerformed) { + if (openstackRollbackSuccess && !pollRollbackStatus) { + rollbackCompleted = true; + } else if (openstackRollbackSuccess && pollRollbackStatus) { + if (openstackRollbackPollSuccess) { + rollbackCompleted = true; + } + } + workflowExceptionMessage + .append(" The resource was rollbacked in openstack: " + rollbackCompleted + "."); + } + } catch (Exception e) { + logger.debug("Error while Processing Vnf Adapter Exception", e); + } + buildWorkflowException(execution, 500, workflowExceptionMessage.toString(), Components.OPENSTACK); + throw new BpmnError("MSOWorkflowException"); + + + } + } diff --git a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/VnfAdapterTask.bpmn b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/VnfAdapterTask.bpmn new file mode 100644 index 0000000000..69b68e534e --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/VnfAdapterTask.bpmn @@ -0,0 +1,336 @@ +<?xml version="1.0" encoding="UTF-8"?> +<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_GraPIIyxEeWmdMDkx6Uftw" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> + <bpmn2:process id="vnfAdapterTask" name="vnfAdapterTask" isExecutable="true"> + <bpmn2:endEvent id="EndEvent_6"> + <bpmn2:incoming>SequenceFlow_13uy51h</bpmn2:incoming> + </bpmn2:endEvent> + <bpmn2:startEvent id="StartEvent_1"> + <bpmn2:outgoing>SequenceFlow_9</bpmn2:outgoing> + </bpmn2:startEvent> + <bpmn2:sequenceFlow id="SequenceFlow_9" name="" sourceRef="StartEvent_1" targetRef="executeOpenstackAction" /> + <bpmn2:serviceTask id="executeOpenstackAction" name=" Openstack Action (resource) " camunda:asyncAfter="true" camunda:type="external" camunda:topic="OpenstackAdapterInvoke"> + <bpmn2:incoming>SequenceFlow_9</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_1ff2y8j</bpmn2:outgoing> + </bpmn2:serviceTask> + <bpmn2:sequenceFlow id="SequenceFlow_1ff2y8j" sourceRef="executeOpenstackAction" targetRef="ExclusiveGateway_08a6you" /> + <bpmn2:serviceTask id="ServiceTask_11iuzx9" name=" Openstack Query (resource) " camunda:asyncAfter="true" camunda:type="external" camunda:topic="OpenstackAdapterPolling"> + <bpmn2:incoming>SequenceFlow_1p39f4r</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_0ecut35</bpmn2:outgoing> + </bpmn2:serviceTask> + <bpmn2:sequenceFlow id="SequenceFlow_0ecut35" sourceRef="ServiceTask_11iuzx9" targetRef="ExclusiveGateway_1fn953y" /> + <bpmn2:exclusiveGateway id="ExclusiveGateway_1fn953y" name="Success?"> + <bpmn2:incoming>SequenceFlow_0ecut35</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_13uy51h</bpmn2:outgoing> + <bpmn2:outgoing>SequenceFlow_0o8wnkx</bpmn2:outgoing> + </bpmn2:exclusiveGateway> + <bpmn2:sequenceFlow id="SequenceFlow_13uy51h" name="Yes" sourceRef="ExclusiveGateway_1fn953y" targetRef="EndEvent_6"> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("OpenstackPollSuccess") == true }]]></bpmn2:conditionExpression> + </bpmn2:sequenceFlow> + <bpmn2:sequenceFlow id="SequenceFlow_0o8wnkx" name="No" sourceRef="ExclusiveGateway_1fn953y" targetRef="EndEvent_1dt01ez"> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("OpenstackPollSuccess") == false }]]></bpmn2:conditionExpression> + </bpmn2:sequenceFlow> + <bpmn2:exclusiveGateway id="ExclusiveGateway_08a6you" name="Success?"> + <bpmn2:incoming>SequenceFlow_1ff2y8j</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_1p39f4r</bpmn2:outgoing> + <bpmn2:outgoing>SequenceFlow_007m32h</bpmn2:outgoing> + </bpmn2:exclusiveGateway> + <bpmn2:sequenceFlow id="SequenceFlow_1p39f4r" name="Yes" sourceRef="ExclusiveGateway_08a6you" targetRef="ServiceTask_11iuzx9"> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("OpenstackInvokeSuccess") == true }]]></bpmn2:conditionExpression> + </bpmn2:sequenceFlow> + <bpmn2:sequenceFlow id="SequenceFlow_007m32h" name="No" sourceRef="ExclusiveGateway_08a6you" targetRef="EndEvent_0rxprkw"> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("OpenstackInvokeSuccess") == false }]]></bpmn2:conditionExpression> + </bpmn2:sequenceFlow> + <bpmn2:subProcess id="SubProcess_0y17e8j" name="Error Handling" triggeredByEvent="true"> + <bpmn2:startEvent id="StartEvent_17oglfe"> + <bpmn2:outgoing>SequenceFlow_02rhau9</bpmn2:outgoing> + <bpmn2:errorEventDefinition /> + </bpmn2:startEvent> + <bpmn2:intermediateThrowEvent id="IntermediateThrowEvent_040yoan"> + <bpmn2:incoming>SequenceFlow_0y1by9x</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_006myq9</bpmn2:outgoing> + <bpmn2:compensateEventDefinition waitForCompletion="true" activityRef="executeOpenstackAction" /> + </bpmn2:intermediateThrowEvent> + <bpmn2:exclusiveGateway id="ExclusiveGateway_0qlnby0" name="Poll Rollback Status?" default="SequenceFlow_1piwh1c"> + <bpmn2:incoming>SequenceFlow_006myq9</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_1ubla93</bpmn2:outgoing> + <bpmn2:outgoing>SequenceFlow_1piwh1c</bpmn2:outgoing> + </bpmn2:exclusiveGateway> + <bpmn2:sequenceFlow id="SequenceFlow_02rhau9" sourceRef="StartEvent_17oglfe" targetRef="ExclusiveGateway_18ndby1" /> + <bpmn2:sequenceFlow id="SequenceFlow_006myq9" sourceRef="IntermediateThrowEvent_040yoan" targetRef="ExclusiveGateway_0qlnby0" /> + <bpmn2:serviceTask id="ServiceTask_120p27h" name=" Openstack Query (resource) " camunda:asyncAfter="true" camunda:type="external" camunda:topic="OpenstackAdapterPolling"> + <bpmn2:incoming>SequenceFlow_1ubla93</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_1nku4uk</bpmn2:outgoing> + </bpmn2:serviceTask> + <bpmn2:exclusiveGateway id="ExclusiveGateway_0tuxj9l"> + <bpmn2:incoming>SequenceFlow_1piwh1c</bpmn2:incoming> + <bpmn2:incoming>SequenceFlow_1nku4uk</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_1yx80cq</bpmn2:outgoing> + </bpmn2:exclusiveGateway> + <bpmn2:serviceTask id="buildError" name=" Process Exception " camunda:expression="${ExceptionBuilder.processVnfAdapterException(execution)}"> + <bpmn2:incoming>SequenceFlow_1yx80cq</bpmn2:incoming> + <bpmn2:incoming>SequenceFlow_1az3a2q</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_0bnzfqb</bpmn2:outgoing> + </bpmn2:serviceTask> + <bpmn2:sequenceFlow id="SequenceFlow_1ubla93" name="Yes" sourceRef="ExclusiveGateway_0qlnby0" targetRef="ServiceTask_120p27h"> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("PollRollbackStatus") == true}]]></bpmn2:conditionExpression> + </bpmn2:sequenceFlow> + <bpmn2:sequenceFlow id="SequenceFlow_1piwh1c" name="No" sourceRef="ExclusiveGateway_0qlnby0" targetRef="ExclusiveGateway_0tuxj9l" /> + <bpmn2:sequenceFlow id="SequenceFlow_1nku4uk" sourceRef="ServiceTask_120p27h" targetRef="ExclusiveGateway_0tuxj9l" /> + <bpmn2:sequenceFlow id="SequenceFlow_1yx80cq" sourceRef="ExclusiveGateway_0tuxj9l" targetRef="buildError" /> + <bpmn2:sequenceFlow id="SequenceFlow_0bnzfqb" sourceRef="buildError" targetRef="EndEvent_1yiy2fi" /> + <bpmn2:endEvent id="EndEvent_1yiy2fi"> + <bpmn2:incoming>SequenceFlow_0bnzfqb</bpmn2:incoming> + <bpmn2:terminateEventDefinition /> + </bpmn2:endEvent> + <bpmn2:exclusiveGateway id="ExclusiveGateway_18ndby1" name="Rollback Resource?" default="SequenceFlow_1az3a2q"> + <bpmn2:incoming>SequenceFlow_02rhau9</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_0y1by9x</bpmn2:outgoing> + <bpmn2:outgoing>SequenceFlow_1az3a2q</bpmn2:outgoing> + </bpmn2:exclusiveGateway> + <bpmn2:sequenceFlow id="SequenceFlow_0y1by9x" name="Yes" sourceRef="ExclusiveGateway_18ndby1" targetRef="IntermediateThrowEvent_040yoan"> + <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[#{execution.getVariable("backout") == true }]]></bpmn2:conditionExpression> + </bpmn2:sequenceFlow> + <bpmn2:sequenceFlow id="SequenceFlow_1az3a2q" name="No" sourceRef="ExclusiveGateway_18ndby1" targetRef="buildError" /> + </bpmn2:subProcess> + <bpmn2:boundaryEvent id="BoundaryEvent_1ysr7mk" attachedToRef="executeOpenstackAction"> + <bpmn2:compensateEventDefinition /> + </bpmn2:boundaryEvent> + <bpmn2:serviceTask id="Task_0zbd85n" name=" Openstack Rollback (resource) " isForCompensation="true" camunda:asyncAfter="true" camunda:type="external" camunda:topic="OpenstackAdapterRollback" /> + <bpmn2:endEvent id="EndEvent_0rxprkw"> + <bpmn2:incoming>SequenceFlow_007m32h</bpmn2:incoming> + <bpmn2:errorEventDefinition errorRef="Error_1" /> + </bpmn2:endEvent> + <bpmn2:endEvent id="EndEvent_1dt01ez"> + <bpmn2:incoming>SequenceFlow_0o8wnkx</bpmn2:incoming> + <bpmn2:errorEventDefinition errorRef="Error_1" /> + </bpmn2:endEvent> + <bpmn2:association id="Association_1cnlu6p" associationDirection="One" sourceRef="BoundaryEvent_1ysr7mk" targetRef="Task_0zbd85n" /> + </bpmn2:process> + <bpmn2:error id="Error_1" name="MSO Workflow Exception" errorCode="MSOWorkflowException" /> + <bpmn2:message id="Message_1" name="WorkflowMessage" /> + <bpmndi:BPMNDiagram id="BPMNDiagram_1"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="vnfAdapterTask"> + <bpmndi:BPMNShape id="_BPMNShape_StartEvent_54" bpmnElement="StartEvent_1"> + <dc:Bounds x="110" y="146" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="116" y="187" width="24" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_9" sourceElement="_BPMNShape_StartEvent_54" targetElement="ServiceTask_0rcy900_di"> + <di:waypoint xsi:type="dc:Point" x="146" y="164" /> + <di:waypoint xsi:type="dc:Point" x="253" y="163" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="154.5" y="145.5" width="90" height="6" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="_BPMNShape_EndEvent_158" bpmnElement="EndEvent_6"> + <dc:Bounds x="929" y="146" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="924" y="187" width="46" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_0rcy900_di" bpmnElement="executeOpenstackAction"> + <dc:Bounds x="253" y="124" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1ff2y8j_di" bpmnElement="SequenceFlow_1ff2y8j"> + <di:waypoint xsi:type="dc:Point" x="353" y="164" /> + <di:waypoint xsi:type="dc:Point" x="404" y="164" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="333.5" y="139" width="90" height="20" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ServiceTask_11iuzx9_di" bpmnElement="ServiceTask_11iuzx9"> + <dc:Bounds x="541" y="124" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_0ecut35_di" bpmnElement="SequenceFlow_0ecut35"> + <di:waypoint xsi:type="dc:Point" x="641" y="164" /> + <di:waypoint xsi:type="dc:Point" x="676" y="164" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="613.5" y="139" width="90" height="20" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ExclusiveGateway_1fn953y_di" bpmnElement="ExclusiveGateway_1fn953y" isMarkerVisible="true"> + <dc:Bounds x="676" y="139" width="50" height="50" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="676" y="119" width="49" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_13uy51h_di" bpmnElement="SequenceFlow_13uy51h"> + <di:waypoint xsi:type="dc:Point" x="726" y="164" /> + <di:waypoint xsi:type="dc:Point" x="929" y="164" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="746.6875" y="166" width="19" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0o8wnkx_di" bpmnElement="SequenceFlow_0o8wnkx"> + <di:waypoint xsi:type="dc:Point" x="701" y="189" /> + <di:waypoint xsi:type="dc:Point" x="701" y="249" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="706" y="198" width="14" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ServiceTask_120p27h_di" bpmnElement="ServiceTask_120p27h"> + <dc:Bounds x="496" y="443" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ExclusiveGateway_08a6you_di" bpmnElement="ExclusiveGateway_08a6you" isMarkerVisible="true"> + <dc:Bounds x="404" y="139" width="50" height="50" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="409" y="117" width="49" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1p39f4r_di" bpmnElement="SequenceFlow_1p39f4r"> + <di:waypoint xsi:type="dc:Point" x="454" y="164" /> + <di:waypoint xsi:type="dc:Point" x="541" y="164" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="472" y="168" width="19" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_007m32h_di" bpmnElement="SequenceFlow_007m32h"> + <di:waypoint xsi:type="dc:Point" x="429" y="189" /> + <di:waypoint xsi:type="dc:Point" x="429" y="249" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="435" y="198" width="14" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="SubProcess_09bkjg0_di" bpmnElement="SubProcess_0y17e8j" isExpanded="true"> + <dc:Bounds x="151" y="404" width="787" height="344" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="BoundaryEvent_04c5efr_di" bpmnElement="BoundaryEvent_1ysr7mk"> + <dc:Bounds x="335" y="186" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="353" y="226" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="Association_1cnlu6p_di" bpmnElement="Association_1cnlu6p"> + <di:waypoint xsi:type="dc:Point" x="353" y="222" /> + <di:waypoint xsi:type="dc:Point" x="353" y="267" /> + <di:waypoint xsi:type="dc:Point" x="321" y="267" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ServiceTask_0vacscp_di" bpmnElement="Task_0zbd85n"> + <dc:Bounds x="221" y="227" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_0lzcn0v_di" bpmnElement="EndEvent_0rxprkw"> + <dc:Bounds x="411" y="249" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="429" y="288.658" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="EndEvent_14424k5_di" bpmnElement="EndEvent_1dt01ez"> + <dc:Bounds x="683" y="249" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="701" y="288.658" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="StartEvent_1wrpebh_di" bpmnElement="StartEvent_17oglfe"> + <dc:Bounds x="181" y="599" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="198.35199999999998" y="638.658" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="IntermediateThrowEvent_0gltuh4_di" bpmnElement="IntermediateThrowEvent_040yoan"> + <dc:Bounds x="365" y="529" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="382.352" y="569" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ExclusiveGateway_0qlnby0_di" bpmnElement="ExclusiveGateway_0qlnby0" isMarkerVisible="true"> + <dc:Bounds x="429.352" y="522" width="50" height="50" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="484" y="535" width="62" height="24" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_02rhau9_di" bpmnElement="SequenceFlow_02rhau9"> + <di:waypoint xsi:type="dc:Point" x="217" y="617" /> + <di:waypoint xsi:type="dc:Point" x="284" y="617" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="250.5" y="596" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_006myq9_di" bpmnElement="SequenceFlow_006myq9"> + <di:waypoint xsi:type="dc:Point" x="401" y="547" /> + <di:waypoint xsi:type="dc:Point" x="429" y="547" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="415" y="526" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ExclusiveGateway_0tuxj9l_di" bpmnElement="ExclusiveGateway_0tuxj9l" isMarkerVisible="true"> + <dc:Bounds x="608.352" y="522" width="50" height="50" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="633.352" y="576" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_108cgfw_di" bpmnElement="buildError"> + <dc:Bounds x="695" y="577" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1ubla93_di" bpmnElement="SequenceFlow_1ubla93"> + <di:waypoint xsi:type="dc:Point" x="454" y="522" /> + <di:waypoint xsi:type="dc:Point" x="454" y="483" /> + <di:waypoint xsi:type="dc:Point" x="496" y="483" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="461" y="489" width="19" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1piwh1c_di" bpmnElement="SequenceFlow_1piwh1c"> + <di:waypoint xsi:type="dc:Point" x="454" y="572" /> + <di:waypoint xsi:type="dc:Point" x="454" y="603" /> + <di:waypoint xsi:type="dc:Point" x="633" y="603" /> + <di:waypoint xsi:type="dc:Point" x="633" y="572" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="460" y="576.85" width="14" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1nku4uk_di" bpmnElement="SequenceFlow_1nku4uk"> + <di:waypoint xsi:type="dc:Point" x="596" y="483" /> + <di:waypoint xsi:type="dc:Point" x="633" y="483" /> + <di:waypoint xsi:type="dc:Point" x="633" y="522" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="614.5" y="462" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1yx80cq_di" bpmnElement="SequenceFlow_1yx80cq"> + <di:waypoint xsi:type="dc:Point" x="658" y="547" /> + <di:waypoint xsi:type="dc:Point" x="745" y="547" /> + <di:waypoint xsi:type="dc:Point" x="745" y="577" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="656.5" y="526" width="90" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0bnzfqb_di" bpmnElement="SequenceFlow_0bnzfqb"> + <di:waypoint xsi:type="dc:Point" x="795" y="617" /> + <di:waypoint xsi:type="dc:Point" x="870" y="617" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="787.5" y="596" width="90" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="EndEvent_1l1f6zj_di" bpmnElement="EndEvent_1yiy2fi"> + <dc:Bounds x="870" y="599" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="887.352" y="639" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ExclusiveGateway_18ndby1_di" bpmnElement="ExclusiveGateway_18ndby1" isMarkerVisible="true"> + <dc:Bounds x="284.352" y="592" width="50" height="50" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="338" y="605" width="54" height="24" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_0y1by9x_di" bpmnElement="SequenceFlow_0y1by9x"> + <di:waypoint xsi:type="dc:Point" x="309" y="592" /> + <di:waypoint xsi:type="dc:Point" x="309" y="547" /> + <di:waypoint xsi:type="dc:Point" x="365" y="547" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="315" y="558" width="19" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1az3a2q_di" bpmnElement="SequenceFlow_1az3a2q"> + <di:waypoint xsi:type="dc:Point" x="309" y="642" /> + <di:waypoint xsi:type="dc:Point" x="309" y="686" /> + <di:waypoint xsi:type="dc:Point" x="745" y="686" /> + <di:waypoint xsi:type="dc:Point" x="745" y="657" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="318" y="657" width="14" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + </bpmndi:BPMNPlane> + </bpmndi:BPMNDiagram> +</bpmn2:definitions> |