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