From 4a2ac263b3a8a0f4116f659f8c02fe255bdc41aa Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Wed, 31 Jul 2019 11:03:06 -0400 Subject: added back missing method in groovy file Need to bring back AbstractTaskProcessor.logWorkflowException() method because this is being called from a number of groovy files. Issue-ID: SO-2172 Change-Id: Id5dee85fcb48265955dde3d74f7c0f98300410f0 Signed-off-by: Benjamin, Max (mb388a) --- .../common/scripts/AbstractServiceTaskProcessor.groovy | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy index 4670b11b71..976ad1466d 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy @@ -44,6 +44,20 @@ public abstract class AbstractServiceTaskProcessor implements ServiceTaskProcess public MsoUtils utils = new MsoUtils() + /** + * Logs a WorkflowException at the ERROR level with the specified message. + * @param execution the execution + */ + public void logWorkflowException(DelegateExecution execution, String message) { + def workflowException = execution.getVariable("WorkflowException") + + if (workflowException == null) { + logger.error(message); + } else { + logger.error('{}: {}', message, workflowException) + } + } + /** * Saves the WorkflowException in the execution to the specified variable, * clearing the WorkflowException variable so the workflow can continue -- cgit