use of org.onap.so.client.exception.ExceptionBuilder in project so by onap.
the class WorkflowActionBBTasks method sendErrorSyncAck.
public void sendErrorSyncAck(DelegateExecution execution) {
final String requestId = (String) execution.getVariable(BBConstants.G_REQUEST_ID);
try {
ExceptionBuilder exceptionBuilder = new ExceptionBuilder();
String errorMsg = (String) execution.getVariable("WorkflowActionErrorMessage");
if (errorMsg == null) {
errorMsg = "WorkflowAction failed unexpectedly.";
}
String processKey = exceptionBuilder.getProcessKey(execution);
String buildworkflowException = "<aetgt:WorkflowException xmlns:aetgt=\"http://org.onap/so/workflow/schema/v1\"><aetgt:ErrorMessage>" + errorMsg + "</aetgt:ErrorMessage><aetgt:ErrorCode>7000</aetgt:ErrorCode></aetgt:WorkflowException>";
WorkflowCallbackResponse callbackResponse = new WorkflowCallbackResponse();
callbackResponse.setStatusCode(500);
callbackResponse.setMessage("Fail");
callbackResponse.setResponse(buildworkflowException);
WorkflowContextHolder.getInstance().processCallback(processKey, execution.getProcessInstanceId(), requestId, callbackResponse);
execution.setVariable("sentSyncResponse", true);
} catch (Exception ex) {
logger.error(" Sending Sync Error Activity Failed. {}", ex.getMessage(), ex);
}
}
use of org.onap.so.client.exception.ExceptionBuilder in project so by onap.
the class VnfEBBLoaderTest method setup.
@Before
public void setup() {
serviceId = "service123";
vnfId = "vnf123";
vfModuleId = "vfModule123";
serviceInstanceAAI = mock(org.onap.aai.domain.yang.ServiceInstance.class);
serviceInstanceMSO = mock(ServiceInstance.class);
bbInputSetupUtils = mock(BBInputSetupUtils.class);
bbInputSetup = mock(BBInputSetup.class);
workflowActionUtils = mock(WorkflowActionExtractResourcesAAI.class);
exceptionBuilder = mock(ExceptionBuilder.class);
delegateExecution = new DelegateExecutionFake();
}
Aggregations