diff options
Diffstat (limited to 'bpmn/mso-infrastructure-bpmn/src/main')
8 files changed, 11 insertions, 122 deletions
diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/CallbackHandlerService.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/CallbackHandlerService.java index f274850b8d..02164ccec1 100644 --- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/CallbackHandlerService.java +++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/CallbackHandlerService.java @@ -35,7 +35,6 @@ import org.onap.so.logger.MessageEnum; import org.onap.so.logger.MsoLogger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Component; import org.springframework.stereotype.Service; /** @@ -130,11 +129,9 @@ public class CallbackHandlerService { * @param variables variables to inject into the process * @param logMarker a marker for debug logging * @return true if a process could be found, false if not - * @throws Exception for correlation errors */ protected boolean correlate(String messageEventName, String correlationVariable, - String correlationValue, Map<String, Object> variables, String logMarker) - throws Exception { + String correlationValue, Map<String, Object> variables, String logMarker) { try{ LOGGER.debug(logMarker + " Attempting to find process waiting" + " for " + messageEventName + " with " + correlationVariable diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/ProcessEngineAwareService.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/ProcessEngineAwareService.java index 0e9e1425a6..8ceb1c1277 100644 --- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/ProcessEngineAwareService.java +++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/ProcessEngineAwareService.java @@ -23,8 +23,6 @@ package org.onap.so.bpmn.common.workflow.service; import java.util.Optional; -import javax.ws.rs.ext.Provider; - import org.camunda.bpm.engine.ProcessEngineServices; import org.camunda.bpm.engine.ProcessEngines; import org.springframework.stereotype.Service; diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/VnfAdapterNotifyServiceImpl.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/VnfAdapterNotifyServiceImpl.java index ae9cec9476..96a11d21a7 100644 --- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/VnfAdapterNotifyServiceImpl.java +++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/VnfAdapterNotifyServiceImpl.java @@ -49,8 +49,6 @@ import org.springframework.stereotype.Service; @Service public class VnfAdapterNotifyServiceImpl extends ProcessEngineAwareService implements VnfAdapterNotify{ - private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, VnfAdapterNotifyServiceImpl.class); - private final String logMarker = "[VNF-NOTIFY]"; @Autowired diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncResource.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncResource.java index 9ed36e5ba9..014b06deff 100644 --- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncResource.java +++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowAsyncResource.java @@ -23,7 +23,6 @@ package org.onap.so.bpmn.common.workflow.service; import java.util.HashMap; import java.util.Map; import java.util.Objects; -import java.util.Optional; import java.util.UUID; import javax.ws.rs.Consumes; @@ -67,10 +66,7 @@ import io.swagger.annotations.ApiOperation; public class WorkflowAsyncResource extends ProcessEngineAwareService { private static final WorkflowContextHolder contextHolder = WorkflowContextHolder.getInstance(); - - - protected Optional<ProcessEngineServices> pes4junit = Optional.empty(); - + long workflowPollInterval=1000; @Autowired @@ -79,12 +75,6 @@ public class WorkflowAsyncResource extends ProcessEngineAwareService { @Autowired private WorkflowContextHolder workflowContext; - public WorkflowProcessor getProcessor() { - return processor; - } - - - public void setProcessor(WorkflowProcessor processor) { this.processor = processor; } @@ -138,14 +128,6 @@ public class WorkflowAsyncResource extends ProcessEngineAwareService { throw new Exception("TimeOutOccured"); } - private WorkflowResponse buildTimeoutResponse(String requestId) { - WorkflowResponse response = new WorkflowResponse(); - response.setMessage("Fail"); - response.setResponse("Request timedout, request id:" + requestId); - response.setMessageCode(500); - return response; - } - private WorkflowResponse buildUnkownError(String requestId,String error) { WorkflowResponse response = new WorkflowResponse(); response.setMessage(error); @@ -166,46 +148,11 @@ public class WorkflowAsyncResource extends ProcessEngineAwareService { } return value; } - - // Note: the business key is used to identify the process in unit tests - protected static String getBusinessKey(Map<String, Object> inputVariables) { - return getOrCreate(inputVariables, "mso-business-key"); - } protected static String getRequestId(Map<String, Object> inputVariables) { return getOrCreate(inputVariables, "mso-request-id"); } - - - protected void recordEvents(String processKey, WorkflowResponse response, - long startTime) { - - msoLogger.recordMetricEvent ( startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, - response.getMessage() + " for processKey: " - + processKey + " with response: " + response.getResponse(), "BPMN", MDC.get(processKey), null); - - msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, - response.getMessage() + "for processKey: " + processKey + " with response: " + response.getResponse()); - - } - - protected static void setLogContext(String processKey, - Map<String, Object> inputVariables) { - MsoLogger.setServiceName("MSO." + processKey); - if (inputVariables != null) { - MsoLogger.setLogContext(getKeyValueFromInputVariables(inputVariables,"mso-request-id"), getKeyValueFromInputVariables(inputVariables,"serviceInstanceId")); - } - } - - protected static String getKeyValueFromInputVariables(Map<String,Object> inputVariables, String key) { - if (inputVariables == null) { - return ""; - } - - return Objects.toString(inputVariables.get(key), "N/A"); - } - protected boolean isProcessEnded(String processInstanceId) { ProcessEngineServices pes = getProcessEngineServices(); return pes.getRuntimeService().createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult() == null; @@ -224,25 +171,5 @@ public class WorkflowAsyncResource extends ProcessEngineAwareService { } return inputVariables; } - - - protected long getWaitTime(Map<String, Object> inputVariables) - { - - String timeout = Objects.toString(inputVariables.get("mso-service-request-timeout"), null); - - if (timeout != null) { - try { - return Long.parseLong(timeout)*1000; - } catch (NumberFormatException nex) { - msoLogger.debug("Invalid input for mso-service-request-timeout"); - } - } - - return DEFAULT_WAIT_TIME; - } - - - } diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java index 9ea97258ef..5afd7e00e8 100644 --- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java +++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/common/workflow/service/WorkflowProcessor.java @@ -38,12 +38,10 @@ import org.springframework.stereotype.Service; public class WorkflowProcessor extends ProcessEngineAwareService { private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, WorkflowProcessor.class); - protected static final String logMarker = "[WRKFLOW-RESOURCE]"; - protected static final long DEFAULT_WAIT_TIME = 30000; //default wait time @Async - public void startProcess( String processKey, VariableMapImpl variableMap) throws InterruptedException + public void startProcess( String processKey, VariableMapImpl variableMap) { long startTime = System.currentTimeMillis(); @@ -80,23 +78,12 @@ public class WorkflowProcessor extends ProcessEngineAwareService { throw new WorkflowProcessorException(workflowResponse); } } - - protected static String getKeyValueFromInputVariables(Map<String,Object> inputVariables, String key) { - if (inputVariables == null) { - return ""; - } - return Objects.toString(inputVariables.get(key), "N/A"); - } - // Note: the business key is used to identify the process in unit tests protected static String getBusinessKey(Map<String, Object> inputVariables) { return getOrCreate(inputVariables, "mso-business-key"); } - protected static String getRequestId(Map<String, Object> inputVariables) { - return getOrCreate(inputVariables, "mso-request-id"); - } protected static Map<String, Object> getInputVariables(VariableMapImpl variableMap) { Map<String, Object> inputVariables = new HashMap<>(); @@ -120,20 +107,5 @@ public class WorkflowProcessor extends ProcessEngineAwareService { } return value; } - - protected long getWaitTime(Map<String, Object> inputVariables) - { - - String timeout = Objects.toString(inputVariables.get("mso-service-request-timeout"), null); - if (timeout != null) { - try { - return Long.parseLong(timeout)*1000; - } catch (NumberFormatException nex) { - msoLogger.debug("Invalid input for mso-service-request-timeout"); - } - } - - return DEFAULT_WAIT_TIME; - } } diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/LoggingAndURNMappingPlugin.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/LoggingAndURNMappingPlugin.java index 9b65cca6c9..5435194f39 100644 --- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/LoggingAndURNMappingPlugin.java +++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/core/plugins/LoggingAndURNMappingPlugin.java @@ -196,6 +196,7 @@ public class LoggingAndURNMappingPlugin extends AbstractProcessEnginePlugin { @Override public void parseSequenceFlow(Element sequenceFlowElement, ScopeImpl scopeElement, TransitionImpl transition) { + //injectLogExecutionListener(activity); } @Override @@ -213,7 +214,7 @@ public class LoggingAndURNMappingPlugin extends AbstractProcessEnginePlugin { injectLogExecutionListener(timerActivity); } - @Override + @Override public void parseRootElement(Element rootElement, List<ProcessDefinitionEntity> processDefinitions) { } @@ -307,7 +308,8 @@ public class LoggingAndURNMappingPlugin extends AbstractProcessEnginePlugin { String processName = repositoryService.createProcessDefinitionQuery() .processDefinitionId(execution.getProcessDefinitionId()) .singleResult() - .getName(); + .getName(); + MsoLogger.setServiceName(processName); String requestId = (String) execution.getVariable("mso-request-id"); diff --git a/bpmn/mso-infrastructure-bpmn/src/main/resources/application-local.yml b/bpmn/mso-infrastructure-bpmn/src/main/resources/application-local.yml index 911aabdaec..ccea9483a8 100644 --- a/bpmn/mso-infrastructure-bpmn/src/main/resources/application-local.yml +++ b/bpmn/mso-infrastructure-bpmn/src/main/resources/application-local.yml @@ -1,5 +1,5 @@ aai: - auth: asdf + auth: D6F77EC78213EF2AA1685F7F05E4DE7C0D1A70AA8798EC68B691CEF81E9991E4A0A3DA4F70EC61C5EB6525134E dme2: timeout: '30000' endpoint: http://localhost:8443 @@ -38,7 +38,7 @@ mso: completemsoprocess: endpoint: http://localhost:30253/CompleteMsoProcess db: - auth: 26AFB797A6A57960D5D718491925C50F77CDC22AC394B3DBA09950D8FD1C0764 + auth: 5A1272FE739BECA4D4374A86B25C021DFE6745E3BB7BE6836BF64A6059B8220E586C21FD7567AF41DB42571EB7 password: wLg4sjrAFUS8rfVfdvTXeQ== endpoint: http://localhost:30257/services/RequestsDbAdapter spring: @@ -51,7 +51,7 @@ mso: db: endpoint: http://localhost:30257/services/RequestsDbAdapter po: - auth: 757A94191D685FD2092AC1490730A4FC + auth: 5E12ACACBD552A415E081E29F2C4772F9835792A51C766CCFDD7433DB5220B59969CB2798C password: 3141634BF7E070AA289CF2892C986C0B sdnc: endpoint: http://localhost:30254/adapters/SDNCAdapter diff --git a/bpmn/mso-infrastructure-bpmn/src/main/resources/application.yaml b/bpmn/mso-infrastructure-bpmn/src/main/resources/application.yaml index c1f58e9db0..c6a9f88487 100644 --- a/bpmn/mso-infrastructure-bpmn/src/main/resources/application.yaml +++ b/bpmn/mso-infrastructure-bpmn/src/main/resources/application.yaml @@ -6,14 +6,9 @@ server: spring: datasource: driver-class-name: org.mariadb.jdbc.Driver - url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/camundabpmn + jdbc-url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/camundabpmn username: ${DB_USERNAME} password: ${DB_PASSWORD} - dbcp2: - initial-size: 5 - max-total: 20 - validation-query: select 1 - test-on-borrow: true http: multipart: enabled: false |