* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
import org.onap.so.logger.MsoLogger;
import org.onap.so.serviceinstancebeans.RequestDetails;
import org.onap.so.serviceinstancebeans.ServiceInstancesRequest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component("ExecuteActivity")
public class ExecuteActivity implements JavaDelegate {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, ExecuteActivity.class);
+ private static final Logger logger = LoggerFactory.getLogger(ExecuteActivity.class);
private static final String G_BPMN_REQUEST = "bpmnRequest";
private static final String VNF_TYPE = "vnfType";
private static final String G_ACTION = "requestAction";
try {
final String implementationString = execution.getBpmnModelElementInstance().getAttributeValue(SERVICE_TASK_IMPLEMENTATION_ATTRIBUTE);
- msoLogger.debug("activity implementation String: " + implementationString);
+ logger.debug("activity implementation String: {}", implementationString);
if (!implementationString.startsWith(ACTIVITY_PREFIX)) {
buildAndThrowException(execution, "Implementation attribute has a wrong format");
}
String activityName = implementationString.replaceFirst(ACTIVITY_PREFIX, "");
- msoLogger.info("activityName is: " + activityName);
+ logger.info("activityName is: {}", activityName);
BuildingBlock buildingBlock = buildBuildingBlock(activityName);
ExecuteBuildingBlock executeBuildingBlock = buildExecuteBuildingBlock(execution, requestId, buildingBlock);
variables.put("buildingBlock", executeBuildingBlock);
variables.put("mso-request-id", requestId);
variables.put("retryCount", 1);
+ variables.put("aLaCarte", true);
ProcessInstanceWithVariables buildingBlockResult = runtimeService.createProcessInstanceByKey("ExecuteBuildingBlock").setVariables(variables).executeWithVariablesInReturn();
VariableMap variableMap = buildingBlockResult.getVariables();
WorkflowException workflowException = (WorkflowException) variableMap.get("WorklfowException");
if (workflowException != null) {
- msoLogger.error("Workflow exception is: " + workflowException.getErrorMessage());
+ logger.error("Workflow exception is: {}", workflowException.getErrorMessage());
}
execution.setVariable("WorkflowException", workflowException);
}
}
protected void buildAndThrowException(DelegateExecution execution, String msg, Exception ex) {
- msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, msg, "BPMN", MsoLogger.getServiceName(),
- MsoLogger.ErrorCode.UnknownError, msg, ex);
+ logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN",
+ MsoLogger.ErrorCode.UnknownError.getValue(), msg, ex);
execution.setVariable("ExecuteActivityErrorMessage", msg);
exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, msg);
}
protected void buildAndThrowException(DelegateExecution execution, String msg) {
- msoLogger.error(msg);
+ logger.error(msg);
execution.setVariable("ExecuteActuvityErrorMessage", msg);
exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, msg);
}