From: Benjamin, Max (mb388a) Date: Wed, 31 Jul 2019 15:03:06 +0000 (-0400) Subject: added back missing method in groovy file X-Git-Tag: 1.5.2~154 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F70%2F92370%2F1;p=so.git 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) --- 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