X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bpmn%2FMSOCommonBPMN%2Fsrc%2Fmain%2Fgroovy%2Forg%2Fonap%2Fso%2Fbpmn%2Fcommon%2Fscripts%2FExceptionUtil.groovy;h=c23150384e882313cc3efd6d5a317482086fec4f;hb=5184b28f6ec1170ae035ddd749d8bdf5b2064904;hp=d95dbe2184927f0776cc1b6c7332153e44872a0c;hpb=48b34de1fd7d68f41e868a25e8817346af6ef85a;p=so.git diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExceptionUtil.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExceptionUtil.groovy index d95dbe2184..c23150384e 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExceptionUtil.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ExceptionUtil.groovy @@ -34,6 +34,7 @@ import org.camunda.bpm.engine.delegate.BpmnError import org.camunda.bpm.engine.delegate.DelegateExecution import org.onap.so.bpmn.core.WorkflowException import org.onap.so.logger.MessageEnum +import org.onap.so.utils.TargetEntities import org.slf4j.Logger import org.slf4j.LoggerFactory @@ -283,6 +284,16 @@ class ExceptionUtil extends AbstractServiceTaskProcessor { execution.setVariable("WorkflowException", exception); logger.debug("Outgoing WorkflowException is " + exception) } + + public void buildWorkflowException(DelegateExecution execution, int errorCode, String errorMessage, TargetEntities extSystemErrorSource) { + MsoUtils utils = new MsoUtils() + String processKey = getProcessKey(execution); + logger.debug("Building a WorkflowException for " + processKey) + + WorkflowException exception = new WorkflowException(processKey, errorCode, errorMessage, extSystemErrorSource); + execution.setVariable("WorkflowException", exception); + logger.debug("Outgoing WorkflowException is " + exception) + } /** * This error handling method builds a WorkflowException Object and throws a