2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Modifications Copyright (c) 2019 Samsung
8 * ================================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=========================================================
23 package org.onap.so.bpmn.vcpe.scripts
25 import org.camunda.bpm.engine.delegate.BpmnError
26 import org.camunda.bpm.engine.delegate.DelegateExecution
27 import org.onap.aai.domain.yang.AllottedResource
28 import org.onap.so.bpmn.common.scripts.*;
29 import org.onap.so.bpmn.core.RollbackData
30 import org.onap.so.bpmn.core.UrnPropertiesReader
31 import org.onap.so.bpmn.core.WorkflowException
32 import org.onap.so.bpmn.core.json.JsonUtils
33 import org.onap.so.client.aai.AAIObjectType
34 import org.onap.so.client.aai.entities.uri.AAIResourceUri
35 import org.onap.so.client.aai.entities.uri.AAIUriFactory
36 import org.onap.so.logger.MessageEnum
37 import org.onap.so.logger.MsoLogger
38 import org.slf4j.Logger
39 import org.slf4j.LoggerFactory
41 import javax.ws.rs.core.UriBuilder
42 import static org.apache.commons.lang3.StringUtils.isBlank
45 * This groovy class supports the <class>DoCreateAllottedResourceTXC.bpmn</class> process.
50 * @param - msoRequestId
51 * @param - isDEbugLogEnabled
52 * @param - disableRollback
53 * @param - failExists - O
54 * @param - serviceInstanceId
55 * @param - globalCustomerId - O
56 * @param - subscriptionServiceType - O
57 * @param - parentServiceInstanceId
58 * @param - allottedReourceId - O
59 * @param - allottedResourceModelInfo
60 * @param - allottedResourceRole
61 * @param - allottedResourceType
62 * @param - brgWanMacAddress
65 * @param - rollbackData (localRB->null)
66 * @param - rolledBack (no localRB->null, localRB F->false, localRB S->true)
67 * @param - WorkflowException - O
68 * @param - allottedResourceId
69 * @param - allottedResourceName
71 * @param - vgmuxBearerIP
75 public class DoCreateAllottedResourceTXC extends AbstractServiceTaskProcessor{
76 private static final Logger logger = LoggerFactory.getLogger(DoCreateAllottedResourceTXC.class);
78 String Prefix="DCARTXC_"
79 ExceptionUtil exceptionUtil = new ExceptionUtil()
80 JsonUtils jsonUtil = new JsonUtils()
82 public void preProcessRequest (DelegateExecution execution) {
86 logger.trace("start preProcessRequest")
89 String msoRequestId = execution.getVariable("msoRequestId")
90 logger.debug(" msoRequestId = " + msoRequestId)
92 execution.setVariable("prefix", Prefix)
95 String sdncCallbackUrl = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback",execution)
96 if (isBlank(sdncCallbackUrl)) {
97 msg = "mso.workflow.sdncadapter.callback is null"
99 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
101 execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
102 logger.debug("SDNC Callback URL: " + sdncCallbackUrl)
104 String sdncReplDelay = UrnPropertiesReader.getVariable("mso.workflow.sdnc.replication.delay",execution)
105 if (isBlank(sdncReplDelay)) {
106 msg = "mso.workflow.sdnc.replication.delay is null"
108 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
110 execution.setVariable("sdncReplDelay", sdncReplDelay)
111 logger.debug("SDNC replication delay: " + sdncReplDelay)
114 if (isBlank(execution.getVariable("serviceInstanceId"))){
115 msg = "Input serviceInstanceId is null"
117 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
119 if (isBlank(execution.getVariable("parentServiceInstanceId"))) {
120 msg = "Input parentServiceInstanceId is null"
122 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
124 if (isBlank(execution.getVariable("allottedResourceModelInfo"))) {
125 msg = "Input allottedResourceModelInfo is null"
127 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
129 if (isBlank(execution.getVariable("brgWanMacAddress"))) {
130 msg = "Input brgWanMacAddress is null"
132 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
134 if (isBlank(execution.getVariable("allottedResourceRole"))) {
135 msg = "Input allottedResourceRole is null"
137 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
139 if (isBlank(execution.getVariable("allottedResourceType"))) {
140 msg = "Input allottedResourceType is null"
142 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
145 logger.debug("Rethrowing MSOWorkflowException")
147 } catch (Exception ex){
148 msg = "Exception in preProcessRequest " + ex.getMessage()
150 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
152 logger.trace("end preProcessRequest")
155 public void getAaiAR (DelegateExecution execution) {
158 logger.trace("start getAaiAR")
160 String arType = execution.getVariable("allottedResourceType")
161 String arRole = execution.getVariable("allottedResourceRole")
163 AllottedResourceUtils arUtils = new AllottedResourceUtils(this)
164 String orchStatus = arUtils.getAROrchStatus(execution)
168 if (orchStatus != null) // AR was found
170 if ("true".equals(execution.getVariable("failExists")))
172 errorMsg = "Allotted resource " + arType + " with Role " + arRole + " already exists"
176 if ("Active".equals(orchStatus))
178 execution.setVariable("foundActiveAR", true)
180 else // blanks included
182 errorMsg = "Allotted Resource " + arType + " with Role " + arRole + " already exists in an incomplete state -" + orchStatus
186 if (!isBlank(errorMsg)) {
187 logger.debug(errorMsg)
188 exceptionUtil.buildAndThrowWorkflowException(execution, 500, errorMsg)
190 logger.trace("end getAaiAR")
193 public void createAaiAR(DelegateExecution execution) {
196 logger.trace("start createAaiAR")
198 String allottedResourceId = execution.getVariable("allottedResourceId")
199 if (isBlank(allottedResourceId))
201 allottedResourceId = UUID.randomUUID().toString()
202 execution.setVariable("allottedResourceId", allottedResourceId)
206 AAIResourceUri siResourceLink= execution.getVariable("PSI_resourceLink")
208 AAIResourceUri allottedResourceUri = AAIUriFactory.createResourceFromParentURI(siResourceLink, AAIObjectType.ALLOTTED_RESOURCE, allottedResourceId)
210 execution.setVariable("aaiARPath", allottedResourceUri.build().toString());
211 String arType = execution.getVariable("allottedResourceType")
212 String arRole = execution.getVariable("allottedResourceRole")
213 String CSI_resourceLink = execution.getVariable("CSI_resourceLink")
214 String arModelInfo = execution.getVariable("allottedResourceModelInfo")
215 logger.debug("arModelInfo is:\n" + arModelInfo)
216 String modelInvariantId = jsonUtil.getJsonValue(arModelInfo, "modelInvariantUuid")
217 String modelVersionId = jsonUtil.getJsonValue(arModelInfo, "modelUuid")
219 AllottedResource resource = new AllottedResource()
220 resource.setId(allottedResourceId)
221 resource.setType(arType)
222 resource.setRole(arRole)
223 resource.setModelInvariantId(modelInvariantId)
224 resource.setModelVersionId(modelVersionId)
225 getAAIClient().create(allottedResourceUri, resource)
226 AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceFromExistingURI(AAIObjectType.SERVICE_INSTANCE, UriBuilder.fromPath(CSI_resourceLink).build())
227 getAAIClient().connect(allottedResourceUri,serviceInstanceUri)
229 }catch (Exception ex) {
230 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "Exception in createAaiAR " + ex.getMessage())
233 //start rollback set up
234 RollbackData rollbackData = new RollbackData()
235 def disableRollback = execution.getVariable("disableRollback")
236 rollbackData.put(Prefix, "disableRollback", disableRollback.toString())
237 rollbackData.put(Prefix, "rollbackAAI", "true")
238 rollbackData.put(Prefix, "allottedResourceId", allottedResourceId)
239 rollbackData.put(Prefix, "serviceInstanceId", execution.getVariable("serviceInstanceId"))
240 rollbackData.put(Prefix, "parentServiceInstanceId", execution.getVariable("parentServiceInstanceId"))
241 execution.setVariable("rollbackData", rollbackData)
242 logger.trace("end createAaiAR")
245 public String buildSDNCRequest(DelegateExecution execution, String action, String sdncRequestId) {
249 logger.trace("start buildSDNCRequest")
250 String sdncReq = null
254 String allottedResourceId = execution.getVariable("allottedResourceId")
255 String serviceInstanceId = execution.getVariable("serviceInstanceId")
256 String globalCustomerId = execution.getVariable("globalCustomerId")
257 String subscriptionServiceType = execution.getVariable("subscriptionServiceType")
258 String parentServiceInstanceId = execution.getVariable("parentServiceInstanceId")
259 String serviceChainServiceInstanceId = execution.getVariable("serviceChainServiceInstanceId")
260 String callbackUrl = execution.getVariable("sdncCallbackUrl")
261 String requestId = execution.getVariable("msoRequestId")
263 String brgWanMacAddress = execution.getVariable("brgWanMacAddress")
265 String arModelInfo = execution.getVariable("allottedResourceModelInfo")
266 String modelInvariantId = jsonUtil.getJsonValue(arModelInfo, "modelInvariantUuid")
267 String modelVersion = jsonUtil.getJsonValue(arModelInfo, "modelVersion")
268 String modelUUId = jsonUtil.getJsonValue(arModelInfo, "modelUuid")
269 String modelCustomizationId = jsonUtil.getJsonValue(arModelInfo, "modelCustomizationUuid")
270 String modelName = jsonUtil.getJsonValue(arModelInfo, "modelName")
272 if (modelInvariantId == null) {
273 modelInvariantId = ""
275 if (modelVersion == null) {
278 if (modelUUId == null) {
281 if (modelName == null) {
284 if (modelCustomizationId == null) {
285 modelCustomizationId = ""
289 """<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5="http://org.onap/so/request/types/v1"
290 xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1"
291 xmlns:sdncadapter="http://org.onap/workflow/sdnc/adapter/schema/v1">
292 <sdncadapter:RequestHeader>
293 <sdncadapter:RequestId>${MsoUtils.xmlEscape(sdncRequestId)}</sdncadapter:RequestId>
294 <sdncadapter:SvcInstanceId>${MsoUtils.xmlEscape(serviceInstanceId)}</sdncadapter:SvcInstanceId>
295 <sdncadapter:SvcAction>${MsoUtils.xmlEscape(action)}</sdncadapter:SvcAction>
296 <sdncadapter:SvcOperation>tunnelxconn-topology-operation</sdncadapter:SvcOperation>
297 <sdncadapter:CallbackUrl>${MsoUtils.xmlEscape(callbackUrl)}</sdncadapter:CallbackUrl>
298 </sdncadapter:RequestHeader>
299 <sdncadapterworkflow:SDNCRequestData>
300 <request-information>
301 <request-id>${MsoUtils.xmlEscape(requestId)}</request-id>
302 <request-action>CreateTunnelXConnInstance</request-action>
307 </request-information>
308 <service-information>
309 <service-id></service-id>
310 <subscription-service-type>${MsoUtils.xmlEscape(subscriptionServiceType)}</subscription-service-type>
311 <onap-model-information></onap-model-information>
312 <service-instance-id>${MsoUtils.xmlEscape(serviceInstanceId)}</service-instance-id>
314 <global-customer-id>${MsoUtils.xmlEscape(globalCustomerId)}</global-customer-id>
315 </service-information>
316 <allotted-resource-information>
317 <allotted-resource-id>${MsoUtils.xmlEscape(allottedResourceId)}</allotted-resource-id>
318 <allotted-resource-type>tunnelxconn</allotted-resource-type>
319 <parent-service-instance-id>${MsoUtils.xmlEscape(parentServiceInstanceId)}</parent-service-instance-id>
320 <onap-model-information>
321 <model-invariant-uuid>${MsoUtils.xmlEscape(modelInvariantId)}</model-invariant-uuid>
322 <model-uuid>${MsoUtils.xmlEscape(modelUUId)}</model-uuid>
323 <model-customization-uuid>${MsoUtils.xmlEscape(modelCustomizationId)}</model-customization-uuid>
324 <model-version>${MsoUtils.xmlEscape(modelVersion)}</model-version>
325 <model-name>${MsoUtils.xmlEscape(modelName)}</model-name>
326 </onap-model-information>
327 </allotted-resource-information>
328 <tunnelxconn-request-input>
329 <brg-wan-mac-address>${MsoUtils.xmlEscape(brgWanMacAddress)}</brg-wan-mac-address>
330 </tunnelxconn-request-input>
331 </sdncadapterworkflow:SDNCRequestData>
332 </sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
334 logger.debug("sdncRequest:\n" + sdncReq)
335 sdncReq = utils.formatXml(sdncReq)
337 } catch(Exception ex) {
338 msg = "Exception in buildSDNCRequest. " + ex.getMessage()
340 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
342 logger.trace("end buildSDNCRequest")
346 public void preProcessSDNCAssign(DelegateExecution execution) {
350 logger.trace("start preProcessSDNCAssign")
353 String sdncRequestId = UUID.randomUUID().toString()
354 String sdncAssignReq = buildSDNCRequest(execution, "assign", sdncRequestId)
355 execution.setVariable("sdncAssignRequest", sdncAssignReq)
356 logger.debug("sdncAssignRequest: " + sdncAssignReq)
357 def sdncRequestId2 = UUID.randomUUID().toString()
358 String sdncAssignRollbackReq = sdncAssignReq.replace(">assign<", ">unassign<").replace(">CreateTunnelXConnInstance<", ">DeleteTunnelXConnInstance<").replace(">${sdncRequestId}<", ">${sdncRequestId2}<")
359 def rollbackData = execution.getVariable("rollbackData")
360 rollbackData.put(Prefix, "sdncAssignRollbackReq", sdncAssignRollbackReq)
361 execution.setVariable("rollbackData", rollbackData)
363 logger.debug("sdncAssignRollbackReq:\n" + sdncAssignRollbackReq)
364 logger.debug("rollbackData:\n" + rollbackData.toString())
366 } catch (BpmnError e) {
368 } catch(Exception ex) {
369 msg = "Exception in preProcessSDNCAssign. " + ex.getMessage()
371 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
373 logger.debug("end preProcessSDNCAssign")
376 public void preProcessSDNCCreate(DelegateExecution execution) {
380 logger.trace("start preProcessSDNCCreate")
383 String sdncRequestId = UUID.randomUUID().toString()
384 String sdncCreateReq = buildSDNCRequest(execution, "create", sdncRequestId)
385 execution.setVariable("sdncCreateRequest", sdncCreateReq)
386 logger.debug("sdncCreateReq: " + sdncCreateReq)
387 def sdncRequestId2 = UUID.randomUUID().toString()
388 String sdncCreateRollbackReq = sdncCreateReq.replace(">create<", ">delete<").replace(">CreateTunnelXConnInstance<", ">DeleteTunnelXConnInstance<").replace(">${sdncRequestId}<", ">${sdncRequestId2}<")
389 def rollbackData = execution.getVariable("rollbackData")
390 rollbackData.put(Prefix, "sdncCreateRollbackReq", sdncCreateRollbackReq)
391 execution.setVariable("rollbackData", rollbackData)
393 logger.debug("sdncCreateRollbackReq:\n" + sdncCreateRollbackReq)
394 logger.debug("rollbackData:\n" + rollbackData.toString())
396 } catch (BpmnError e) {
398 } catch(Exception ex) {
399 msg = "Exception in preProcessSDNCCreate. " + ex.getMessage()
401 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
403 logger.trace("end preProcessSDNCCreate")
406 public void preProcessSDNCActivate(DelegateExecution execution) {
410 logger.trace("start preProcessSDNCActivate")
413 String sdncRequestId = UUID.randomUUID().toString()
414 String sdncActivateReq = buildSDNCRequest(execution, "activate", sdncRequestId)
415 execution.setVariable("sdncActivateRequest", sdncActivateReq)
416 logger.debug("sdncActivateReq: " + sdncActivateReq)
417 def sdncRequestId2 = UUID.randomUUID().toString()
418 String sdncActivateRollbackReq = sdncActivateReq.replace(">activate<", ">deactivate<").replace(">CreateTunnelXConnInstance<", ">DeleteTunnelXConnInstance<").replace(">${sdncRequestId}<", ">${sdncRequestId2}<")
419 def rollbackData = execution.getVariable("rollbackData")
420 rollbackData.put(Prefix, "sdncActivateRollbackReq", sdncActivateRollbackReq)
421 execution.setVariable("rollbackData", rollbackData)
423 logger.debug("sdncActivateRollbackReq:\n" + sdncActivateRollbackReq)
424 logger.debug("rollbackData:\n" + rollbackData.toString())
426 } catch (BpmnError e) {
428 } catch(Exception ex) {
429 msg = "Exception in preProcessSDNCActivate. " + ex.getMessage()
431 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
433 logger.trace("end preProcessSDNCActivate")
436 public void validateSDNCResp(DelegateExecution execution, String response, String method){
439 logger.trace("start ValidateSDNCResponse Process")
443 WorkflowException workflowException = execution.getVariable("WorkflowException")
444 logger.debug("workflowException: " + workflowException)
446 boolean successIndicator = execution.getVariable("SDNCA_SuccessIndicator")
447 logger.debug("SDNCResponse: " + response)
449 SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils(this)
450 sdncAdapterUtils.validateSDNCResponse(execution, response, workflowException, successIndicator)
452 if(execution.getVariable(Prefix + 'sdncResponseSuccess') == true){
453 logger.debug("Received a Good Response from SDNC Adapter for " + method + " SDNC Call. Response is: \n" + response)
455 if (!"get".equals(method))
457 def rollbackData = execution.getVariable("rollbackData")
458 rollbackData.put(Prefix, "rollback" + "SDNC" + method, "true")
459 execution.setVariable("rollbackData", rollbackData)
463 logger.debug("Received a BAD Response from SDNC Adapter for " + method + " SDNC Call.")
464 throw new BpmnError("MSOWorkflowException")
466 } catch (BpmnError e) {
468 } catch(Exception ex) {
469 msg = "Exception in validateSDNCResp. " + ex.getMessage()
471 exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
473 logger.trace("end ValidateSDNCResp Process")
476 public void preProcessSDNCGet(DelegateExecution execution){
478 logger.trace("start preProcessSDNCGet")
481 def callbackUrl = execution.getVariable("sdncCallbackUrl")
482 // serviceOperation (URI for topology GET) will be retrieved from "selflink" from AAI if active AR exists in AAI
483 // or from "object-path" in SDNC response for assign when AR does not exist in AA
485 String serviceOperation = ""
487 if (execution.getVariable("foundActiveAR")) {
488 def aaiQueryResponse = execution.getVariable("aaiARGetResponse")
489 serviceOperation = utils.getNodeText(aaiQueryResponse, "selflink")
490 logger.debug("AR service operation/aaiARSelfLink: " + serviceOperation)
494 String response = execution.getVariable("sdncAssignResponse")
495 String data = utils.getNodeXml(response, "response-data")
496 logger.debug("Assign responseData: " + data)
497 serviceOperation = utils.getNodeText(data, "object-path")
498 logger.debug("AR service operation:" + serviceOperation)
501 String serviceInstanceId = execution.getVariable("serviceInstanceId")
502 String sdncRequestId = UUID.randomUUID().toString()
504 //neeed the same url as used by vfmodules
505 String SDNCGetRequest =
506 """<sdncadapterworkflow:SDNCAdapterWorkflowRequest xmlns:ns5="http://org.onap/so/request/types/v1"
507 xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1"
508 xmlns:sdncadapter="http://org.onap/workflow/sdnc/adapter/schema/v1">
509 <sdncadapter:RequestHeader>
510 <sdncadapter:RequestId>${MsoUtils.xmlEscape(sdncRequestId)}</sdncadapter:RequestId>
511 <sdncadapter:SvcInstanceId>${MsoUtils.xmlEscape(serviceInstanceId)}</sdncadapter:SvcInstanceId>
512 <sdncadapter:SvcAction>query</sdncadapter:SvcAction>
513 <sdncadapter:SvcOperation>${MsoUtils.xmlEscape(serviceOperation)}</sdncadapter:SvcOperation>
514 <sdncadapter:CallbackUrl>${MsoUtils.xmlEscape(callbackUrl)}</sdncadapter:CallbackUrl>
515 <sdncadapter:MsoAction>vfmodule</sdncadapter:MsoAction>
516 </sdncadapter:RequestHeader>
517 <sdncadapterworkflow:SDNCRequestData></sdncadapterworkflow:SDNCRequestData>
518 </sdncadapterworkflow:SDNCAdapterWorkflowRequest>"""
520 execution.setVariable("sdncGetRequest", SDNCGetRequest)
523 logger.error("{} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
524 "Exception Occurred Processing preProcessSDNCGetRequest.", "BPMN",
525 MsoLogger.ErrorCode.UnknownError.getValue(), "Exception is:\n" + e);
526 exceptionUtil.buildAndThrowWorkflowException(execution, 1002, "Error Occured during SDNC GET Method:\n" + e.getMessage())
528 logger.trace("end preProcessSDNCGet")
531 public void updateAaiAROrchStatus(DelegateExecution execution, String status){
533 logger.trace("start updateAaiAROrchStatus")
534 String aaiARPath = execution.getVariable("aaiARPath") //set during query (existing AR) or create
535 AllottedResourceUtils arUtils = new AllottedResourceUtils(this)
536 String orchStatus = arUtils.updateAROrchStatus(execution, status, aaiARPath)
537 logger.trace("end updateAaiAROrchStatus")
540 public void generateOutputs(DelegateExecution execution)
543 logger.trace("start generateOutputs")
545 String sdncGetResponse = execution.getVariable("enhancedCallbackRequestData") //unescaped
546 logger.debug("resp:" + sdncGetResponse)
547 String arData = utils.getNodeXml(sdncGetResponse, "tunnelxconn-topology")
548 arData = utils.removeXmlNamespaces(arData)
550 String txca = utils.getNodeXml(arData, "tunnelxconn-assignments")
551 execution.setVariable("vni", utils.getNodeText(txca, "vni"))
552 execution.setVariable("vgmuxBearerIP", utils.getNodeText(txca, "vgmux-bearer-ip"))
553 execution.setVariable("vgmuxLanIP", utils.getNodeText(txca, "vgmux-lan-ip"))
555 String ari = utils.getNodeXml(arData, "allotted-resource-identifiers")
556 execution.setVariable("allotedResourceName", utils.getNodeText(ari, "allotted-resource-name"))
557 } catch (BpmnError e) {
558 logger.debug("BPMN Error in generateOutputs ")
559 } catch(Exception ex) {
560 String msg = "Exception in generateOutputs " + ex.getMessage()
563 logger.trace("end generateOutputs")
567 public void preProcessRollback (DelegateExecution execution) {
569 logger.trace("start preProcessRollback")
572 Object workflowException = execution.getVariable("WorkflowException");
574 if (workflowException instanceof WorkflowException) {
575 logger.debug("Prev workflowException: " + workflowException.getErrorMessage())
576 execution.setVariable("prevWorkflowException", workflowException);
577 //execution.setVariable("WorkflowException", null);
579 } catch (BpmnError e) {
580 logger.debug("BPMN Error during preProcessRollback")
581 } catch(Exception ex) {
582 String msg = "Exception in preProcessRollback. " + ex.getMessage()
585 logger.trace("end preProcessRollback")
588 public void postProcessRollback (DelegateExecution execution) {
590 logger.trace("start postProcessRollback")
593 Object workflowException = execution.getVariable("prevWorkflowException");
594 if (workflowException instanceof WorkflowException) {
595 logger.debug("Setting prevException to WorkflowException: ")
596 execution.setVariable("WorkflowException", workflowException);
598 execution.setVariable("rollbackData", null)
599 } catch (BpmnError b) {
600 logger.debug("BPMN Error during postProcessRollback")
602 } catch(Exception ex) {
603 msg = "Exception in postProcessRollback. " + ex.getMessage()
606 logger.trace("end postProcessRollback")