summaryrefslogtreecommitdiffstats
path: root/platform-logic/optical-service/src/main/xml/optical-service_create-service-relationship.xml
blob: 9e4a87590cb4b29404c75db925f5e5cfb0fdfc98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<service-logic
    xmlns='http://www.onap.org/sdnc/svclogic'
    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='optical-service' version='${project.version}'>
    <method rpc='create-service-relationship' mode='sync'>
        <block atomic='true'>
            <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='SELECT *
from REQUEST_DETAILS
WHERE request_id = $access-request-id'
pfx='access-service'></get-resource>
            <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
                <parameter name="original_string" value='`$access-service.domain-requests`'/>
                <parameter name="regex" value=","/>
                <parameter name="ctx_memory_result_key" value="domain-services"/>
            </execute>
            <for index='idc' start='0' end='`$domain-services_length`' >
                <block atomic='true'>
                    <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='SELECT *
from REQUEST_DETAILS
WHERE request_id = $domain-services[$idc]'
pfx='ds-details'></get-resource>
                    <block atomic='true'>
                        <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='service-instance:relationship-list'  
     key='customer.global-customer-id = $optical-service-create-input.global-customer-id AND
     service-subscription.service-type = $optical-service-create-input.service-type AND
     service-instance.service-instance-id = $access-service.service-instance-id' force="true" pfx="tmp.AnAI-data">
                            <parameter name="relationship-list.relationship[0].related-to" value="service-instance" />
                            <parameter name="relationship-list.relationship[0].related-link" value="`'/business/customers/customer/' + $optical-service-create-input.global-customer-id + '/service-subscriptions/service-subscription/' + $optical-service-create-input.service-type + '/service-instances/service-instance/' + $ds-details.service-instance-id`" />
                            <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="service-instance.service-instance-id" />
                            <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$ds-details.service-instance-id`" />
                        </save>
                    </block>
                </block>
            </for>
            <switch test='`$domain-services_length == 1`'>
                <outcome value='false'>
                    <for index='idml' start='0' end='`$oof-response.solutions.routeInfo.linkList_length`' >
                        <save plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' resource='service-instance:relationship-list'  
     key='customer.global-customer-id = $optical-service-create-input.global-customer-id AND
     service-subscription.service-type = $optical-service-create-input.service-type AND
     service-instance.service-instance-id = $access-service.service-instance-id' force="true" pfx="tmp.AnAI-data">
                            <parameter name="relationship-list.relationship[0].related-to" value="service-instance" />
                            <parameter name="relationship-list.relationship[0].related-link" value="`'/network/logical-links/logical-link/' + $oof-response.solutions.routeInfo.linkList[$idml]`" />
                            <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-key" value="logical-link.link-name" />
                            <parameter name="relationship-list.relationship[0].relationship-data[0].relationship-value" value="`$oof-response.solutions.routeInfo.linkList[$idml]`" />
                        </save>
                    </for>
                </outcome>
            </switch>
        </block>
    </method>
</service-logic>