ebd622ca51ee3873c54d42c5f0172d1f8f00a4ff
[so.git] / bpmn / so-bpmn-infrastructure-common / src / main / groovy / org / onap / so / bpmn / infrastructure / scripts / DoCreateE2EServiceInstance.groovy
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  */
21 package org.onap.so.bpmn.infrastructure.scripts;
22
23 import static org.apache.commons.lang3.StringUtils.*;
24
25 import javax.ws.rs.NotFoundException
26
27 import org.apache.commons.lang3.*
28 import org.camunda.bpm.engine.delegate.BpmnError
29 import org.camunda.bpm.engine.delegate.DelegateExecution
30 import org.onap.aai.domain.yang.ServiceInstance
31 import org.onap.so.bpmn.common.scripts.AaiUtil
32 import org.onap.so.bpmn.common.scripts.AbstractServiceTaskProcessor
33 import org.onap.so.bpmn.common.scripts.CatalogDbUtils;
34 import org.onap.so.bpmn.common.scripts.ExceptionUtil
35 import org.onap.so.bpmn.common.scripts.MsoUtils
36 import org.onap.so.bpmn.core.RollbackData
37 import org.onap.so.bpmn.core.WorkflowException
38 import org.onap.so.bpmn.core.domain.Resource
39 import org.onap.so.bpmn.core.domain.ServiceDecomposition
40 import org.onap.so.bpmn.core.json.JsonUtils
41 import org.onap.so.client.aai.AAIObjectType
42 import org.onap.so.client.aai.AAIResourcesClient
43 import org.onap.so.client.aai.entities.AAIResultWrapper
44 import org.onap.so.client.aai.entities.uri.AAIResourceUri
45 import org.onap.so.bpmn.infrastructure.workflow.service.ServicePluginFactory
46 import org.onap.so.client.aai.entities.uri.AAIUriFactory
47 import org.onap.so.logger.MessageEnum
48 import org.onap.so.logger.MsoLogger
49 import org.onap.so.rest.APIResponse
50 import org.springframework.web.util.UriUtils
51 import org.onap.so.bpmn.core.UrnPropertiesReader
52
53 import groovy.json.*
54
55
56
57 /**
58  * This groovy class supports the <class>DoCreateServiceInstance.bpmn</class> process.
59  *
60  * Inputs:
61  * @param - msoRequestId
62  * @param - globalSubscriberId
63  * @param - subscriptionServiceType
64  * @param - serviceInstanceId
65  * @param - serviceInstanceName - O
66  * @param - serviceModelInfo
67  * @param - productFamilyId
68  * @param - disableRollback
69  * @param - failExists - TODO
70  * @param - serviceInputParams (should contain aic_zone for serviceTypes TRANSPORT,ATM)
71  * @param - sdncVersion ("1610")
72  * @param - serviceDecomposition - Decomposition for R1710
73  * (if macro provides serviceDecompsition then serviceModelInfo, serviceInstanceId & serviceInstanceName will be ignored)
74  *
75  * Outputs:
76  * @param - rollbackData (localRB->null)
77  * @param - rolledBack (no localRB->null, localRB F->false, localRB S->true)
78  * @param - WorkflowException
79  * @param - serviceInstanceName - (GET from AAI if null in input)
80  *
81  */
82 public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor {
83         private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, DoCreateE2EServiceInstance.class);
84
85
86         String Prefix="DCRESI_"
87         ExceptionUtil exceptionUtil = new ExceptionUtil()
88         JsonUtils jsonUtil = new JsonUtils()
89         CatalogDbUtils cutils = new CatalogDbUtils()
90
91         public void preProcessRequest (DelegateExecution execution) {
92                 String msg = ""
93                 msoLogger.trace("preProcessRequest ")
94
95                 try {
96                         execution.setVariable("prefix", Prefix)
97                         //Inputs
98                         //requestDetails.subscriberInfo. for AAI GET & PUT & SDNC assignToplology
99                         String globalSubscriberId = execution.getVariable("globalSubscriberId") //globalCustomerId
100                         msoLogger.info(" ***** globalSubscriberId *****" + globalSubscriberId)
101                         //requestDetails.requestParameters. for AAI PUT & SDNC assignTopology
102                         String serviceType = execution.getVariable("serviceType")
103                         msoLogger.info(" ***** serviceType *****" + serviceType)
104                         //requestDetails.requestParameters. for SDNC assignTopology
105                         String productFamilyId = execution.getVariable("productFamilyId") //AAI productFamilyId
106
107                         if (isBlank(globalSubscriberId)) {
108                                 msg = "Input globalSubscriberId is null"
109                                 msoLogger.info(msg)
110                                 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
111                         }
112
113                         if (isBlank(serviceType)) {
114                                 msg = "Input serviceType is null"
115                                 msoLogger.info(msg)
116                                 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
117                         }
118
119                         if (productFamilyId == null) {
120                                 execution.setVariable("productFamilyId", "")
121                         }
122
123                         String sdncCallbackUrl = UrnPropertiesReader.getVariable("mso.workflow.sdncadapter.callback", execution)
124                         if (isBlank(sdncCallbackUrl)) {
125                                 msg = "URN_mso_workflow_sdncadapter_callback is null"
126                                 msoLogger.info(msg)
127                                 exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)
128                         }
129                         execution.setVariable("sdncCallbackUrl", sdncCallbackUrl)
130                         msoLogger.info("SDNC Callback URL: " + sdncCallbackUrl)
131
132                         //requestDetails.modelInfo.for AAI PUT servieInstanceData
133                         //requestDetails.requestInfo. for AAI GET/PUT serviceInstanceData
134                         String serviceInstanceName = execution.getVariable("serviceInstanceName")
135                         String serviceInstanceId = execution.getVariable("serviceInstanceId")
136                         String uuiRequest = execution.getVariable("uuiRequest")
137                         String modelInvariantUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceInvariantUuid")
138                         String modelUuid = jsonUtil.getJsonValue(uuiRequest, "service.serviceUuid")
139                         String serviceModelName = jsonUtil.getJsonValue(uuiRequest, "service.parameters.templateName")
140                         execution.setVariable("serviceModelName", serviceModelName)
141                         //aai serviceType and Role can be setted as fixed value now.
142                         String aaiServiceType = "E2E Service"
143                         String aaiServiceRole = "E2E Service"
144
145                         execution.setVariable("modelInvariantUuid", modelInvariantUuid)
146                         execution.setVariable("modelUuid", modelUuid)
147
148                         //AAI PUT
149                         String oStatus = execution.getVariable("initialStatus") ?: ""
150                         if ("TRANSPORT".equalsIgnoreCase(serviceType))
151                         {
152                                 oStatus = "Created"
153                         }
154
155                         org.onap.aai.domain.yang.ServiceInstance si = new org.onap.aai.domain.yang.ServiceInstance()
156                         si.setServiceInstanceName(serviceInstanceName)
157                         si.setServiceType(aaiServiceType)
158                         si.setServiceRole(aaiServiceRole)
159                         si.setOrchestrationStatus(oStatus)
160                         si.setModelInvariantId(modelInvariantUuid)
161                         si.setModelVersionId(modelUuid)
162                         si.setInputParameters(uuiRequest)
163                         execution.setVariable("serviceInstanceData", si)
164
165                 } catch (BpmnError e) {
166                         throw e;
167                 } catch (Exception ex){
168                         msg = "Exception in preProcessRequest " + ex.getMessage()
169                         msoLogger.info(msg)
170                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
171                 }
172                 msoLogger.trace("Exit preProcessRequest ")
173         }
174
175    public void prepareDecomposeService(DelegateExecution execution) {
176         try {
177             msoLogger.trace("Inside prepareDecomposeService of create generic e2e service ")
178             String modelInvariantUuid = execution.getVariable("modelInvariantUuid")
179             String modelUuid = execution.getVariable("modelUuid")
180             //here modelVersion is not set, we use modelUuid to decompose the service.
181             String serviceModelInfo = """{
182             "modelInvariantUuid":"${modelInvariantUuid}",
183             "modelUuid":"${modelUuid}",
184             "modelVersion":""
185              }"""
186             execution.setVariable("serviceModelInfo", serviceModelInfo)
187
188             msoLogger.trace("Completed prepareDecomposeService of  create generic e2e service ")
189         } catch (Exception ex) {
190             // try error in method block
191             String exceptionMessage = "Bpmn error encountered in  create generic e2e service flow. Unexpected Error from method prepareDecomposeService() - " + ex.getMessage()
192             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
193         }
194      }
195
196     public void processDecomposition(DelegateExecution execution) {
197         msoLogger.trace("Inside processDecomposition() of  create generic e2e service flow ")
198         try {
199             ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
200         } catch (Exception ex) {
201             String exceptionMessage = "Bpmn error encountered in  create generic e2e service flow. processDecomposition() - " + ex.getMessage()
202             msoLogger.debug(exceptionMessage)
203             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
204         }
205     }
206
207     public void doServicePreOperation(DelegateExecution execution){
208        //we need a service plugin platform here.
209         ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
210         String uuiRequest = execution.getVariable("uuiRequest")
211         String newUuiRequest = ServicePluginFactory.getInstance().preProcessService(serviceDecomposition, uuiRequest);
212         execution.setVariable("uuiRequest", newUuiRequest)
213     }
214
215     public void doServiceHoming(DelegateExecution execution) {
216         //we need a service plugin platform here.
217         ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
218         String uuiRequest = execution.getVariable("uuiRequest")
219         String newUuiRequest = ServicePluginFactory.getInstance().doServiceHoming(serviceDecomposition, uuiRequest);
220         execution.setVariable("uuiRequest", newUuiRequest)
221     }
222
223         public void postProcessAAIGET(DelegateExecution execution) {
224                 msoLogger.trace("postProcessAAIGET ")
225                 String msg = ""
226
227                 try {
228                         String serviceInstanceName = execution.getVariable("serviceInstanceName")
229                         boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
230                         if(!succInAAI){
231                                 msoLogger.info("Error getting Service-instance from AAI", + serviceInstanceName)
232                                 WorkflowException workflowException = execution.getVariable("WorkflowException")
233                                 msoLogger.debug("workflowException: " + workflowException)
234                                 if(workflowException != null){
235                                         exceptionUtil.buildAndThrowWorkflowException(execution, workflowException.getErrorCode(), workflowException.getErrorMessage())
236                                 }
237                                 else
238                                 {
239                                         msg = "Failure in postProcessAAIGET GENGS_SuccessIndicator:" + succInAAI
240                                         msoLogger.info(msg)
241                                         exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)
242                                 }
243                         }
244                         else
245                         {
246                                 boolean foundInAAI = execution.getVariable("GENGS_FoundIndicator")
247                                 if(foundInAAI){
248                                         msoLogger.info("Found Service-instance in AAI")
249                                         msg = "ServiceInstance already exists in AAI:" + serviceInstanceName
250                                         msoLogger.info(msg)
251                                         exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)
252                                 }
253                         }
254                 } catch (BpmnError e) {
255                         throw e;
256                 } catch (Exception ex) {
257                         msg = "Exception in DoCreateServiceInstance.postProcessAAIGET. " + ex.getMessage()
258                         msoLogger.info(msg)
259                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
260                 }
261                 msoLogger.trace("Exit postProcessAAIGET ")
262         }
263
264         //TODO use create if not exist
265         public void createServiceInstance(DelegateExecution execution) {
266                 msoLogger.trace("createServiceInstance ")
267                 String msg = ""
268                 String serviceInstanceId = UUID.randomUUID().toString()
269                 try {
270                         org.onap.aai.domain.yang.ServiceInstance si = execution.getVariable("serviceInstanceData")
271
272                         AAIResourcesClient client = new AAIResourcesClient()
273                         AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, execution.getVariable("globalSubscriberId"), execution.getVariable("serviceType"), serviceInstanceId)
274                         client.create(uri, si)
275
276                 } catch (BpmnError e) {
277                         throw e;
278                 } catch (Exception ex) {
279                         //start rollback set up
280                         RollbackData rollbackData = new RollbackData()
281                         def disableRollback = execution.getVariable("disableRollback")
282                         rollbackData.put("SERVICEINSTANCE", "disableRollback", disableRollback.toString())
283                         rollbackData.put("SERVICEINSTANCE", "rollbackAAI", "true")
284                         rollbackData.put("SERVICEINSTANCE", "serviceInstanceId", serviceInstanceId)
285                         rollbackData.put("SERVICEINSTANCE", "subscriptionServiceType", execution.getVariable("subscriptionServiceType"))
286                         rollbackData.put("SERVICEINSTANCE", "globalSubscriberId", execution.getVariable("globalSubscriberId"))
287                         execution.setVariable("rollbackData", rollbackData)
288
289                         msg = "Exception in DoCreateServiceInstance.createServiceInstance. " + ex.getMessage()
290                         msoLogger.info(msg)
291                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
292                 }
293                 msoLogger.trace("Exit createServiceInstance ")
294         }
295
296         /**
297          * Gets the service instance and its relationships from aai
298          */
299         public void getServiceInstance(DelegateExecution execution) {
300                 try {
301                         String serviceInstanceId = execution.getVariable('serviceInstanceId')
302                         String globalSubscriberId = execution.getVariable('globalSubscriberId')
303                         String serviceType = execution.getVariable('subscriptionServiceType')
304
305                         AAIResourcesClient resourceClient = new AAIResourcesClient()
306                         AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalSubscriberId, serviceType, serviceInstanceId)
307                         AAIResultWrapper wrapper = resourceClient.get(serviceInstanceUri, NotFoundException.class)
308
309                         Optional<ServiceInstance> si = wrapper.asBean(ServiceInstance.class)
310                         execution.setVariable("serviceInstanceName", si.get().getServiceInstanceName())
311
312                 }catch(BpmnError e) {
313                         throw e;
314                 }catch(Exception ex) {
315                         String msg = "Internal Error in getServiceInstance: " + ex.getMessage()
316                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
317                 }
318         }
319
320         public void postProcessAAIGET2(DelegateExecution execution) {
321                 msoLogger.trace("postProcessAAIGET2 ")
322                 String msg = ""
323
324                 try {
325                         String serviceInstanceName = execution.getVariable("serviceInstanceName")
326                         boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
327                         if(!succInAAI){
328                                 msoLogger.info("Error getting Service-instance from AAI in postProcessAAIGET2", + serviceInstanceName)
329                                 WorkflowException workflowException = execution.getVariable("WorkflowException")
330                                 msoLogger.debug("workflowException: " + workflowException)
331                                 if(workflowException != null){
332                                         exceptionUtil.buildAndThrowWorkflowException(execution, workflowException.getErrorCode(), workflowException.getErrorMessage())
333                                 }
334                                 else
335                                 {
336                                         msg = "Failure in postProcessAAIGET2 GENGS_SuccessIndicator:" + succInAAI
337                                         msoLogger.info(msg)
338                                         exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)
339                                 }
340                         }
341                         else
342                         {
343                                 boolean foundInAAI = execution.getVariable("GENGS_FoundIndicator")
344                                 if(foundInAAI){
345                                         String aaiService = execution.getVariable("GENGS_service")
346                                         if (!isBlank(aaiService) && (utils.nodeExists(aaiService, "service-instance-name"))) {
347                                                 execution.setVariable("serviceInstanceName",  utils.getNodeText(aaiService, "service-instance-name"))
348                                                 msoLogger.info("Found Service-instance in AAI.serviceInstanceName:" + execution.getVariable("serviceInstanceName"))
349                                         }
350                                 }
351                         }
352                 } catch (BpmnError e) {
353                         throw e;
354                 } catch (Exception ex) {
355                         msg = "Exception in DoCreateServiceInstance.postProcessAAIGET2 " + ex.getMessage()
356                         msoLogger.info(msg)
357                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
358                 }
359                 msoLogger.trace("Exit postProcessAAIGET2 ")
360         }
361
362         public void preProcessRollback (DelegateExecution execution) {
363                 msoLogger.trace("preProcessRollback ")
364                 try {
365
366                         Object workflowException = execution.getVariable("WorkflowException");
367
368                         if (workflowException instanceof WorkflowException) {
369                                 msoLogger.info("Prev workflowException: " + workflowException.getErrorMessage())
370                                 execution.setVariable("prevWorkflowException", workflowException);
371                                 //execution.setVariable("WorkflowException", null);
372                         }
373                 } catch (BpmnError e) {
374                         msoLogger.info("BPMN Error during preProcessRollback")
375                 } catch(Exception ex) {
376                         String msg = "Exception in preProcessRollback. " + ex.getMessage()
377                         msoLogger.info(msg)
378                 }
379                 msoLogger.trace("Exit preProcessRollback ")
380         }
381
382         public void postProcessRollback (DelegateExecution execution) {
383                 msoLogger.trace("postProcessRollback ")
384                 String msg = ""
385                 try {
386                         Object workflowException = execution.getVariable("prevWorkflowException");
387                         if (workflowException instanceof WorkflowException) {
388                                 msoLogger.info("Setting prevException to WorkflowException: ")
389                                 execution.setVariable("WorkflowException", workflowException);
390                         }
391                         execution.setVariable("rollbackData", null)
392                 } catch (BpmnError b) {
393                         msoLogger.info("BPMN Error during postProcessRollback")
394                         throw b;
395                 } catch(Exception ex) {
396                         msg = "Exception in postProcessRollback. " + ex.getMessage()
397                         msoLogger.info(msg)
398                 }
399                 msoLogger.trace("Exit postProcessRollback ")
400         }
401
402         public void preInitResourcesOperStatus(DelegateExecution execution){
403         msoLogger.trace("STARTED preInitResourcesOperStatus Process ")
404         try{
405             String serviceId = execution.getVariable("serviceInstanceId")
406             String operationId = execution.getVariable("operationId")
407             String operationType = execution.getVariable("operationType")
408             String resourceTemplateUUIDs = ""
409             String result = "processing"
410             String progress = "0"
411             String reason = ""
412             String operationContent = "Prepare service creation"
413             msoLogger.info("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + operationType)
414             serviceId = UriUtils.encode(serviceId,"UTF-8")
415             execution.setVariable("serviceInstanceId", serviceId)
416             execution.setVariable("operationId", operationId)
417             execution.setVariable("operationType", operationType)
418             ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
419             List<Resource>  resourceList = serviceDecomposition.getServiceResources()
420
421             for(Resource resource : resourceList){
422                     resourceTemplateUUIDs  = resourceTemplateUUIDs + resource.getModelInfo().getModelCustomizationUuid() + ":"
423             }
424
425             def dbAdapterEndpoint = UrnPropertiesReader.getVariable("mso.adapters.db.endpoint")
426             execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
427             msoLogger.info("DB Adapter Endpoint is: " + dbAdapterEndpoint)
428
429             String payload =
430                 """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
431                         xmlns:ns="http://org.onap.so/requestsdb">
432                         <soapenv:Header/>
433                         <soapenv:Body>
434                             <ns:initResourceOperationStatus xmlns:ns="http://org.onap.so/requestsdb">
435                                                                 <serviceId>${MsoUtils.xmlEscape(serviceId)}</serviceId>
436                                                                 <operationId>${MsoUtils.xmlEscape(operationId)}</operationId>
437                                                                 <operationType>${MsoUtils.xmlEscape(operationType)}</operationType>
438                                                                 <resourceTemplateUUIDs>${MsoUtils.xmlEscape(resourceTemplateUUIDs)}</resourceTemplateUUIDs>
439                             </ns:initResourceOperationStatus>
440                         </soapenv:Body>
441                         </soapenv:Envelope>"""
442
443             payload = utils.formatXml(payload)
444             execution.setVariable("CVFMI_initResOperStatusRequest", payload)
445             msoLogger.info("Outgoing initResourceOperationStatus: \n" + payload)
446             msoLogger.debug("CreateVfModuleInfra Outgoing initResourceOperationStatus Request: " + payload)
447
448         }catch(Exception e){
449             msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preInitResourcesOperStatus.", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e);
450             execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preInitResourcesOperStatus Method:\n" + e.getMessage())
451         }
452         msoLogger.trace("COMPLETED preInitResourcesOperStatus Process ")
453         }
454
455         // if site location is in local Operator, create all resources in local ONAP;
456         // if site location is in 3rd Operator, only process sp-partner to create all resources in 3rd ONAP
457         public void doProcessSiteLocation(DelegateExecution execution){
458                 msoLogger.trace("======== Start doProcessSiteLocation Process ======== ")
459                 ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
460                 String uuiRequest = execution.getVariable("uuiRequest")
461                 uuiRequest = ServicePluginFactory.getInstance().doProcessSiteLocation(serviceDecomposition, uuiRequest);
462                 execution.setVariable("uuiRequest", uuiRequest)
463                 execution.setVariable("serviceDecomposition", serviceDecomposition)
464                 
465                 msoLogger.trace("======== COMPLETED doProcessSiteLocation Process ======== ")
466         }
467         
468         // Allocate cross link TPs(terminal points) for sotn network only
469         public void doTPResourcesAllocation(DelegateExecution execution){
470                 msoLogger.trace("======== Start doTPResourcesAllocation Process ======== ")
471                 ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
472                 String uuiRequest = execution.getVariable("uuiRequest")
473                 uuiRequest = ServicePluginFactory.getInstance().doTPResourcesAllocation(execution, uuiRequest);
474                 execution.setVariable("uuiRequest", uuiRequest)
475                 msoLogger.trace("======== COMPLETED doTPResourcesAllocation Process ======== ")
476         }
477
478         // prepare input param for using DoCreateResources.bpmn
479         public void preProcessForAddResource(DelegateExecution execution) {
480                 msoLogger.trace("STARTED preProcessForAddResource Process ")
481
482                 ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
483                 List<Resource> addResourceList = serviceDecomposition.getServiceResources()
484                 execution.setVariable("addResourceList", addResourceList)
485
486                 msoLogger.trace("COMPLETED preProcessForAddResource Process ")
487         }
488
489         public void postProcessForAddResource(DelegateExecution execution) {
490                 // do nothing now
491
492         }
493
494 }