added back missing method in groovy file 70/92370/1
authorBenjamin, Max (mb388a) <mb388a@att.com>
Wed, 31 Jul 2019 15:03:06 +0000 (11:03 -0400)
committerBenjamin, Max (mb388a) <mb388a@att.com>
Wed, 31 Jul 2019 15:04:21 +0000 (11:04 -0400)
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) <mb388a@att.com>
bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy

index 4670b11..976ad14 100644 (file)
@@ -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