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