1 package org.openecomp.mso.bpmn.infrastructure.scripts
\r
3 import org.camunda.bpm.engine.delegate.BpmnError
\r
4 import org.camunda.bpm.engine.delegate.DelegateExecution
\r
5 import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
\r
6 import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition
\r
7 import org.openecomp.mso.client.orchestration.AAIOrchestrator
\r
8 import org.openecomp.mso.client.orchestration.SDNCOrchestrator
\r
10 public class DoCreateServiceInstanceRollbackV2 extends AbstractServiceTaskProcessor{
\r
13 public void preProcessRequest(DelegateExecution execution) {
\r
17 public void aaiServiceInstanceRollback (DelegateExecution execution) {
\r
18 def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
\r
19 def aaiServiceInstanceRollback = execution.getVariable("aaiServiceInstanceRollback")
\r
20 if(aaiServiceInstanceRollback){
\r
21 utils.log("DEBUG"," ***** Started aaiServiceInstanceRollback *****", isDebugEnabled)
\r
23 ServiceDecomposition serviceDecomp = execution.getVariable("ServiceDecomposition")
\r
24 AAIOrchestrator aaiO = new AAIOrchestrator()
\r
25 aaiO.deleteServiceInstance(serviceDecomp)
\r
26 }catch (Exception ex) {
\r
27 String msg = "Error Response from AAI for aaiServiceInstanceRollback"
\r
28 execution.setVariable("rollbackError", msg)
\r
29 utils.log("DEBUG", msg, isDebugEnabled)
\r
30 throw new BpmnError("MSOWorkflowException")
\r
32 utils.log("DEBUG"," ***** Completed aaiServiceInstanceRollback *****", isDebugEnabled)
\r
34 utils.log("DEBUG", "***** SKIPPING A&AI ROLLBACK *****", isDebugEnabled)
\r
38 public void rollbackError (DelegateExecution execution) {
\r
39 def isDebugEnabled=execution.getVariable("isDebugLogEnabled")
\r
40 utils.log("DEBUG"," ***** rollbackError ***** ", isDebugEnabled)
\r
42 utils.log("DEBUG", "Caught an Exception in DoCreateServiceInstanceRollbackV2", isDebugEnabled)
\r
43 }catch(BpmnError b){
\r
44 utils.log("DEBUG", "BPMN Error during rollbackError: " + b.getMessage(), isDebugEnabled)
\r
45 }catch(Exception e){
\r
46 utils.log("DEBUG", "Caught Exception during rollbackError: " + e.getMessage(), isDebugEnabled)
\r
48 utils.log("DEBUG", " Exit processRollbackException", isDebugEnabled)
\r