aboutsummaryrefslogtreecommitdiffstats
path: root/platform-logic/generic-resource-api/src/main/json/GENERIC-RESOURCE-API_rollback-generated-names.json
blob: dacb33793f412dfc7ce7446cab1c572997ecf737 (plain)
1
[{"id":"367177f7.563698","type":"dgstart","name":"DGSTART","outputs":1,"x":163.75,"y":68.75,"z":"d0c367b0.d55ca8","wires":[["60ca91f4.f6268"]]},{"id":"468f67a9.c0fe68","type":"method","name":"method rollback-generated-names","xml":"<method rpc='rollback-generated-names' mode='sync'>\n","comments":"","outputs":1,"x":288.82142639160156,"y":140.1785717010498,"z":"d0c367b0.d55ca8","wires":[["d2988a7c.2fd408"]]},{"id":"d2988a7c.2fd408","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","comments":"","outputs":1,"x":288.0357208251953,"y":221.60715103149414,"z":"d0c367b0.d55ca8","wires":[["d1a57281.50136","ceb3fba9.761848","dbce21dd.bda28","7ce1313f.711c4","796e66f5.e5b048"]]},{"id":"d1a57281.50136","type":"switchNode","name":"switch rollback-generated-names-input.context-id","xml":"<switch test='`$rollback-generated-names-input.context-id`'>\n","comments":"","outputs":1,"x":609.5833129882812,"y":220.6666603088379,"z":"d0c367b0.d55ca8","wires":[["dbafe83a.757ed8"]]},{"id":"ceb3fba9.761848","type":"switchNode","name":"switch rollback-generated-names-input.naming-type","xml":"<switch test='`$rollback-generated-names-input.naming-type`'>\n","comments":"","outputs":1,"x":616.7500152587891,"y":280.50000381469727,"z":"d0c367b0.d55ca8","wires":[["23bb964b.7a2caa","b0705a0b.157f48","34b9c028.357d9","70f01569.bbfe5c","1710e5d3.77dcfa","170cdd4d.2b21a3","de873242.c7b5f","fc133415.70f288"]]},{"id":"dbafe83a.757ed8","type":"outcome","name":"NULL","xml":"<outcome value=''>","comments":"","outputs":1,"x":888.0000152587891,"y":221.25000381469727,"z":"d0c367b0.d55ca8","wires":[["5d590d62.dfd0a4"]]},{"id":"5d590d62.dfd0a4","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n\t<parameter name='ack-final' value='Y'/>\n\t<parameter name=\"error-code\" value=\"500\" />\n    <parameter name=\"error-message\" value=\"rollback-generated-names-input.context-id can not be null\" />\n","comments":"","x":1054.6543159484863,"y":220.64523601531982,"z":"d0c367b0.d55ca8","wires":[]},{"id":"23bb964b.7a2caa","type":"outcome","name":"NULL","xml":"<outcome value=''>","comments":"","outputs":1,"x":931.5,"y":280.25,"z":"d0c367b0.d55ca8","wires":[["a0afb9b9.38f3f8"]]},{"id":"a0afb9b9.38f3f8","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n\t<parameter name='ack-final' value='Y'/>\n\t<parameter name=\"error-code\" value=\"500\" />\n    <parameter name=\"error-message\" value=\"rollback-generated-names-input.naming-type can not be null\" />\n","comments":"","x":1097.7500190734863,"y":280.25000381469727,"z":"d0c367b0.d55ca8","wires":[]},{"id":"b0705a0b.157f48","type":"outcome","name":"VM_INSTANCE","xml":"<outcome value='VM_INSTANCE'>","comments":"","outputs":1,"x":959.5000381469727,"y":327.8571434020996,"z":"d0c367b0.d55ca8","wires":[["bdd8786c.e5b358"]]},{"id":"34b9c028.357d9","type":"outcome","name":"VNFC_INSTANCE","xml":"<outcome value='VNFC_INSTANCE'>","comments":"","outputs":1,"x":969.7500305175781,"y":375.35714530944824,"z":"d0c367b0.d55ca8","wires":[["5edf9755.0901f8"]]},{"id":"bdd8786c.e5b358","type":"set","name":"set tmp.rb.naming-index-table-name and prefix column, grn.type","xml":"<set>\n<parameter name='rollback-generated-names.index-table-name' value='NAMING_POLICY_VM_NAME_INDEX' />\n<parameter name='rollback-generated-names.index-table.name-prefix-column' value='vm_name_prefix' />\n","comments":"","x":1381.000015258789,"y":328.0000057220459,"z":"d0c367b0.d55ca8","wires":[]},{"id":"5edf9755.0901f8","type":"set","name":"set tmp.rb.naming-index-table-name and prefix column, grn.type","xml":"<set>\n<parameter name='rollback-generated-names.index-table-name' value='NAMING_POLICY_VNFC_NAME_INDEX' />\n<parameter name='rollback-generated-names.index-table.name-prefix-column' value='vnfc_name_prefix' />\n\n","comments":"","x":1383.250015258789,"y":375.25000762939453,"z":"d0c367b0.d55ca8","wires":[]},{"id":"70f01569.bbfe5c","type":"outcome","name":"Other","xml":"<outcome value='Other'>","comments":"","outputs":1,"x":937,"y":619.5,"z":"d0c367b0.d55ca8","wires":[["3136ec47.d68c14"]]},{"id":"3136ec47.d68c14","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n\t<parameter name='ack-final' value='Y'/>\n\t<parameter name=\"error-code\" value=\"500\" />\n    <parameter name=\"error-message\" value=\"`'Unknown rollbck-generated-name-input.naming-type: ' + $rollback-generated-names-input.naming-type`\" />\n","comments":"","x":1103.2500190734863,"y":619.5000038146973,"z":"d0c367b0.d55ca8","wires":[]},{"id":"77bdf758.54df88","type":"set","name":"set tmp.rb.sql","xml":"<set>\n<parameter name='tmp.rb.sql' \n\tvalue=\"`'SELECT * from ' + $rollback-generated-names.index-table-name \n\t\t+ ' WHERE ' + $rollback-generated-names.index-table.name-prefix-column \n\t\t+ ' = $tmp.rb.grn.prefix'`\" />","comments":"","x":1130.416660308838,"y":1156.5833010673523,"z":"d0c367b0.d55ca8","wires":[]},{"id":"c12778f6.0a1338","type":"get-resource","name":"GET INDEX TABLE.index_number","xml":"<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'\n  key=\"`$tmp.rb.sql`\" pfx='db.grn.index-table'>\n\n","comments":"","outputs":1,"x":1199.0951309204102,"y":1204.4523363113403,"z":"d0c367b0.d55ca8","wires":[["4ba02bfe.2fafb4","6a6129db.ee97d8"]]},{"id":"23b3074b.857058","type":"block","name":"block : atomic","xml":"<block atomic='true'>","atomic":"true","comments":"","outputs":1,"x":939.4166564941406,"y":1157.0833015441895,"z":"d0c367b0.d55ca8","wires":[["77bdf758.54df88","c12778f6.0a1338"]]},{"id":"8e098c23.2f40a","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='error-message' value=\"`'Error reading the '\n\t+ $rollback-generated-names.index-table-name \n\t+ ' table with ' + $rollback-generated-names.name-prefix-column\n\t+ ' = ' + $tmp.rb.grn.prefix \n\t+ '. MANUAL clean up is required!'`\" />\n\n","comments":"","x":1615.6666641235352,"y":1205.3334102630615,"z":"d0c367b0.d55ca8","wires":[]},{"id":"d5340d0c.48452","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='error-message' value=\"`'No entries found in ' \n\t+ $rollback-generated-names.index-table-name \n\t+ ' with ' \n\t+ $rollback-generated-names.name-prefix-column \n\t+ ' = ' \n\t+ $tmp.rb.grn.prefix `\" />\n\n","comments":"","x":1615.3451309204102,"y":1251.1190853118896,"z":"d0c367b0.d55ca8","wires":[]},{"id":"4ba02bfe.2fafb4","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":1442.6666641235352,"y":1204.8334102630615,"z":"d0c367b0.d55ca8","wires":[["8e098c23.2f40a"]]},{"id":"6a6129db.ee97d8","type":"not-found","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":1449.5120658874512,"y":1251.3215522766113,"z":"d0c367b0.d55ca8","wires":[["d5340d0c.48452"]]},{"id":"7ce1313f.711c4","type":"get-resource","name":"GET GENERIC_RESOURCE_NAME distinct prefix","xml":"<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'\n\tkey='SELECT distinct prefix from GENERIC_RESOURCE_NAME WHERE type = $rollback-generated-names-input.naming-type  \n\t\tAND context_id = $rollback-generated-names-input.context-id'\n  pfx='db.grn.distinct-prefix[]'>","comments":"","outputs":1,"x":607.4166259765625,"y":741.333324432373,"z":"d0c367b0.d55ca8","wires":[["4ad7538e.f3d82c","65bbc13b.28e13"]]},{"id":"4ad7538e.f3d82c","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":887.1666259765625,"y":741.3333168029785,"z":"d0c367b0.d55ca8","wires":[["173e772a.cd4d19"]]},{"id":"173e772a.cd4d19","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n\t<parameter name='error-code' value='500'/>\n\t<parameter name='error-message' value=\"Encountered error reading GENERIC_RESOURCE_NAME table to retrieve distinct prefix\"/>","comments":"","x":1056.6666259765625,"y":741.3333168029785,"z":"d0c367b0.d55ca8","wires":[]},{"id":"65bbc13b.28e13","type":"not-found","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":895.1666030883789,"y":787.8333101272583,"z":"d0c367b0.d55ca8","wires":[["7e2b366.e1ab2c8"]]},{"id":"611ed5aa.78878c","type":"comment","name":"pfx = db.grn.distinct-prefix[]","info":"","comments":"","x":599.6666717529297,"y":778.833324432373,"z":"d0c367b0.d55ca8","wires":[]},{"id":"796e66f5.e5b048","type":"for","name":"for each distinct prefix","xml":"<for index='prefix-index' start='0' end='`$db.grn.distinct-prefix_length`' >\n","comments":"","outputs":1,"x":511.9166564941406,"y":903.8333072662354,"z":"d0c367b0.d55ca8","wires":[["863a787.4a89d88"]]},{"id":"10bc4004.cfe86","type":"get-resource","name":"GET GENERIC_RESOURCE_NAME  (name_index)","xml":"<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'\n\tkey='SELECT * from GENERIC_RESOURCE_NAME WHERE type = $rollback-generated-names-input.naming-type   \n\t\tAND context_id = $rollback-generated-names-input.context-id \n\t\tAND prefix = $tmp.rb.grn.prefix order by name_index'\n  pfx='db.grn.subset[]'>","comments":"","outputs":1,"x":1056.9166526794434,"y":1043.5832977294922,"z":"d0c367b0.d55ca8","wires":[["5207f077.d162b","57b22cdd.a0b3b4"]]},{"id":"5207f077.d162b","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":1374.6666526794434,"y":1043.5832901000977,"z":"d0c367b0.d55ca8","wires":[["37f91f4f.dc317"]]},{"id":"37f91f4f.dc317","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n\t<parameter name='error-code' value='500'/>\n\t<parameter name='error-message' value=\"Encountered error reading GENERIC_RESOURCE_NAME table\"/>","comments":"","x":1544.1666526794434,"y":1043.5832901000977,"z":"d0c367b0.d55ca8","wires":[]},{"id":"57b22cdd.a0b3b4","type":"not-found","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":1382.6666297912598,"y":1090.0832834243774,"z":"d0c367b0.d55ca8","wires":[["e0189d81.4cff1"]]},{"id":"e0189d81.4cff1","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n\t<parameter name='error-code' value='500'/>\n\t<parameter name='error-message' value=\"`'No entry found in GENERIC_RESOURCE_NAME where context_id = ' + $rollback-generated-names-input.context-id + ' and type = ' + $rollback-generated-names-input.naming-type + ' and prefix = ' + $db.grn.distinct-prefix[$prefix-index].prefix`\"/>","comments":"","x":1545.9166679382324,"y":1089.8332996368408,"z":"d0c367b0.d55ca8","wires":[]},{"id":"2b90b34b.d7633c","type":"comment","name":"pfx = db.grn.subset[]","info":"","comments":"","x":1127.9166679382324,"y":1081.0833072662354,"z":"d0c367b0.d55ca8","wires":[]},{"id":"863a787.4a89d88","type":"block","name":"block : atomic","xml":"<block atomic='true'>","atomic":"true","comments":"","outputs":1,"x":722.1666488647461,"y":903.5832977294922,"z":"d0c367b0.d55ca8","wires":[["10bc4004.cfe86","f27ef71e.c804b8","23b3074b.857058","a6b9f4f4.6ad9c8","9b466971.d86f98","92644ca8.ceecd","d045a533.059c38","5592a6f6.a24438","14f7ce44.68bc82","18dcbbfc.8a54f4","37760911.be5b06"]]},{"id":"f27ef71e.c804b8","type":"set","name":"set tmp.rb.grn.prefix","xml":"<set>\n<parameter name='tmp.rb.grn.prefix' value='`$db.grn.distinct-prefix[$prefix-index].prefix`' />\n","comments":"","x":959.4166374206543,"y":994.3333034515381,"z":"d0c367b0.d55ca8","wires":[]},{"id":"e83d55fd.8d2e08","type":"switchNode","name":"switch: tmp.rb.net-index == 0","xml":"<switch test=\"`$tmp.rb.net-index == 0`\">","comments":"","outputs":1,"x":1418.3334503173828,"y":1454.4166259765625,"z":"d0c367b0.d55ca8","wires":[["e05f58d7.4e07f8","f48212b5.20b62"]]},{"id":"676ed71d.e6ce68","type":"comment","name":"pfx = db.grn.index-table","info":"","comments":"","x":1235.1666412353516,"y":1241.0832901000977,"z":"d0c367b0.d55ca8","wires":[]},{"id":"9b466971.d86f98","type":"set","name":"set tmp.rb.grn.max-index","xml":"<set>\n<parameter name='tmp.rb.grn.max-index' \n\tvalue='`$db.grn.subset[$db.grn.subset_length - 1].name-index`' />\n","comments":"","x":967.9166564941406,"y":1311.0833044052124,"z":"d0c367b0.d55ca8","wires":[]},{"id":"a6b9f4f4.6ad9c8","type":"set","name":"clear tmp.rb.","xml":"<set>\n<parameter name='tmp.rb.' value='' />\n","comments":"","x":934.4166221618652,"y":947.583288192749,"z":"d0c367b0.d55ca8","wires":[]},{"id":"dbce21dd.bda28","type":"set","name":"clear db.grn.","xml":"<set>\n<parameter name='db.grn.' value='' />\n","comments":"","x":490.55554962158203,"y":687.7777805328369,"z":"d0c367b0.d55ca8","wires":[]},{"id":"92644ca8.ceecd","type":"set","name":"clear db.grn.subset.","xml":"<set>\n<parameter name='db.grn.subset.' value='' />\n","comments":"","x":955.4166564941406,"y":903.8332967758179,"z":"d0c367b0.d55ca8","wires":[]},{"id":"dd5310c5.e7bc1","type":"set","name":"set tmp.rb.sql for delete","xml":"<set>\n<parameter name='tmp.rb.sql' \n\tvalue=\"`'DELETE from ' + $rollback-generated-names.index-table-name \n\t\t+ ' WHERE ' + $rollback-generated-names.index-table.name-prefix-column \n\t\t+ ' = $tmp.rb.grn.prefix'`\" />\n\t\t\n<!--\n+ ' = $tmp.rb.grn.prefix AND index_number = $db.grn.index-table.index-number'`\" />\n-->\t\t\t\t","comments":"","x":2031.0832824707031,"y":1454.4166088104248,"z":"d0c367b0.d55ca8","wires":[]},{"id":"985fa2e8.98689","type":"get-resource","name":"DELETE from INDEX TABLE","xml":"<update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'\n  key=\"`$tmp.rb.sql`\">\n\n","comments":"","outputs":1,"x":2047.2618103027344,"y":1500.0356426239014,"z":"d0c367b0.d55ca8","wires":[["3c1ebfe4.59e22","4c9bbe94.157e"]]},{"id":"27f4d519.bb790a","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='error-message' value=\"`'Error deleting '\n\t+ $rollback-generated-names.index-table-name \n\t+ ' WHERE ' + $rollback-generated-names.name-prefix-column \n\t+ ' = ' + $tmp.rb.grn.prefix \n\t+ ' AND index_number = ' + $db.index-table.index-number\n\t+ '. MANUAL clean up is required!'`\" />\n\n","comments":"","x":2455.8333435058594,"y":1499.9167165756226,"z":"d0c367b0.d55ca8","wires":[]},{"id":"3c1ebfe4.59e22","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":2282.8333435058594,"y":1500.4167165756226,"z":"d0c367b0.d55ca8","wires":[["27f4d519.bb790a"]]},{"id":"4c9bbe94.157e","type":"not-found","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":2289.6787452697754,"y":1546.9048585891724,"z":"d0c367b0.d55ca8","wires":[["9e5f981.150f268"]]},{"id":"85575d12.d5857","type":"block","name":"block : atomic","xml":"<block atomic='true'>","atomic":"true","comments":"","outputs":1,"x":1798.5833358764648,"y":1454.1666259765625,"z":"d0c367b0.d55ca8","wires":[["dd5310c5.e7bc1","985fa2e8.98689"]]},{"id":"d045a533.059c38","type":"set","name":"set tmp.rb.delta-index = index-number - max-index","xml":"<set>\n<parameter name='tmp.rb.delta-index' \n\tvalue='`$db.grn.index-table.index-number - $tmp.rb.grn.max-index`' />\n","comments":"","x":1045.9166564941406,"y":1356.333303451538,"z":"d0c367b0.d55ca8","wires":[]},{"id":"e05f58d7.4e07f8","type":"outcomeTrue","name":"true","xml":"<outcome value='true'>\n","comments":"","outputs":1,"x":1632.0833129882812,"y":1454.4166069030762,"z":"d0c367b0.d55ca8","wires":[["85575d12.d5857"]]},{"id":"18dcbbfc.8a54f4","type":"get-resource","name":"DELETE from GENERIC_RESOURCE_NAME","xml":"<delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'\n\tkey='DELETE from GENERIC_RESOURCE_NAME WHERE type = $rollback-generated-names-input.naming-type  \n\t\tAND context_id = $rollback-generated-names-input.context-id \n\t\tAND prefix = $tmp.rb.grn.prefix'>\n","comments":"","outputs":1,"x":1028.7618713378906,"y":1792.2856998443604,"z":"d0c367b0.d55ca8","wires":[["62bd7357.1b6afc","e9732f88.feaff"]]},{"id":"b81d8b08.9ca378","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='error-message' value=\"`'Error deleting GENERIC_RESOURCE_NAME WHERE type = '\n\t+ $rollback-generated-names-input.naming-type  \n\t+ ' AND context_id = ' + $rollback-generated-names-input.context-id \n\t+ ' AND prefix = '+ $tmp.rb.grn.prefix\n\t+ '. MANUAL clean up is required!'`\" />\n\n","comments":"","x":1480.3334045410156,"y":1793.1667737960815,"z":"d0c367b0.d55ca8","wires":[]},{"id":"62bd7357.1b6afc","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":1307.3334045410156,"y":1792.6667737960815,"z":"d0c367b0.d55ca8","wires":[["b81d8b08.9ca378"]]},{"id":"e9732f88.feaff","type":"not-found","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":1314.1787490844727,"y":1839.1549606323242,"z":"d0c367b0.d55ca8","wires":[["ae5976af.669a08"]]},{"id":"24f6c0c3.95f7f","type":"comment","name":"Delete prefix from INDEX TABLE","info":"","comments":"","x":2301.3334197998047,"y":1456.4166803359985,"z":"d0c367b0.d55ca8","wires":[]},{"id":"ee44b770.263dc8","type":"comment","name":"Silence SUCCESS","info":"","comments":"","x":2546.333351135254,"y":1558.4166240692139,"z":"d0c367b0.d55ca8","wires":[]},{"id":"9e5f981.150f268","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":2438.5833473205566,"y":1546.6666259765625,"z":"d0c367b0.d55ca8","wires":[[]]},{"id":"f48212b5.20b62","type":"outcomeFalse","name":"false","xml":"<outcome value='false'>\n","comments":"","outputs":1,"x":1631.083396911621,"y":1639.666648864746,"z":"d0c367b0.d55ca8","wires":[["2679c184.7566ce"]]},{"id":"ce016bf1.726fe8","type":"comment","name":"index_number > $db.grn.subset_length; i.e hole in the middle. DO NOTHING","info":"","comments":"","x":1221.8334197998047,"y":1578.4166812896729,"z":"d0c367b0.d55ca8","wires":[]},{"id":"d0ffe154.2017d","type":"comment","name":"Silence SUCCESS","info":"","comments":"","x":1570.333251953125,"y":1850.6666584014893,"z":"d0c367b0.d55ca8","wires":[]},{"id":"ae5976af.669a08","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":1462.5832481384277,"y":1838.916660308838,"z":"d0c367b0.d55ca8","wires":[[]]},{"id":"5592a6f6.a24438","type":"switchNode","name":"switch: tmp.rb.delta-index == 0","xml":"<switch test=\"`$tmp.rb.delta-index == 0`\">","comments":"","outputs":1,"x":984.3333282470703,"y":1454.6666240692139,"z":"d0c367b0.d55ca8","wires":[["54669b2b.1c7664","5cd2e8b2.3aabf8"]]},{"id":"54669b2b.1c7664","type":"outcomeTrue","name":"true","xml":"<outcome value='true'>\n","comments":"","outputs":1,"x":1211.5833129882812,"y":1454.6666069030762,"z":"d0c367b0.d55ca8","wires":[["e83d55fd.8d2e08"]]},{"id":"13ee581e.78bb98","type":"set","name":"set tmp.rb.sql for update","xml":"<set>\n<parameter name='tmp.rb.sql' \n\tvalue=\"`'UPDATE ' + $rollback-generated-names.index-table-name \n\t\t+ ' set index_number = ' + $tmp.rb.net-index\n\t\t+ ' WHERE ' + $rollback-generated-names.index-table.name-prefix-column \n\t\t+ ' = $tmp.rb.grn.prefix'`\" />","comments":"","x":2037.833351135254,"y":1639.666633605957,"z":"d0c367b0.d55ca8","wires":[]},{"id":"d1d5de27.6d65f","type":"get-resource","name":"Update INDEX TABLE","xml":"<update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'\n  key=\"`$tmp.rb.sql`\">\n\n","comments":"","outputs":1,"x":2034.0118789672852,"y":1685.2856674194336,"z":"d0c367b0.d55ca8","wires":[["af5b63b8.507a5","961b37ec.64dc98"]]},{"id":"21898cbf.33f884","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='error-message' value=\"`'Error updating  '\n\t+ $rollback-generated-names.index-table-name + '.index_number = ' \n\t+ $tmp.rb.net-index\n\t+ ' WHERE ' + $rollback-generated-names.name-prefix-column \n\t+ ' = ' + $tmp.rb.grn.prefix\n\t+ '. MANUAL clean up is required!'`\" />\n\n","comments":"","x":2439.58341217041,"y":1685.1667413711548,"z":"d0c367b0.d55ca8","wires":[]},{"id":"af5b63b8.507a5","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":2247.58341217041,"y":1685.6667413711548,"z":"d0c367b0.d55ca8","wires":[["21898cbf.33f884"]]},{"id":"961b37ec.64dc98","type":"not-found","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":2254.428813934326,"y":1732.1548833847046,"z":"d0c367b0.d55ca8","wires":[["21898cbf.33f884"]]},{"id":"2679c184.7566ce","type":"block","name":"block : atomic","xml":"<block atomic='true'>","atomic":"true","comments":"","outputs":1,"x":1798.3334045410156,"y":1639.4166507720947,"z":"d0c367b0.d55ca8","wires":[["13ee581e.78bb98","d1d5de27.6d65f"]]},{"id":"14c2ad0d.ae7c33","type":"comment","name":"Update prefix from INDEX TABLE","info":"","comments":"","x":1989.8334121704102,"y":1717.9166464805603,"z":"d0c367b0.d55ca8","wires":[]},{"id":"14f7ce44.68bc82","type":"set","name":"set tmp.rb.net-index = index-number - $db.grn.subset_length","xml":"<set>\n<parameter name='tmp.rb.net-index' \n\tvalue='`$db.grn.index-table.index-number - $db.grn.subset_length`' />\n","comments":"","x":1076.6666412353516,"y":1403.833288192749,"z":"d0c367b0.d55ca8","wires":[]},{"id":"2a3dc862.500858","type":"comment","name":"index_number == max index","info":"","comments":"","x":862.1666564941406,"y":1497.5833053588867,"z":"d0c367b0.d55ca8","wires":[]},{"id":"54f2328a.63d03c","type":"comment","name":"index_number == $db.grn.subset_length","info":"","comments":"","x":1489.6666564941406,"y":1415.0833053588867,"z":"d0c367b0.d55ca8","wires":[]},{"id":"5cd2e8b2.3aabf8","type":"outcomeFalse","name":"false","xml":"<outcome value='false'>\n","comments":"","outputs":1,"x":1219.6666564941406,"y":1623.8333044052124,"z":"d0c367b0.d55ca8","wires":[["f7ec1a24.211fe8"]]},{"id":"f7ec1a24.211fe8","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":1363.4166641235352,"y":1624.0833072662354,"z":"d0c367b0.d55ca8","wires":[[]]},{"id":"3dffc8c6.351eb8","type":"comment","name":"Change History","info":"iTrack SDNGC-10767\n- new DG to rollback generated-names","comments":"","x":642.5000076293945,"y":113.75000190734863,"z":"d0c367b0.d55ca8","wires":[]},{"id":"6b1751d3.9aae8","type":"set","name":"set tmp.rb.naming-index-table-name, index-table.prefix column, grn.type","xml":"<set>\n<parameter name='rollback-generated-names.index-table-name' value='EIPAM_CLIENT_KEY_INDEX' />\n<parameter name='rollback-generated-names.index-table.name-prefix-column' value='vnf_name_prefix' />\n","comments":"","x":1408.75,"y":425.75,"z":"d0c367b0.d55ca8","wires":[]},{"id":"1710e5d3.77dcfa","type":"outcome","name":"CLIENT_KEY","xml":"<outcome value='CLIENT_KEY'>","comments":"","outputs":1,"x":956.5000152587891,"y":425.35713958740234,"z":"d0c367b0.d55ca8","wires":[["6b1751d3.9aae8"]]},{"id":"170cdd4d.2b21a3","type":"outcome","name":"NETWORK_INSTANCE","xml":"<outcome value='NETWORK_INSTANCE'>","comments":"","outputs":1,"x":988.2777633666992,"y":475.61110496520996,"z":"d0c367b0.d55ca8","wires":[["5fa679c.78e5088"]]},{"id":"de873242.c7b5f","type":"outcome","name":"SERVICE_INSTANCE","xml":"<outcome value='SERVICE_INSTANCE'>","comments":"","outputs":1,"x":986.3889007568359,"y":524.6111211776733,"z":"d0c367b0.d55ca8","wires":[["82455610.85dad8"]]},{"id":"fc133415.70f288","type":"outcome","name":"VNF_INSTANCE","xml":"<outcome value='VNF_INSTANCE'>","comments":"","outputs":1,"x":970.2777633666992,"y":570.611120223999,"z":"d0c367b0.d55ca8","wires":[["8ec44038.4f2ac"]]},{"id":"5a4d6d80.b5bda4","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":1310.7856979370117,"y":1936.4285354614258,"z":"d0c367b0.d55ca8","wires":[["d0e2990c.3467d8"]]},{"id":"d0e2990c.3467d8","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n\t<parameter name='error-code' value='500'/>\n\t<parameter name='error-message' value=\"Encountered error reading GENERIC_RESOURCE_NAME table\"/>","comments":"","x":1480.2856979370117,"y":1936.4285354614258,"z":"d0c367b0.d55ca8","wires":[]},{"id":"3d2d0a92.8fb326","type":"not-found","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":1318.7856750488281,"y":1982.9285287857056,"z":"d0c367b0.d55ca8","wires":[["a9dae2af.d2f53"]]},{"id":"31297cf.fcd1684","type":"comment","name":"pfx = db.grn.prefix[]","info":"","comments":"","x":1044.0357131958008,"y":1973.9285526275635,"z":"d0c367b0.d55ca8","wires":[]},{"id":"37760911.be5b06","type":"get-resource","name":"GET GENERIC_RESOURCE_NAME  (prefix)","xml":"<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'\n\tkey='SELECT * from GENERIC_RESOURCE_NAME WHERE type = $rollback-generated-names-input.naming-type    \n\t\tAND prefix = $tmp.rb.grn.prefix order by name_index'\n  pfx='db.grn.prefix[]'>","comments":"","outputs":1,"x":1023.0356903076172,"y":1936.1785564422607,"z":"d0c367b0.d55ca8","wires":[["5a4d6d80.b5bda4","3d2d0a92.8fb326","430381ee.4fc6b"]]},{"id":"430381ee.4fc6b","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":1312.321434020996,"y":2125.892852783203,"z":"d0c367b0.d55ca8","wires":[["3f64846a.c8c06c"]]},{"id":"3f64846a.c8c06c","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":1461.9643783569336,"y":2126.0356769561768,"z":"d0c367b0.d55ca8","wires":[["5b56358f.06720c","c6c2e25e.9582a"]]},{"id":"eb05862b.646188","type":"comment","name":"Clean up holes in INDEX TABLE","info":"","comments":"","x":781.0000152587891,"y":1880.0000286102295,"z":"d0c367b0.d55ca8","wires":[]},{"id":"761a02e4.28318c","type":"set","name":"set tmp.rb.sql for delete","xml":"<set>\n<parameter name='tmp.rb.sql' \n\tvalue=\"`'DELETE from ' + $rollback-generated-names.index-table-name \n\t\t+ ' WHERE ' + $rollback-generated-names.index-table.name-prefix-column \n\t\t+ ' = $tmp.rb.grn.prefix'`\" />\n\t\t\n<!--\n+ ' = $tmp.rb.grn.prefix AND index_number = $db.grn.index-table.index-number'`\" />\n-->\t\t\t\t","comments":"","x":1719.7857360839844,"y":1982.9286041259766,"z":"d0c367b0.d55ca8","wires":[]},{"id":"e3b8fba6.d6a5d8","type":"get-resource","name":"DELETE from INDEX TABLE","xml":"<update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'\n  key=\"`$tmp.rb.sql`\">\n\n","comments":"","outputs":1,"x":1735.9642639160156,"y":2028.5476379394531,"z":"d0c367b0.d55ca8","wires":[["8a19c44d.2f7a68","83735701.520468"]]},{"id":"87b45267.a3082","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='error-message' value=\"`'Error deleting '\n\t+ $rollback-generated-names.index-table-name \n\t+ ' WHERE ' + $rollback-generated-names.name-prefix-column \n\t+ ' = ' + $tmp.rb.grn.prefix \n\t+ ' AND index_number = ' + $db.index-table.index-number`\" />\n\n","comments":"","x":2126.5357971191406,"y":2028.4287118911743,"z":"d0c367b0.d55ca8","wires":[]},{"id":"8a19c44d.2f7a68","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":1953.5357971191406,"y":2028.9287118911743,"z":"d0c367b0.d55ca8","wires":[["87b45267.a3082"]]},{"id":"83735701.520468","type":"not-found","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":1960.3811988830566,"y":2075.416853904724,"z":"d0c367b0.d55ca8","wires":[["8dd77dea.9bf17"]]},{"id":"f0c8fc09.c807b","type":"comment","name":"Delete prefix from INDEX TABLE","info":"","comments":"","x":1990.035873413086,"y":1984.9286756515503,"z":"d0c367b0.d55ca8","wires":[]},{"id":"8771620a.4a45","type":"comment","name":"Silence SUCCESS","info":"","comments":"","x":2217.035804748535,"y":2086.9286193847656,"z":"d0c367b0.d55ca8","wires":[]},{"id":"8dd77dea.9bf17","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":2109.285800933838,"y":2075.1786212921143,"z":"d0c367b0.d55ca8","wires":[[]]},{"id":"a9dae2af.d2f53","type":"block","name":"block","xml":"<block>","atomic":"false","comments":"","outputs":1,"x":1466.5000228881836,"y":1983.2500286102295,"z":"d0c367b0.d55ca8","wires":[["761a02e4.28318c","e3b8fba6.d6a5d8"]]},{"id":"5b56358f.06720c","type":"set","name":"set tmp.rb.grn.last-max-index","xml":"<set>\n<parameter name='tmp.rb.grn.last-max-index' \n\tvalue='`$db.grn.prefix[$db.grn.prefix_length - 1].name-index`' />\n","comments":"","x":1685.0000228881836,"y":2126.2500324249268,"z":"d0c367b0.d55ca8","wires":[]},{"id":"c6c2e25e.9582a","type":"switchNode","name":"switch: index_number > last-max-index","xml":"<switch test=\"`$tmp.rb.net-index > $tmp.rb.grn.last-max-index`\">","comments":"","outputs":1,"x":1714.2500305175781,"y":2170.2500324249268,"z":"d0c367b0.d55ca8","wires":[["2a0f937.5be026c"]]},{"id":"2a0f937.5be026c","type":"outcomeTrue","name":"true","xml":"<outcome value='true'>\n","comments":"","outputs":1,"x":1954.25,"y":2169.75,"z":"d0c367b0.d55ca8","wires":[["6bcac8c3.2d4898"]]},{"id":"f6ae0895.c117f8","type":"set","name":"set tmp.rb.sql for update","xml":"<set>\n<parameter name='tmp.rb.sql' \n\tvalue=\"`'UPDATE ' + $rollback-generated-names.index-table-name \n\t\t+ ' set index_number = ' + $tmp.rb.grn.last-max-index\n\t\t+ ' WHERE ' + $rollback-generated-names.index-table.name-prefix-column \n\t\t+ ' = $tmp.rb.grn.prefix'`\" />","comments":"","x":2302.500030517578,"y":2169.7500324249268,"z":"d0c367b0.d55ca8","wires":[]},{"id":"877a352a.7a0348","type":"get-resource","name":"Update  INDEX TABLE","xml":"<update plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'\n  key=\"`$tmp.rb.sql`\">\n\n","comments":"","outputs":1,"x":2298.6785583496094,"y":2214.3690662384033,"z":"d0c367b0.d55ca8","wires":[["5993fe93.97069","ba617526.0c8828"]]},{"id":"35689d99.980fa2","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='error-message' value=\"`'Error updating  '\n\t+ $rollback-generated-names.index-table-name + '.index_number = ' \n\t+ $tmp.rb.grn.last-max-index\n\t+ ' WHERE ' + $rollback-generated-names.name-prefix-column \n\t+ ' = ' + $tmp.rb.grn.prefix`\" />\n\n","comments":"","x":2681.2500381469727,"y":2215.2502768039703,"z":"d0c367b0.d55ca8","wires":[]},{"id":"5993fe93.97069","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":2508.2500915527344,"y":2214.7501401901245,"z":"d0c367b0.d55ca8","wires":[["35689d99.980fa2"]]},{"id":"ba617526.0c8828","type":"not-found","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":2515.0954933166504,"y":2261.2382822036743,"z":"d0c367b0.d55ca8","wires":[["35689d99.980fa2"]]},{"id":"ab893117.4bf84","type":"comment","name":"Update prefix from INDEX TABLE","info":"","comments":"","x":2254.5000915527344,"y":2247.00004529953,"z":"d0c367b0.d55ca8","wires":[]},{"id":"6bcac8c3.2d4898","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":2103.75,"y":2170,"z":"d0c367b0.d55ca8","wires":[["f6ae0895.c117f8","877a352a.7a0348"]]},{"id":"7e2b366.e1ab2c8","type":"set","name":"set db.grn.distinct-prefix_length = 0","xml":"<set>\n<parameter name='db.grn.distinct-prefix_length' value='0' />\n","comments":"","x":1127.500015258789,"y":788.0000133514404,"z":"d0c367b0.d55ca8","wires":[]},{"id":"60ca91f4.f6268","type":"service-logic","name":"GENERIC-RESOURCE-API ${project.version}","module":"GENERIC-RESOURCE-API","version":"${project.version}","comments":"","xml":"<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='GENERIC-RESOURCE-API' version='${project.version}'>","outputs":1,"x":438.3333740234375,"y":68.33333587646484,"z":"d0c367b0.d55ca8","wires":[["468f67a9.c0fe68"]]},{"id":"8ec44038.4f2ac","type":"set","name":"set tmp.rb.naming-index-table-name and prefix column, grn.type","xml":"<set>\n<parameter name='rollback-generated-names.index-table-name' value='VNF_NAME_INDEX' />\n<parameter name='rollback-generated-names.index-table.name-prefix-column' \n\tvalue='vnf_name_prefix' />\n\n","comments":"","x":1390,"y":570.3333129882812,"z":"d0c367b0.d55ca8","wires":[]},{"id":"5fa679c.78e5088","type":"set","name":"set tmp.rb.naming-index-table-name and prefix column, grn.type","xml":"<set>\n<parameter name='rollback-generated-names.index-table-name' \n\tvalue='NETWORK_INSTANCE_NAME_INDEX' />\n<parameter name='rollback-generated-names.index-table.name-prefix-column' \n\tvalue='network_instance_name_prefix' />\n\n","comments":"","x":1387,"y":475,"z":"d0c367b0.d55ca8","wires":[]},{"id":"82455610.85dad8","type":"set","name":"set tmp.rb.naming-index-table-name and prefix column, grn.type","xml":"<set>\n<parameter name='rollback-generated-names.index-table-name' \n\tvalue='SERVICE_INSTANCE_NAME_INDEX' />\n<parameter name='rollback-generated-names.index-table.name-prefix-column' \n\tvalue='service_instance_name_prefix' />\n\n","comments":"","x":1387,"y":525,"z":"d0c367b0.d55ca8","wires":[]}]