1 .. This work is licensed under a Creative Commons Attribution 4.0 License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright 2018 Huawei Technologies Co., Ltd.
5 Building Block Understanding
6 ============================
8 UNDERSTANDING BUILDING BLOCKS USING MACRO FLOW
9 ----------------------------------------------
10 There are basically 2 flows - macro , a la carte.
14 We manually will initiate each step for a process.
18 The whole flow happens at a single click like if we want to create a service.
19 The flow will itself look whether there are vnfs, pnfs or networks in the
20 service and it will be created and activated in the flow also.Thus these
21 independent tasks like if vnf is present, then assign create and activate vnf
22 are all taken up as individual building blocks and are only called on need
24 Each and every request will reach to the api handler first.
26 API HANDLER( ServiceInstances.java )
27 ------------------------------------
31 # 1. Rest call reaching SO Api handler with the input json
33 According to the below path it is mapped to the createServiceInstance
34 function in ServiceInstances file.
38 curl -v -H "Content-Type: application/json" -X POST --data @serviceinstance.json -u mso_admin:password1$ http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances.
40 # 2. Herein a unique requestid is generated corresponding to every request, and
41 is checked whether that particular requestid exists in request db (Happens in
42 createServiceInstance in ServiceInstances).
44 a. **http://request-db-adapter:8083/infraActiveRequests/requestid** (GET), which will return a 404 if not exists.
46 b. CreateInstance is set to the action variable. Here the request scope is
47 set to service from the inputjson - modelType.
50 # 3. Running local validations on input json.
52 # 4. create InfraActiveRequests, to store request details in request db adapter
53 and as a payload to bpmn.
55 a) A new InfraActiveRequests object is created. And all the necessary
56 information from the input is set to it.
58 b) Retrieving productFamilyName from the input json to put into requests db. **http://aai/servicedesigncreation/services/service/{productfamilyid}** (GET), which will return a 404 if not exists in aai. If service exists, then that service's serviceDescritiption is set as productfamilyName.
60 c) **http://aai/cloudinfrastructure/cloudregions/cloudregion/cloudowner/{lcpCloudRegionId}/tenants/tenant/{tenantId}** (GET), checks for whether the particular cloud configuration exists in aai, if not exists returns 404. If we are able to get, then the tenant's name derived from aai is set as tenantName.
62 d) serviceInstanceName is derived from requestInfo.instanceName and is set.
64 e) Request json is also set as RequestBody of InfraActiveRequests.
66 # 5. Checks fro whether duplicate name exists.
68 a. version v[integer] is converted to the particular integer and stored.
70 b. Checks whether instance name already exists in with a POST request in **http://request-db-adapter:8083/infraActiveRequests/checkInstanceNameDuplicate**, with the data { instanceIdmap = null, instanceName = {instanceName} , instanceservice = service } . It checks for the current progress and if in progress it throws the particular status.
72 # 6. Gets the orchestration url from the recipe table.
74 a. Checks whether the service already exists in catalogdb **http://catalog-db-adapter:8082/service/{modelNameVersionId}** (GET).
76 b. Checks the service recipe table with the modelNameVersionId and the action to be performed **http://catalog-db-adapter:8082/serviceRecipe/search/findFirstByServiceModelUUIDAndAction?serviceModelUUID={modelNameVersionId}&action=createInstance** . Returns a 404 if no recipe exists with the corresponding id.
78 c. As recipe corresponding to this doesn't exist, we try to get with a default value. This flow comes under generic resource flow so the default value is GR-API-DEFAULT. First we get service with this value **http://catalog-db-adapter:8082/service/search/findFirstByModelNameOrderByModelVersionDesc?modelName=GR-API-DEFAULT** (GET). It returns a service with modelUUID as d88da85c-d9e8-4f73-b837-3a72a431622b, and further can be used to get the recipe.
80 d. **http://catalog-db-adapter:8082/serviceRecipe/search/findFirstByServiceModelUUIDAndAction?serviceModelUUID=d88da85c-d9e8-4f73-b837-3a72a431622b&action=createInstance** (GET), gives a recipe which has a parameter "orchestrationUri" as "/mso/async/services/WorkflowActionBB".
82 # 7. Updates the infraActiveRequests with the current request.
84 a) **http://request-db-adapter:8083/infraActiveRequests/** (POST) with the data formed. And a 201 created response is received.
86 # 8. Call the bpmn with a post call on orchestrationUri. The data to bpmn is
87 prepared having parameters like
89 a) bpmnRequest - formed from input request.
91 b) vfModuleId, pnfCorrelationId, networkId, configurationId, vfModuleType,
92 serviceInstanceId , serviceType are updated if present in the input json
93 or else set to empty string.
95 c) apiVersion , requestId, aLaCarte = false (def), recipeTimeout = 180(def)
96 ,requestAction= createInstance are all updated accordingly.
98 d) requestUri - v7/serviceInstances ,which is formed from the request url.
100 # 9. A sync response is obtained on reaching bpmn like
102 {"requestReferences":{"requestId":"c45702f7-3f08-4081-bc98-2f9f18b81607","instanceId":"cadca18f-9bff-44be-8910-ad29d342e91f","requestSelfLink":**"http://159.138.57.166:30277/orchestrationRequests/v7/c45702f7-3f08-4081-bc98-2f9f18b81607"**}}.
105 # 10. Calls the WorkflowActionBB.bpmn
110 Hits WorkflowActionBB.bpmn
111 --------------------------
113 .. image:: ../images/workflow.png
116 # 10.1. RetrieveBBExecutionList - implemented in selectExecutionList in
119 a. resourcetype, resourceid are formed from matching the requestUri to a
120 regex pattern matcher
124 [pattern=[vV]\d+.*?(?:(?:/(?<type>vnfs|vfModules|networks|networkCollections|volumeGroups|serviceInstances|instanceGroups)(?:/(?<id>[^/]+))?)(?:/(?<action>[^/]+))?(?:/resume)?)] .
126 b. Checks whether there is a service subscription with service instance name as {instanceName} correspoding to the customer in aai
130 https://aai.onap:8443/aai/v19/business/customers/customer/slice1/service-subscriptions/service-subscription/service/service-instances?depth=2&resultIndex=0&resultSize=1&service-instance-name={instanceName}.
132 Returns 404 not found, if it doesnt exists then the id of that particular instance is taken and given as both the resourceid and serviceinstance id. If not present then a random value is generated, and is assigned same to both.
134 c. Checks whether there is a service of the particular serviceInstanceId exists in aai. **https://aai.onap:8443/aai/v19/nodes/service-instances/service-instance/{serviceInstanceId}** , returns not found if it doesnt exist. If service with corresponding instance name already exists , then flowsToExecute is got by quering the requestdbadapter with the earlier request id. If not present, then only orchestrationflows are got, and later from that the flowsToExecute are found out.
136 d. Get the particular service from catalogdb . **http://so-catalog-db-adapter.onap:8082/service/{modelNameVersionId}** (GET). Be sure that the service with this particular modelNameVersionId exists in catalogdb, because based on the services (like whether pnf, or vnf, or networkcollection) present in that particular service, which all bbs to execute are decided.
138 e. This being a service, "service" is added to the resource list. And is checked upon for other resources like vnf and network, eg:
140 **http://so-catalog-db-adapter.onap:8082/service/{modelNameVersionId}/vnfCustomizations** (GET)
142 **http://so-catalog-db-adapter.onap:8082/service/{modelNameVersionId}/collectionResourceCustomizations** (GET)
144 **http://so-catalog-db-adapter.onap:8082/service/{modelNameVersionId}/networkCustomizations** (GET)
146 And depending on the resources in the service, the resources found is updated like
148 Found :Service - 1 Vnf - 0 Pnf - 0 VfModule - 0 VolumeGroup - 0 Network - 0 VirtualLink - 0 NetworkCollection - 0 Configuration - 0 InstanceGroup - 0
150 f. Then the orchestration flows are get from the orchestration_flow_table depending on the cloudowner and request scope:
152 **http://so-catalog-db-adapter.onap:8082/northbound_request_ref_lookup/search/findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType?action=createInstance&requestScope=Service&isALaCarte=false&cloudOwner={CloudOwner}&serviceType=%2A** (GET)
154 Here if present, then the orchestration flows are returned or else with default cloud owner, we try again
156 **http://so-catalog-db-adapter.onap:8082/northbound_request_ref_lookup/search/findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType?action=createInstance&requestScope=Service&isALaCarte=false&cloudOwner=DEFAULT&serviceType=%2A** (GET)
158 Here in northBoundRequest is returned which has the parameter orchestrationFlowList, that contains the link that will return the orchestration flows.
160 "orchestrationFlowList" : { "href" : "**http://so-catalog-db-adapter.onap:8082/northbound_request_ref_lookup/101/orchestrationFlowList**"}
162 Now we do a get on the orchestration flow link to get the set of orchestration flows required
164 **http://so-catalog-db-adapter.onap:8082/northbound_request_ref_lookup/101/orchestrationFlowList**.
166 Here a set of 20 orchestration flows are returned under the action of Service-Macro-Create, each with a sequence no assigned sequentially in the given order
168 * AssignServiceInstanceBB,
169 * CreateNetworkCollectionBB,
172 * AssignVolumeGroupBB,
180 * CreateVolumeGroupBB,
181 * ActivateVolumeGroupBB,
183 * ActivateVfModuleBB,
186 * ActivateNetworkCollectionBB,
187 * ActivateServiceInstanceBB.
190 .. image:: ../images/flowchart.png
193 g. Flows to execute is determined by iterating through all the orchestartion flows and matching it with the found resources. It is merely a contains matching. In this particular as service was the only resource : List of BuildingBlocks to execute:AssignServiceInstanceBB, ActivateServiceInstanceBB.
195 h. processing data is added to the requestdbadapter. Here the data is post to the requestdb as two different building blocks **http://so-request-db-adapter.onap:8083/requestProcessingData**.
197 i. The already stored request details in request db is ammended like "lastModifiedBy" : "CamundaBPMN" , and status to in_progress with a put request.
200 # 10.2. sendSyncAck - This was used to give an acknowledgement , with status
201 code as 200, and requestId and resourceId is sent as content.
204 # 10.3. Prevalidate the workflow
207 # 10.4. SelectBB - implemented in selectBBin WorkflowActionBBTasks
209 This is used to select the building block from the flows to execute
210 depending on the sequence order.
212 a. Depending on the current sequence , the building block is selected from
213 the flows to execute.
215 b. Execution variable, that is passed between the different building
216 blocks as the payload is amended as:
217 execution.setVariable("buildingBlock", buildingblockselected).
219 c. current sequence is incremented by 1, and updated in execution
222 d. Depending on whether currentSequence is greater than
223 flowsToExecute.size(), COMPLETED variable is either set to true
226 # 10.5. updateFlowStatistics - implemented in updateFlowStatistics in
227 WorkflowActionBBTasks
229 a. Depending on the current sequence no, the completed bb and next bb is
230 got from the flows to execute. And these are mentioned in a
233 b. Percentage progress is got from the total no of bbs
235 c. These are ammended to the already present request in the request db
238 # 10.6. Execute BB - calls the ExecuteBuildingBlock.bpmn
240 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
242 Hits ExecuteBuildingBlock.bpmn
243 ------------------------------
245 .. image:: ../images/ExecuteBuildingBlock.png
247 # 10.6.1. BBInputSetup - implemented in execute in BBInputSetup
249 Here a generalbuildingblock is formed from executingbuildingblock after
250 certain updations and validations.
252 a. lookupKeyMap is formed from the input , and a map is formed with
253 serviceInstanceId, networkID, vnfID, pnfID, vfmoduleID, volumegroupID,
254 configurationID, instancegroupID as the keys.
256 b. Depending on whether a la carte or macro , different flows are called.
257 getGBBMacro is called in here.
259 c. In getGBBMacro , a valid customer is got with service subscription.
260 (getCustomerAndServiceSubscription)
262 First a customer is got by get request on **https://aai.onap:8443/aai/v19/business/customers/customer/{globalSubscriberId}**
264 After that ServiceSubscription is got by doing a get request
266 **https://aai.onap:8443/aai/v19/business/customers/customer/{globalSubscriberId}/service-subscriptions/service-subscription/service**
268 If, the above request doesnt give any , then ServiceSubscription is
269 fetched by first creating uri keys
271 **https://aai.onap:8443/aai/v19/nodes/service-instances/service-instance/{resourceId}?format=pathed**.
273 Then ServiceSubscription is got from the globalSubscriberId and the
276 .. note:: a valid customer and a corresponding ServiceSubscription must
277 be present in the aai, for setting up the customer to gbuildingblock
279 d. project and owningEntity is updated from the input
281 e. service is got from the catalog db either by ModelVersionId or by ModelVersion and ModelInvariantId.
283 f. ServiceInstance is created from the above parameters, and this ServiceInstance is used in the preparation of general building block.
285 g. Depending on whether the current executing block name contains either of the network, or configuration, or network collection. A new instance of the corresponding type is created and is updated to the general building block (Happens in getGBBMacroNoUserParamsCreate)
287 h. This general building block is set to the gBuildingBlockExecution and gBBInput parameter of execution.
290 # 10.6.2. StatusPolicy - implemented in validateOrchestrationStatus in
291 OrchestrationStatusValidator. Input being gBuildingBlockExecution
293 a. orchestrationStatus is obtained after checking the resource type. We
294 had updated the orchestrationStatus in the above step when a new
295 service instance was created.
297 b. OrchestrationStatusStateTransitionDirective is got by doing a get call
298 to the catlog db with the url as
299 findOneByResourceTypeAndOrchestrationStatusAndTargetAction
301 **http://so-catalog-db-adapter.onap:8082/orchestrationStatusStateTransitionDirective/search/findOneByResourceTypeAndOrchestrationStatusAndTargetAction?resourceType=SERVICE&orchestrationStatus=PRECREATED&targetAction=ASSIGN**
303 c. orchestrationStatusValidationResult parameter is set to
304 executionvariable from the
305 OrchestrationStatusStateTransitionDirective.getFlowDirective()
306 "flowDirective" : "CONTINUE"
308 # 10.6.3. Prevalidate the gBuildingBlockExecution
310 # 10.6.4. BB To Execute: Depending on which building block is to be executed,
311 that particular bpmn is called .In this case, AssignServiceInstanceBB is called
313 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
315 .. topic:: Hits AssignServiceInstanceBB.bpmn
317 .. image:: ../images/AssignServiceInstanceBB.png
319 # 10.6.4.1. AAI create service subscription - implemented in
320 createServiceSubscription of createAAITasks
322 This method is used for creating and subscribing the service in A&AI
324 a. Customer is got from the general building block that was updated above
326 b. Here a serviceSubscriptionURI is formed by taking in the
327 globalSubscriberId and the serviceType
329 c. If a service subscription for the particular customer doesnt exist in
330 AAI, then a new subscription is created by taking in the
331 serviceSubscriptionURI
333 GET performed on uri:**https://aai.onap:8443/aai/v19/business/customers/customer/slice1/service-subscriptions/service-subscription/service?
334 {"results":[{"service-subscription":1}]}**
336 # 10.6.4.2. AAI create service instance - implemented in createServiceInstance
339 This method is used for creating the service instance in A&AI
341 a. Customer is got from the general building block that was updated above
343 b. A serviceInstanceURI is formed by taking in the globalSubscriberId, the
344 serviceType and the service instance id
346 c. If the service instance in the particular path doesnt exist in AAI ,
347 then a new service instance is created by using the serviceInstanceURI
351 GET to:https://aai.onap:8443/aai/v19/business/customers/customer/slice1/service-subscriptions/service-subscription/service/service-instances/service-instance/2b955def-e536-40ee-84cb-3f06e3cc6d84?
353 response: {"requestError":{"serviceException":{"messageId":"SVC3001","text":"Resource not found for %1 using id %2 (msg=%3) (ec=%4)","variables":["GET","business/customers/customer/slice1/service-subscriptions/service-subscription/service/service-instances/service-instance/2b955def-e536-40ee-84cb-3f06e3cc6d84","Node Not Found:No Node of type service-instance found at: business/customers/customer/slice1/service-subscriptions/service-subscription/service/service-instances/service-instance/2b955def-e536-40ee-84cb-3f06e3cc6d84","ERR.5.4.6114"]}}}
355 Sending HTTP PUT to:https://aai.onap:8443/aai/v19/business/customers/customer/slice1/service-subscriptions/service-subscription/service/service-instances/service-instance/2b955def-e536-40ee-84cb-3f06e3cc6d84
357 with req body : {"service-instance-id":"2b955def-e536-40ee-84cb-3f06e3cc6d84","service-instance-name":"DEMO_123456","model-invariant-id":"944862ae-bb65-4429-8330-a6c9170d6672","model-version-id":"d88da85c-d9e8-4f73-b837-3a72a431622b","orchestration-status":"Inventoried"}
359 # 10.6.4.3. AAI create project - implemented in createProject of createAAITasks
361 This method is used for creation of the project A&AI.
362 Here too it checks whether a project with a {projectName} exist in AAI .
363 If not it creates one, and connects it to the service instance identified
364 by the serviceInstanceId
368 Sending HTTP PUT to:https://aai.onap:8443/aai/v19/business/projects/project/name%20of%20proj/relationship-list/relationship
370 with req body: {"related-link":"/business/customers/customer/slice1/service-subscriptions/service-subscription/service/service-instances/service-instance/2b955def-e536-40ee-84cb-3f06e3cc6d84"}
373 # 10.6.4.4. AAI create owning entity - implemented in createOwningEntity of
376 a. OwningEntityId and OwningEntityName is extracted from the OwningEntity
377 given in the input json
379 b. If both of them are null, then an exception is raised.
381 c. If only OwningEntityId is null, then whether the OwningEntityName is
382 present in AAI is checked. If present then OwningEntityId is set by
383 quering the OwningEntity from AAI. And then connect it to the service
384 instance. If not present in the aai then a random id is generated and
385 assigned to OwningEntityId. Then Owning entity is first created and
386 then connected to the service instance
388 d. Depending on whether the owning entity is already present or not,
389 either createOwningEntityandConnectServiceInstance is called, or
390 connectOwningEntityandServiceInstanceis called.
394 Sending HTTP PUT to:https://aai.onap:8443/aai/v19/business/owning-entities/owning-entity/owningEntityIdof%20owningEntity/relationship-list/relationship
396 req body: {"related-link":"/business/customers/customer/slice1/service-subscriptions/service-subscription/service/service-instances/service-instance/2b955def-e536-40ee-84cb-3f06e3cc6d84"}
399 # 10.6.4.5. SDNC Create Assign Request - implemented in assignServiceInstance
402 a. Here first the requestContext, serviceInstance, customer are obtained
403 from the general building block
405 b. Then a payload for the assignServiceInstance of the sdnc is formed by
406 passing in the above parameters to the assignServiceInstance in
409 c. A new sdnc request is formed with the above thing as payload
411 d. This sdnc request is assigned to the SDNCRequest parameter of the
417 "request-information" : {
418 "request-action" : "CreateServiceInstance",
420 "request-id" : "139636cd-4b69-4c3a-9e67-fed2c283baee"
423 "sdnc-request-header" : {
425 "svc-request-id" : "9bfe8cb0-bb8b-4dca-949d-2f2b51011b54",
426 "svc-action" : "assign"
429 "service-information" : {
431 "onap-model-information" : {
432 "model-name" : "GR-API-DEFAULT",
433 "model-version" : "1.0",
434 "model-uuid" : "d88da85c-d9e8-4f73-b837-3a72a431622b",
435 "model-invariant-uuid" : "944862ae-bb65-4429-8330-a6c9170d6672"
438 "subscription-service-type" : "service",
439 "service-id" : "2b955def-e536-40ee-84cb-3f06e3cc6d84",
440 "global-customer-id" : {global_customerid},
441 "service-instance-id" : "2b955def-e536-40ee-84cb-3f06e3cc6d84"
444 "service-request-input" : {
446 "service-input-parameters" : {
448 "name" : "some name",
449 "value" : "some value"
454 "service-instance-name" : {instance_name}
458 # 10.6.4.6. It calls another bpmn file - SDNCHandler.bpmn
460 a. Setup callback variables - Here mainly the correlator variable and the
461 sdnc timeout variable is set
463 b. callSDNC - Here post call to sdnc client is done with the above
464 prepared payload. And then isSDNCCompleted is set to the execution
467 Both the above tasks are implemented in SDNCRequestTasks.
469 **http://sdnc-oam.onap:8282/restconf/operations/GENERIC-RESOURCE-API:service-topology-operation/**
471 # 10.6.4.7. AAI Update (svc instance)- implemented in the
472 updateOrchestrationStatusAssignedService in AAIUpdateTasks
474 BPMN access method to update the status of Service to Assigned in AAI.
475 Here serviceInstance is obtained , then its orchestration status is
476 changed to assigned and is updated in the AAI
478 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
480 Reaches back to ExecuteBuildingBlock.bpmn
482 # 10.6.5. Post validate the generic building block
484 # 10.6.6. Set Handling Code To Success - implemented in
485 setHandlingStatusSuccess in ExecuteBuildingBlockRainyDay handling code is set
486 to success for the execution variable
488 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
490 Reaches back to WorkflowActionBB.bpmn
492 # 10.7. postProcessingExecuteBB
494 If the building block excuted is ActivateVfModuleBB, then a
495 postProcessingExecuteBBActivateVfModule needs to be executed
497 Then again it is looped back to selectBB through a checkRetryStatus block.
499 This block comes into play only if the handlingCode is retry, and the retry
500 count is lesser than the maximum allowed no of retries, then the current
501 sequence is again reduced by 1 , so that the same block is executed again.
502 Request in the requestdb is updated with a setRetryStatusMessage,
503 keeping an eye on the no of retries executed.
506 And in this particular example ActivateServiceInstanceBB.
507 bpmn is called next in the sequence.
509 Here updateOrchestrationStatusActiveService is called, which is BPMN access
510 method to update status of Service to Active in AAI.
511 Here orchestrationStatus is set to active for the particular
512 service instance and is updated in the AAI .
514 # 10.8. updateRequestStatusToComplete is called if the "complete" flag is true
516 a. Here first the request is got from the requestDbclient **http://request-db-adapter:8083/infraActiveRequests/requestid**
518 b. Then a status message is formed as "Macro-" + resourceName + "-"
519 + action + " request was executed correctly."
521 This status message is updated in the request as well as is set to
522 finalStatusMessage of the execution variable
524 c. Other request parameters are updated
526 request.setEndTime(endTime);
528 request.setFlowStatus("Successfully completed all Building Blocks");
530 request.setProgress(Long.valueOf(100));
532 request.setRequestStatus("COMPLETE");
534 request.setLastModifiedBy("CamundaBPMN");
536 d. This new request parameters are updated by a put request to the
545 If there are other resources present along with the service : Eg
546 :- Volumegroup.( These BBs wil be specifically called )
548 1) AssignVolumeGroupBB :
550 a. genericvnfid and volumegroupid is obtained from the execution block.
551 b. volumegroup orchestrationstatus is set to assigned
552 c. a volume group of the above details is created in aai
553 d. connect volumegroup to this genericvnf
554 e. cloud configuration is got,
555 and then the volumegroup is linked to tenant
557 2) createVolumeGroupBB :
559 a. get the vf details according to Vf module id from sdnc.
560 b. vfmodulequeriedfromsdnc is set to the executionvariable.
561 c. createVolumeGroupRequest is formed with getCloudRegion,
562 serviceinstance, genericVnf, volumegroup, sdncVfModuleQueryResponse.
563 d. calls vnfadapter, which in turn calls openstackadaptertask.
564 e. update heattask in the volumegroup and which is ammended in the aai.
565 f. orchestrationstatus for the volume group is set to created.
567 3) ActivateVolumeGroupBB :
569 orchestrationstatus for the volume group is ammended to active.
571 Rollback, Retry and abort
572 ------------------------------------
574 When exception is thrown then **Error handling** event subprocess in BPMN
575 **ExecuteBuildingBlock** is invoked.
577 .. image:: ../images/handling_error.png
579 **QueryRainyDayTable task** main responsibility is to determine with
580 **rainy_day_handler_macro** table the right policy to apply in order to
583 For each BB a policy is defined in **rainy_day_handler_macro** table
584 (retry, rollback, abort ...)
586 **HandlingCode** parameter is populated with BB **policy** value.
590 # 1. In case of retry handling code
591 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
592 Policy in **rainy_day_handler_macro** table for current BB failure is **Retry**
594 .. image:: ../images/retry_Bdd2.png
596 Once Error handling subprocess has set handlingCode to **retry** value,
597 the main process retries to execute previous failing BB (green arrow).
599 .. image:: ../images/retry.png
601 If a new failure occurred a **new retry** is performed
602 (green arrow in Error handling subprocess)
604 .. image:: ../images/retry3.png
607 Until **max retry count** is reached, this time **secondary policy**
610 .. image:: ../images/retry2.png
612 **HandlingCode** is now set with **secondary policy** value from
613 rainy_day_handler_macro table (rollback, abort...)
615 .. image:: ../images/retry_Bdd.png
618 # 2. In case of rollback handling code
619 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
621 Policy in **rainy_day_handler_macro** table for current BB failure is set to
622 **Rollback** (or RollbackToXXX)
625 .. image:: ../images/rollback_Bdd.png
627 In case of Rollback the main process follows green arrows
629 .. image:: ../images/rollback.png
631 1) **HandlingCode** set previously in Error handling subprocess to Rollback
632 (or RollbackToXXX) drives to **RollBack Execution Path** in main process
634 2) **RollBack Execution Path** task has responsibility to prepare rollback
637 BB FlowName are changed in the following way:
639 * AssignXXX => UnassignXXX
640 * CreateXXX => DeleteXXX
641 * ActivateXXX => DeactivateXXX
642 * AddXXX => DeleteXXX
643 * VNFSetXXX => VNFUnsetXXX
644 * VNFLockXXX => VNFUnLockXXX
645 * VNFStopXXX => VNFStartXXX
646 * VNFQuiesceXXX => VNFResumeXXX
648 3) and 4. **Loop** on step **3** and step **4**, BB are executed one after one in order to **rollback** previous flow execution.
650 5) RollBack completed.
653 # 3. In case of Abort handling code
654 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
656 Policy in **rainy_day_handler_macro** table for current BB failure is **Abort**
658 .. image:: ../images/abort.png
663 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
665 Request can disable rollback with **suppressRollback** parameter
667 if **suppressRollback** is set to false value, **QueryRainyDayTable task**
668 will directly return abort without querying policy in table
669 **rainy_day_handler_macro**
674 curl --location --request POST 'http://master2:30277/onap/so/infra/serviceInstantiation/v7/serviceInstances' \
675 --header 'Accept: application/json' \
676 --header 'Content-Type: application/json' \
677 --header 'Authorization: Basic abcdef' \
678 --header 'X-ONAP-PartnerName: NBI' \
682 "globalSubscriberId": "ones"
685 "suppressRollback": false,
686 "productFamilyId": "Useless_But_Mandatory",