b6a02f29e7529a5bcb550135853c6ff9a10e0c8a
[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                         String statusLine = isBlank(oStatus) ? "" : "<orchestration-status>${MsoUtils.xmlEscape(oStatus)}</orchestration-status>"
156
157                         AaiUtil aaiUriUtil = new AaiUtil(this)
158                         String aai_uri = aaiUriUtil.getBusinessCustomerUri(execution)
159                         String namespace = aaiUriUtil.getNamespaceFromUri(aai_uri)
160                         String serviceInstanceData =
161                                         """<service-instance xmlns=\"${namespace}\">
162                                 <service-instance-id>${MsoUtils.xmlEscape(serviceInstanceId)}</service-instance-id>
163                                 <service-instance-name>${MsoUtils.xmlEscape(serviceInstanceName)}</service-instance-name>
164                                         <service-type>${MsoUtils.xmlEscape(aaiServiceType)}</service-type>
165                                         <service-role>${MsoUtils.xmlEscape(aaiServiceRole)}</service-role>
166                                         ${statusLine}
167                                     <model-invariant-id>${MsoUtils.xmlEscape(modelInvariantUuid)}</model-invariant-id>
168                                     <model-version-id>${MsoUtils.xmlEscape(modelUuid)}</model-version-id>
169                                     <input-parameters>${MsoUtils.xmlEscape(uuiRequest)}</input-parameters>
170                                         </service-instance>""".trim()
171                         execution.setVariable("serviceInstanceData", serviceInstanceData)
172                         msoLogger.debug(serviceInstanceData)
173                         msoLogger.info(" aai_uri " + aai_uri + " namespace:" + namespace)
174                         msoLogger.info(" 'payload' to create Service Instance in AAI - " + "\n" + serviceInstanceData)
175
176                 } catch (BpmnError e) {
177                         throw e;
178                 } catch (Exception ex){
179                         msg = "Exception in preProcessRequest " + ex.getMessage()
180                         msoLogger.info(msg)
181                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
182                 }
183                 msoLogger.trace("Exit preProcessRequest ")
184         }
185
186    public void prepareDecomposeService(DelegateExecution execution) {
187         try {
188             msoLogger.trace("Inside prepareDecomposeService of create generic e2e service ")
189             String modelInvariantUuid = execution.getVariable("modelInvariantUuid")
190             String modelUuid = execution.getVariable("modelUuid")
191             //here modelVersion is not set, we use modelUuid to decompose the service.
192             String serviceModelInfo = """{
193             "modelInvariantUuid":"${modelInvariantUuid}",
194             "modelUuid":"${modelUuid}",
195             "modelVersion":""
196              }"""
197             execution.setVariable("serviceModelInfo", serviceModelInfo)
198
199             msoLogger.trace("Completed prepareDecomposeService of  create generic e2e service ")
200         } catch (Exception ex) {
201             // try error in method block
202             String exceptionMessage = "Bpmn error encountered in  create generic e2e service flow. Unexpected Error from method prepareDecomposeService() - " + ex.getMessage()
203             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
204         }
205      }
206
207     public void processDecomposition(DelegateExecution execution) {
208         msoLogger.trace("Inside processDecomposition() of  create generic e2e service flow ")
209         try {
210             ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
211         } catch (Exception ex) {
212             String exceptionMessage = "Bpmn error encountered in  create generic e2e service flow. processDecomposition() - " + ex.getMessage()
213             msoLogger.debug(exceptionMessage)
214             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)
215         }
216     }
217
218     public void doServicePreOperation(DelegateExecution execution){
219        //we need a service plugin platform here.
220         ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
221         String uuiRequest = execution.getVariable("uuiRequest")
222         String newUuiRequest = ServicePluginFactory.getInstance().preProcessService(serviceDecomposition, uuiRequest);
223         execution.setVariable("uuiRequest", newUuiRequest)
224     }
225
226     public void doServiceHoming(DelegateExecution execution) {
227         //we need a service plugin platform here.
228         ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
229         String uuiRequest = execution.getVariable("uuiRequest")
230         String newUuiRequest = ServicePluginFactory.getInstance().doServiceHoming(serviceDecomposition, uuiRequest);
231         execution.setVariable("uuiRequest", newUuiRequest)
232     }
233
234         public void postProcessAAIGET(DelegateExecution execution) {
235                 msoLogger.trace("postProcessAAIGET ")
236                 String msg = ""
237
238                 try {
239                         String serviceInstanceName = execution.getVariable("serviceInstanceName")
240                         boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
241                         if(!succInAAI){
242                                 msoLogger.info("Error getting Service-instance from AAI", + serviceInstanceName)
243                                 WorkflowException workflowException = execution.getVariable("WorkflowException")
244                                 msoLogger.debug("workflowException: " + workflowException)
245                                 if(workflowException != null){
246                                         exceptionUtil.buildAndThrowWorkflowException(execution, workflowException.getErrorCode(), workflowException.getErrorMessage())
247                                 }
248                                 else
249                                 {
250                                         msg = "Failure in postProcessAAIGET GENGS_SuccessIndicator:" + succInAAI
251                                         msoLogger.info(msg)
252                                         exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)
253                                 }
254                         }
255                         else
256                         {
257                                 boolean foundInAAI = execution.getVariable("GENGS_FoundIndicator")
258                                 if(foundInAAI){
259                                         msoLogger.info("Found Service-instance in AAI")
260                                         msg = "ServiceInstance already exists in AAI:" + serviceInstanceName
261                                         msoLogger.info(msg)
262                                         exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)
263                                 }
264                         }
265                 } catch (BpmnError e) {
266                         throw e;
267                 } catch (Exception ex) {
268                         msg = "Exception in DoCreateServiceInstance.postProcessAAIGET. " + ex.getMessage()
269                         msoLogger.info(msg)
270                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
271                 }
272                 msoLogger.trace("Exit postProcessAAIGET ")
273         }
274
275         //TODO use create if not exist
276         public void postProcessAAIPUT(DelegateExecution execution) {
277                 msoLogger.trace("postProcessAAIPUT ")
278                 String msg = ""
279                 try {
280                         String serviceInstanceId = execution.getVariable("serviceInstanceId")
281                         boolean succInAAI = execution.getVariable("GENPS_SuccessIndicator")
282                         if(!succInAAI){
283                                 msoLogger.info("Error putting Service-instance in AAI", + serviceInstanceId)
284                                 WorkflowException workflowException = execution.getVariable("WorkflowException")
285                                 msoLogger.debug("workflowException: " + workflowException)
286                                 if(workflowException != null){
287                                         exceptionUtil.buildAndThrowWorkflowException(execution, workflowException.getErrorCode(), workflowException.getErrorMessage())
288                                 }
289                         }
290                         else
291                         {
292                                 //start rollback set up
293                                 RollbackData rollbackData = new RollbackData()
294                                 def disableRollback = execution.getVariable("disableRollback")
295                                 rollbackData.put("SERVICEINSTANCE", "disableRollback", disableRollback.toString())
296                                 rollbackData.put("SERVICEINSTANCE", "rollbackAAI", "true")
297                                 rollbackData.put("SERVICEINSTANCE", "serviceInstanceId", serviceInstanceId)
298                                 rollbackData.put("SERVICEINSTANCE", "subscriptionServiceType", execution.getVariable("subscriptionServiceType"))
299                                 rollbackData.put("SERVICEINSTANCE", "globalSubscriberId", execution.getVariable("globalSubscriberId"))
300                                 execution.setVariable("rollbackData", rollbackData)
301                         }
302
303                 } catch (BpmnError e) {
304                         throw e;
305                 } catch (Exception ex) {
306                         msg = "Exception in DoCreateServiceInstance.postProcessAAIDEL. " + ex.getMessage()
307                         msoLogger.info(msg)
308                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
309                 }
310                 msoLogger.trace("Exit postProcessAAIPUT ")
311         }
312
313         /**
314          * Gets the service instance and its relationships from aai
315          */
316         public void getServiceInstance(DelegateExecution execution) {
317                 try {
318                         String serviceInstanceId = execution.getVariable('serviceInstanceId')
319                         String globalSubscriberId = execution.getVariable('globalSubscriberId')
320                         String serviceType = execution.getVariable('subscriptionServiceType')
321
322                         AAIResourcesClient resourceClient = new AAIResourcesClient()
323                         AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalSubscriberId, serviceType, serviceInstanceId)
324                         AAIResultWrapper wrapper = resourceClient.get(serviceInstanceUri, NotFoundException.class)
325
326                         Optional<ServiceInstance> si = wrapper.asBean(ServiceInstance.class)
327                         execution.setVariable("serviceInstanceName", si.get().getServiceInstanceName())
328
329                 }catch(BpmnError e) {
330                         throw e;
331                 }catch(Exception ex) {
332                         String msg = "Internal Error in getServiceInstance: " + ex.getMessage()
333                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
334                 }
335         }
336
337         public void postProcessAAIGET2(DelegateExecution execution) {
338                 msoLogger.trace("postProcessAAIGET2 ")
339                 String msg = ""
340
341                 try {
342                         String serviceInstanceName = execution.getVariable("serviceInstanceName")
343                         boolean succInAAI = execution.getVariable("GENGS_SuccessIndicator")
344                         if(!succInAAI){
345                                 msoLogger.info("Error getting Service-instance from AAI in postProcessAAIGET2", + serviceInstanceName)
346                                 WorkflowException workflowException = execution.getVariable("WorkflowException")
347                                 msoLogger.debug("workflowException: " + workflowException)
348                                 if(workflowException != null){
349                                         exceptionUtil.buildAndThrowWorkflowException(execution, workflowException.getErrorCode(), workflowException.getErrorMessage())
350                                 }
351                                 else
352                                 {
353                                         msg = "Failure in postProcessAAIGET2 GENGS_SuccessIndicator:" + succInAAI
354                                         msoLogger.info(msg)
355                                         exceptionUtil.buildAndThrowWorkflowException(execution, 2500, msg)
356                                 }
357                         }
358                         else
359                         {
360                                 boolean foundInAAI = execution.getVariable("GENGS_FoundIndicator")
361                                 if(foundInAAI){
362                                         String aaiService = execution.getVariable("GENGS_service")
363                                         if (!isBlank(aaiService) && (utils.nodeExists(aaiService, "service-instance-name"))) {
364                                                 execution.setVariable("serviceInstanceName",  utils.getNodeText(aaiService, "service-instance-name"))
365                                                 msoLogger.info("Found Service-instance in AAI.serviceInstanceName:" + execution.getVariable("serviceInstanceName"))
366                                         }
367                                 }
368                         }
369                 } catch (BpmnError e) {
370                         throw e;
371                 } catch (Exception ex) {
372                         msg = "Exception in DoCreateServiceInstance.postProcessAAIGET2 " + ex.getMessage()
373                         msoLogger.info(msg)
374                         exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
375                 }
376                 msoLogger.trace("Exit postProcessAAIGET2 ")
377         }
378
379         public void preProcessRollback (DelegateExecution execution) {
380                 msoLogger.trace("preProcessRollback ")
381                 try {
382
383                         Object workflowException = execution.getVariable("WorkflowException");
384
385                         if (workflowException instanceof WorkflowException) {
386                                 msoLogger.info("Prev workflowException: " + workflowException.getErrorMessage())
387                                 execution.setVariable("prevWorkflowException", workflowException);
388                                 //execution.setVariable("WorkflowException", null);
389                         }
390                 } catch (BpmnError e) {
391                         msoLogger.info("BPMN Error during preProcessRollback")
392                 } catch(Exception ex) {
393                         String msg = "Exception in preProcessRollback. " + ex.getMessage()
394                         msoLogger.info(msg)
395                 }
396                 msoLogger.trace("Exit preProcessRollback ")
397         }
398
399         public void postProcessRollback (DelegateExecution execution) {
400                 msoLogger.trace("postProcessRollback ")
401                 String msg = ""
402                 try {
403                         Object workflowException = execution.getVariable("prevWorkflowException");
404                         if (workflowException instanceof WorkflowException) {
405                                 msoLogger.info("Setting prevException to WorkflowException: ")
406                                 execution.setVariable("WorkflowException", workflowException);
407                         }
408                         execution.setVariable("rollbackData", null)
409                 } catch (BpmnError b) {
410                         msoLogger.info("BPMN Error during postProcessRollback")
411                         throw b;
412                 } catch(Exception ex) {
413                         msg = "Exception in postProcessRollback. " + ex.getMessage()
414                         msoLogger.info(msg)
415                 }
416                 msoLogger.trace("Exit postProcessRollback ")
417         }
418
419         public void preInitResourcesOperStatus(DelegateExecution execution){
420         msoLogger.trace("STARTED preInitResourcesOperStatus Process ")
421         try{
422             String serviceId = execution.getVariable("serviceInstanceId")
423             String operationId = execution.getVariable("operationId")
424             String operationType = execution.getVariable("operationType")
425             String resourceTemplateUUIDs = ""
426             String result = "processing"
427             String progress = "0"
428             String reason = ""
429             String operationContent = "Prepare service creation"
430             msoLogger.info("Generated new operation for Service Instance serviceId:" + serviceId + " operationId:" + operationId + " operationType:" + operationType)
431             serviceId = UriUtils.encode(serviceId,"UTF-8")
432             execution.setVariable("serviceInstanceId", serviceId)
433             execution.setVariable("operationId", operationId)
434             execution.setVariable("operationType", operationType)
435             ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
436             List<Resource>  resourceList = serviceDecomposition.getServiceResources()
437
438             for(Resource resource : resourceList){
439                     resourceTemplateUUIDs  = resourceTemplateUUIDs + resource.getModelInfo().getModelCustomizationUuid() + ":"
440             }
441
442             def dbAdapterEndpoint = "http://mso.mso.testlab.openecomp.org:8080/dbadapters/RequestsDbAdapter"
443             execution.setVariable("CVFMI_dbAdapterEndpoint", dbAdapterEndpoint)
444             msoLogger.info("DB Adapter Endpoint is: " + dbAdapterEndpoint)
445
446             String payload =
447                 """<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
448                         xmlns:ns="http://org.onap.so/requestsdb">
449                         <soapenv:Header/>
450                         <soapenv:Body>
451                             <ns:initResourceOperationStatus xmlns:ns="http://org.onap.so/requestsdb">
452                                                                 <serviceId>${MsoUtils.xmlEscape(serviceId)}</serviceId>
453                                                                 <operationId>${MsoUtils.xmlEscape(operationId)}</operationId>
454                                                                 <operationType>${MsoUtils.xmlEscape(operationType)}</operationType>
455                                                                 <resourceTemplateUUIDs>${MsoUtils.xmlEscape(resourceTemplateUUIDs)}</resourceTemplateUUIDs>
456                             </ns:initResourceOperationStatus>
457                         </soapenv:Body>
458                         </soapenv:Envelope>"""
459
460             payload = utils.formatXml(payload)
461             execution.setVariable("CVFMI_initResOperStatusRequest", payload)
462             msoLogger.info("Outgoing initResourceOperationStatus: \n" + payload)
463             msoLogger.debug("CreateVfModuleInfra Outgoing initResourceOperationStatus Request: " + payload)
464
465         }catch(Exception e){
466             msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Exception Occured Processing preInitResourcesOperStatus.", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e);
467             execution.setVariable("CVFMI_ErrorResponse", "Error Occurred during preInitResourcesOperStatus Method:\n" + e.getMessage())
468         }
469         msoLogger.trace("COMPLETED preInitResourcesOperStatus Process ")
470         }
471
472         // if site location is in local Operator, create all resources in local ONAP; 
473         // if site location is in 3rd Operator, only process sp-partner to create all resources in 3rd ONAP
474         public void doProcessSiteLocation(DelegateExecution execution){
475                 msoLogger.trace("======== Start doProcessSiteLocation Process ======== ")
476                 ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
477                 String uuiRequest = execution.getVariable("uuiRequest")
478                 uuiRequest = ServicePluginFactory.getInstance().doProcessSiteLocation(serviceDecomposition, uuiRequest);
479                 execution.setVariable("uuiRequest", uuiRequest)
480                 execution.setVariable("serviceDecomposition", serviceDecomposition)
481                 
482                 msoLogger.trace("======== COMPLETED doProcessSiteLocation Process ======== ")
483         }
484         
485         // Allocate cross link TPs(terminal points) for sotn network only
486         public void doTPResourcesAllocation(DelegateExecution execution){
487                 msoLogger.trace("======== Start doTPResourcesAllocation Process ======== ")
488                 ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
489                 String uuiRequest = execution.getVariable("uuiRequest")
490                 uuiRequest = ServicePluginFactory.getInstance().doTPResourcesAllocation(execution, uuiRequest);
491                 execution.setVariable("uuiRequest", uuiRequest)
492                 msoLogger.trace("======== COMPLETED doTPResourcesAllocation Process ======== ")
493         }
494
495         // prepare input param for using DoCreateResources.bpmn
496         public void preProcessForAddResource(DelegateExecution execution) {
497                 msoLogger.trace("STARTED preProcessForAddResource Process ")
498
499                 ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition")
500                 List<Resource> addResourceList = serviceDecomposition.getServiceResources()
501                 execution.setVariable("addResourceList", addResourceList)
502
503                 msoLogger.trace("COMPLETED preProcessForAddResource Process ")
504         }
505
506         public void postProcessForAddResource(DelegateExecution execution) {
507                 // do nothing now
508
509         }
510
511 }