[{"id":"9c9c3e21.d56a6","type":"comment","name":"Validation of required data","info":"","comments":"","x":1056.88330078125,"y":613.7232250486102,"z":"815459fd.39651","wires":[]},{"id":"1a2b74f1.a32c9b","type":"dgstart","name":"DGSTART","outputs":1,"x":101.91905430385032,"y":183.4136562347412,"z":"815459fd.39651","wires":[["ad9cae41.b540d8"]]},{"id":"ad9cae41.b540d8","type":"service-logic","name":"GENERIC-RESOURCE-API 0.0.1","module":"GENERIC-RESOURCE-API","version":"0.0.1","comments":"","xml":"<service-logic xmlns='http://www.openecomp.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='0.0.1'>","outputs":1,"x":217.20476531982422,"y":224.6517734527588,"z":"815459fd.39651","wires":[["1aae3c3b.93e23c"]]},{"id":"1aae3c3b.93e23c","type":"method","name":"method generate-unique-name","xml":"<method rpc='generate-unique-name' mode='sync'>\n","comments":"","outputs":1,"x":173.2643585205078,"y":266.3303112302508,"z":"815459fd.39651","wires":[["be84dd11.a69268"]]},{"id":"4c99ddb7.73e334","type":"comment","name":"generate-unique-name","info":"Input arguments:\ngenerate-unique-name-input.index-table-name - name of INDEX table\ngenerate-unique-name-input.index-table-prefix-column - name of prefix column in above table\ngenerate-unique-name-input.name-table-name - name of table holding all generated names\ngenerate-unique-name-input.index-length - non-null digit if index should be fixed length\n\nOutput arguments:\ngenerate-unique-name-output.generated-name - generated name (null if error)\ngenerate-unique-name-output.error-message - error message (non-null if error)\n","comments":"","x":496.26391056605735,"y":131,"z":"815459fd.39651","wires":[]},{"id":"2bb7603f.2a5648","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":551.8000030517578,"y":1560.5834183011737,"z":"815459fd.39651","wires":[["d90c8046.641c58","f3b600f1.053738","5b526908.c19e1","31f4c41e.abe88c","31eb5844.7865e8","58d2ce6b.3b9048","41884cf2.29260c","ee4ab844.a42118","ef57f8e2.7c7d7","daa5fca3.255d2","abf49007.ade958"]]},{"id":"d90c8046.641c58","type":"switchNode","name":"switch generate-unique-name-input.index-table-name","xml":"<switch test='`$generate-unique-name-input.index-table-name`'>\n","comments":"","outputs":1,"x":993.4666900634766,"y":659.3333629880633,"z":"815459fd.39651","wires":[["8caf9197.8bb528"]]},{"id":"8caf9197.8bb528","type":"outcome","name":"NULL","xml":"<outcome value=''>","comments":"","outputs":1,"x":1323.466609954834,"y":659.3333524976458,"z":"815459fd.39651","wires":[["ade07c82.bdf0e8"]]},{"id":"ade07c82.bdf0e8","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.index-table-name not supplied' />\n","comments":"","x":1496.7999305725098,"y":659.333343914577,"z":"815459fd.39651","wires":[]},{"id":"f3b600f1.053738","type":"switchNode","name":"switch generate-unique-name-input.index-table-prefix-column","xml":"<switch test='`$generate-unique-name-input.index-table-prefix-column`'>\n","comments":"","outputs":1,"x":1018.4666595458984,"y":702.6666988645281,"z":"815459fd.39651","wires":[["3efc891.3f48576"]]},{"id":"3efc891.3f48576","type":"outcome","name":"NULL","xml":"<outcome value=''>","comments":"","outputs":1,"x":1321.7999229431152,"y":702.6666778836932,"z":"815459fd.39651","wires":[["9684f7fe.7a9ba"]]},{"id":"9684f7fe.7a9ba","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.index-table-prefix-column not supplied' />\n","comments":"","x":1495.1332397460938,"y":703.0000213895526,"z":"815459fd.39651","wires":[]},{"id":"5b526908.c19e1","type":"switchNode","name":"switch generate-unique-name-input.name-table-type","xml":"<switch test='`$generate-unique-name-input.name-table-type`'>\n","comments":"","outputs":1,"x":989.466667175293,"y":747.6666912351336,"z":"815459fd.39651","wires":[["d262123e.4ea1f8"]]},{"id":"d262123e.4ea1f8","type":"outcome","name":"NULL","xml":"<outcome value=''>","comments":"","outputs":1,"x":1321.7998638153076,"y":747.6667007718768,"z":"815459fd.39651","wires":[["f30d92b5.aedcd"]]},{"id":"f30d92b5.aedcd","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.name-table-type not supplied' />\n","comments":"","x":1493.466640472412,"y":748.0000042234149,"z":"815459fd.39651","wires":[]},{"id":"41884cf2.29260c","type":"get-resource","name":"get-resource current name index","xml":"<get-resource plugin='org.openecomp.sdnc.sli.resource.sql.SqlResource' resource='SQL'\n key=\"`$tmp.gun.sql`\" pfx='tmp.gun.prefixdb'>\n\n","comments":"","outputs":1,"x":921.1332702636719,"y":1188.428392818996,"z":"815459fd.39651","wires":[["79c4efc5.45a2e8","302b87aa.f8d91","14f2d9a0.55df8e"]]},{"id":"79c4efc5.45a2e8","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":1146.3237380981445,"y":1266.9522995267596,"z":"815459fd.39651","wires":[["b0d87954.ac2c18"]]},{"id":"b0d87954.ac2c18","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n <parameter name=\"generate-unique-name-output.error-message\" value=\"`'Error reading the ' + $generate-unique-name-input.index-table-name + ' table'`\" />\n","comments":"","x":1308.9428596496582,"y":1268.3810276303973,"z":"815459fd.39651","wires":[]},{"id":"3439b70a.51c228","type":"for","name":"for idx from current index to list-end","xml":"<for index='tmp.gun.idx' start='`$tmp.gun.index-number`' end='`$tmp.gun.list-end`' >\n","comments":"","outputs":1,"x":1073.4666748046875,"y":1591.0000085830688,"z":"815459fd.39651","wires":[["13f86661.e45112"]]},{"id":"31f4c41e.abe88c","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":836.0856704711914,"y":1590.9999737058367,"z":"815459fd.39651","wires":[["3439b70a.51c228","749952fe.f825bc"]]},{"id":"749952fe.f825bc","type":"returnSuccess","name":"CATCH BREAK","xml":"<return status='success'>\n\n","comments":"","x":1024.4190826416016,"y":2166.0001043592183,"z":"815459fd.39651","wires":[]},{"id":"31eb5844.7865e8","type":"switchNode","name":"switch generate-unique-name-input.prefix","xml":"<switch test='`$generate-unique-name-input.prefix`'>\n","comments":"","outputs":1,"x":955.1333084106445,"y":792.6666702542987,"z":"815459fd.39651","wires":[["3ccdcc9d.5093ec"]]},{"id":"3ccdcc9d.5093ec","type":"outcome","name":"NULL","xml":"<outcome value=''>","comments":"","outputs":1,"x":1322.4664974212646,"y":792.6666950498309,"z":"815459fd.39651","wires":[["e5203ace.1332"]]},{"id":"e5203ace.1332","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.prefix not supplied' />\n","comments":"","x":1495.1332740783691,"y":792.999998501369,"z":"815459fd.39651","wires":[]},{"id":"58d2ce6b.3b9048","type":"switchNode","name":"switch generate-unique-name-input.index-length","xml":"<switch test='`$generate-unique-name-input.index-length`'>\n","comments":"","outputs":1,"x":978.4666748046875,"y":927.6666120801654,"z":"815459fd.39651","wires":[["d829997c.7eec1","1f4a169e.20ea29","23c759c7.75726e","b452d05b.906ab8","28d2099f.32a4c6"]]},{"id":"d829997c.7eec1","type":"outcome","name":"NULL","xml":"<outcome value=''>","comments":"","outputs":1,"x":1321.7999877929688,"y":835.999998501369,"z":"815459fd.39651","wires":[["c26b3e39.74464"]]},{"id":"28d2099f.32a4c6","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":1319.1333770751953,"y":1012.6666588102069,"z":"815459fd.39651","wires":[["cd46a64b.182b58"]]},{"id":"1f4a169e.20ea29","type":"outcome","name":"1","xml":"<outcome value='1'>\n","comments":"","outputs":1,"x":1320.1333351135254,"y":881.0000385556903,"z":"815459fd.39651","wires":[["b6096d92.9495b"]]},{"id":"23c759c7.75726e","type":"outcome","name":"2","xml":"<outcome value='2'>\n","comments":"","outputs":1,"x":1320.1333198547363,"y":926.0000290189471,"z":"815459fd.39651","wires":[["31ef97e2.d79f58"]]},{"id":"b452d05b.906ab8","type":"outcome","name":"3","xml":"<outcome value='3'>\n","comments":"","outputs":1,"x":1318.4666557312012,"y":969.3333648954119,"z":"815459fd.39651","wires":[["10d523e0.83151c"]]},{"id":"b6096d92.9495b","type":"set","name":"set list-end = 10","xml":"<set>\n<parameter name='tmp.gun.list-end' value='10' />\n","comments":"","x":1502.8000717163086,"y":881.0000271115985,"z":"815459fd.39651","wires":[]},{"id":"31ef97e2.d79f58","type":"set","name":"set list-end = 100","xml":"<set>\n<parameter name='tmp.gun.list-end' value='100' />\n","comments":"","x":1506.13330078125,"y":926.0000290189471,"z":"815459fd.39651","wires":[]},{"id":"10d523e0.83151c","type":"set","name":"set list-end = 1000","xml":"<set>\n<parameter name='tmp.gun.list-end' value='1000' />\n","comments":"","x":1508.13330078125,"y":969.3333420072283,"z":"815459fd.39651","wires":[]},{"id":"cd46a64b.182b58","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.prefix not supplied' />\n","comments":"","x":1490.13330078125,"y":1012.0000290189471,"z":"815459fd.39651","wires":[]},{"id":"adc50be3.80b89","type":"set","name":"set new index number to 1","xml":"<set>\n<parameter name='tmp.gun.index-number' value='1' />\n","comments":"","x":1481.5620803833008,"y":1211.5716842923846,"z":"815459fd.39651","wires":[]},{"id":"c26b3e39.74464","type":"set","name":"set list-end = 10000 (infinity basically)","xml":"<set>\n<parameter name='tmp.gun.list-end' value='10000' />\n","comments":"","x":1570.7999267578125,"y":836.3333420072283,"z":"815459fd.39651","wires":[]},{"id":"a52ed35f.a619d","type":"switchNode","name":"switch generate-unique-name-input.index-length","xml":"<switch test='`$generate-unique-name-input.index-length`'>\n","comments":"","outputs":1,"x":1635.1332550048828,"y":1517.666647366115,"z":"815459fd.39651","wires":[["82fa14d.9b847e8","b2207f7b.dc1388","df3ec92d.7f2b1","eeade36e.4e62"]]},{"id":"82fa14d.9b847e8","type":"outcome","name":"NULL","xml":"<outcome value=''>","comments":"","outputs":1,"x":1915.1332550048828,"y":1447.6667084012713,"z":"815459fd.39651","wires":[["97c34052.dfceb"]]},{"id":"b2207f7b.dc1388","type":"outcome","name":"1","xml":"<outcome value='1'>\n","comments":"","outputs":1,"x":1913.4666023254395,"y":1492.6667484555926,"z":"815459fd.39651","wires":[["97c34052.dfceb"]]},{"id":"df3ec92d.7f2b1","type":"outcome","name":"2","xml":"<outcome value='2'>\n","comments":"","outputs":1,"x":1913.4666900634766,"y":1546.0000957761492,"z":"815459fd.39651","wires":[["40b75c28.7bace4"]]},{"id":"eeade36e.4e62","type":"outcome","name":"3","xml":"<outcome value='3'>\n","comments":"","outputs":1,"x":1913.466567993164,"y":1642.6668285642352,"z":"815459fd.39651","wires":[["2e943d4c.f74eb2"]]},{"id":"97c34052.dfceb","type":"set","name":"set index-string to idx","xml":"<set>\n<parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />\n","comments":"","x":2100.133403778076,"y":1466.0000519071307,"z":"815459fd.39651","wires":[]},{"id":"40b75c28.7bace4","type":"switchNode","name":"switch idx < 10","xml":"<switch test='`$tmp.gun.idx < 10`'>\n","comments":"","outputs":1,"x":2080.1333198547363,"y":1545.9999937329974,"z":"815459fd.39651","wires":[["8304e65a.4b4b4","2ce6a205.cb4ece"]]},{"id":"8304e65a.4b4b4","type":"outcomeTrue","name":"true","xml":"<outcome value='true'>\n","comments":"","outputs":1,"x":2241.7999534606934,"y":1519.3333668027606,"z":"815459fd.39651","wires":[["d99e4d51.ae11d"]]},{"id":"2ce6a205.cb4ece","type":"outcomeFalse","name":"false","xml":"<outcome value='false'>\n","comments":"","outputs":1,"x":2241.7999114990234,"y":1567.6667026792254,"z":"815459fd.39651","wires":[["b2113d97.bcb05"]]},{"id":"d99e4d51.ae11d","type":"set","name":"set index-string to '0' + idx","xml":"<set>\n<parameter name='tmp.gun.index-string' value=\"`'' + '0' + $tmp.gun.idx`\" />\n","comments":"","x":2433.46671295166,"y":1518.6665939603533,"z":"815459fd.39651","wires":[]},{"id":"b2113d97.bcb05","type":"set","name":"set index-string to idx","xml":"<set>\n<parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />\n","comments":"","x":2416.799964904785,"y":1567.3333095823016,"z":"815459fd.39651","wires":[]},{"id":"2e943d4c.f74eb2","type":"switchNode","name":"switch idx < 10","xml":"<switch test='`$tmp.gun.idx < 10`'>\n","comments":"","outputs":1,"x":2081.799903869629,"y":1640.999956539699,"z":"815459fd.39651","wires":[["ec7f858.347ae78","9979b662.4c54d"]]},{"id":"ec7f858.347ae78","type":"outcomeTrue","name":"true","xml":"<outcome value='true'>\n","comments":"","outputs":1,"x":2241.7998809814453,"y":1614.3333343778338,"z":"815459fd.39651","wires":[["aea9e66b.e585e8"]]},{"id":"9979b662.4c54d","type":"outcomeFalse","name":"false","xml":"<outcome value='false'>\n","comments":"","outputs":1,"x":2243.466537475586,"y":1689.3332924161639,"z":"815459fd.39651","wires":[["4612898e.25b698"]]},{"id":"aea9e66b.e585e8","type":"set","name":"set index-string to '00' + idx","xml":"<set>\n<parameter name='tmp.gun.index-string' value=\"`'' + '00' + $tmp.gun.idx`\" />\n","comments":"","x":2436.7999725341797,"y":1614.3332252502441,"z":"815459fd.39651","wires":[]},{"id":"4612898e.25b698","type":"switchNode","name":"switch idx < 100","xml":"<switch test='`$tmp.gun.idx < 100`'>\n","comments":"","outputs":1,"x":2399.799919128418,"y":1687.666653088161,"z":"815459fd.39651","wires":[["cb47dfbc.885b68","3880cbe0.99a1b4"]]},{"id":"cb47dfbc.885b68","type":"outcomeTrue","name":"true","xml":"<outcome value='true'>\n","comments":"","outputs":1,"x":2556.7998962402344,"y":1661.0000309262957,"z":"815459fd.39651","wires":[["88ab4486.8cf4c"]]},{"id":"3880cbe0.99a1b4","type":"outcomeFalse","name":"false","xml":"<outcome value='false'>\n","comments":"","outputs":1,"x":2556.7998542785645,"y":1709.3333668027606,"z":"815459fd.39651","wires":[["3cd1d056.0e4eb"]]},{"id":"88ab4486.8cf4c","type":"set","name":"set index-string to '0' + idx","xml":"<set>\n<parameter name='tmp.gun.index-string' value=\"`'' + '0' + $tmp.gun.idx`\" />\n","comments":"","x":2749.466682434082,"y":1660.6666855130877,"z":"815459fd.39651","wires":[]},{"id":"3cd1d056.0e4eb","type":"set","name":"set index-string to idx","xml":"<set>\n<parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />\n","comments":"","x":2733.466667175293,"y":1708.9999889646258,"z":"815459fd.39651","wires":[]},{"id":"ede00228.67c58","type":"set","name":"set generated-name to prefix + index-string","xml":"<set>\n<parameter name='tmp.gun.generated-name' value='`$generate-unique-name-input.prefix + $tmp.gun.index-string`' />\n","comments":"","x":1619.1333465576172,"y":1794.3332962308612,"z":"815459fd.39651","wires":[]},{"id":"a20f8849.e271d8","type":"set","name":"increment index number","xml":"<set>\n<parameter name='tmp.gun.index-number' value='`$tmp.gun.prefixdb.index-number + 1`' />\n","comments":"","x":1473.4666748046875,"y":1121.6190225396838,"z":"815459fd.39651","wires":[]},{"id":"a7b80904.72e65","type":"comment","name":"First check from the current index to the max index","info":"","comments":"","x":1036.8000183105469,"y":1529.333377293178,"z":"815459fd.39651","wires":[]},{"id":"1f33f7de.a26d8","type":"comment","name":"check if we've used this name before","info":"","comments":"","x":1615.8478698730469,"y":1878.619441986084,"z":"815459fd.39651","wires":[]},{"id":"f1cdba00.3ba7b","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":1723.4666709899902,"y":1956.000224522182,"z":"815459fd.39651","wires":[["c8e5bd88.33f2c"]]},{"id":"e2012ba9.7a3398","type":"set","name":"set generate-unique-name-output.error-message","xml":"<set>\n<parameter name='generate-unique-name-output.error-message' value=\"`'Error reading the GENERIC_RESOURCE_NAME table'`\" />\n","comments":"","x":2169.4189224243164,"y":1929.5715574537005,"z":"815459fd.39651","wires":[]},{"id":"ef751cba.ba39c","type":"returnFailure","name":"BREAK","xml":"<return status='failure'>\n","comments":"","x":2034.657169342041,"y":1974.5716451917376,"z":"815459fd.39651","wires":[]},{"id":"1aaa10fa.b84327","type":"returnFailure","name":"BREAK","xml":"<return status='failure'>\n","comments":"","x":2037.5141906738281,"y":2069.4763359342305,"z":"815459fd.39651","wires":[]},{"id":"7cd6c217.f307b4","type":"comment","name":"found one we can use","info":"","comments":"","x":1855.3716468811035,"y":2000.5242580686297,"z":"815459fd.39651","wires":[]},{"id":"ee4ab844.a42118","type":"switchNode","name":"switch generate-unique-name-output.error-message","xml":"<switch test='`$generate-unique-name-output.error-message`'>\n","comments":"","outputs":1,"x":987.6333618164062,"y":2283.857244900295,"z":"815459fd.39651","wires":[["867fce46.b695c","d0e39f9f.c2b31"]]},{"id":"867fce46.b695c","type":"outcome","name":"NULL","xml":"<outcome value=''>","comments":"","outputs":1,"x":1260.9667701721191,"y":2257.19049685342,"z":"815459fd.39651","wires":[["7571ec9c.5b8d1c"]]},{"id":"7571ec9c.5b8d1c","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":1395.9667701721191,"y":2257.19049685342,"z":"815459fd.39651","wires":[[]]},{"id":"d0e39f9f.c2b31","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":1260.9667358398438,"y":2307.190517834255,"z":"815459fd.39651","wires":[["ae2f9429.00a2d"]]},{"id":"ae2f9429.00a2d","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n","comments":"","x":1410.9667358398438,"y":2307.190517834255,"z":"815459fd.39651","wires":[]},{"id":"ef57f8e2.7c7d7","type":"switchNode","name":"switch found-flag","xml":"<switch test='`$tmp.gun.found-flag`'>\n","comments":"","outputs":1,"x":859.3476715087891,"y":2566.7143644605367,"z":"815459fd.39651","wires":[["c14ca26.de4e86","a2c0f526.551af8"]]},{"id":"c14ca26.de4e86","type":"outcome","name":"true","xml":"<outcome value='true'>","comments":"","outputs":1,"x":1033.6810111999512,"y":2566.714365414211,"z":"815459fd.39651","wires":[["61435f31.cb022"]]},{"id":"8be111ce.28a5e8","type":"set","name":"set generate-unique-name-output.generated-name","xml":"<set>\n<parameter name='generate-unique-name-output.generated-name' value='`$tmp.gun.generated-name`' />\n","comments":"","x":1504.3476257324219,"y":2411.714651516506,"z":"815459fd.39651","wires":[]},{"id":"94df5fb4.706fb","type":"returnSuccess","name":"return success","xml":"<return status='success'>\n","comments":"","x":1386.3951950073242,"y":2749.0954460416524,"z":"815459fd.39651","wires":[]},{"id":"61435f31.cb022","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":1185.347640991211,"y":2566.04777949197,"z":"815459fd.39651","wires":[["8be111ce.28a5e8","78663c74.7673a4","3451e34f.617e34","94df5fb4.706fb","b7b12523.204aa8"]]},{"id":"af0bf984.64fc58","type":"set","name":"set index-exists flag to false","xml":"<set>\n<parameter name='tmp.gun.index-exists' value='false' />\n","comments":"","x":1485.6094665527344,"y":1165.2857441220965,"z":"815459fd.39651","wires":[]},{"id":"f7e17554.31eec","type":"set","name":"set index-exists flag to true","xml":"<set>\n<parameter name='tmp.gun.index-exists' value='true' />\n","comments":"","x":1481.7524795532227,"y":1076.7142965112414,"z":"815459fd.39651","wires":[]},{"id":"b1142e6.2fc40d","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":1288.4667510986328,"y":1098.1429025445666,"z":"815459fd.39651","wires":[["f7e17554.31eec","a20f8849.e271d8"]]},{"id":"78663c74.7673a4","type":"switchNode","name":"switch index-exists","xml":"<switch test='`$tmp.gun.index-exists`'>\n","comments":"","outputs":1,"x":1400.109634399414,"y":2543.8576530729024,"z":"815459fd.39651","wires":[["1fcd6a56.015186","7267f95c.67caf8"]]},{"id":"1fcd6a56.015186","type":"outcomeTrue","name":"true","xml":"<outcome value='true'>\n","comments":"","outputs":1,"x":1578.6809997558594,"y":2519.5719208036153,"z":"815459fd.39651","wires":[["5b9b847.579547c"]]},{"id":"7267f95c.67caf8","type":"outcomeFalse","name":"false","xml":"<outcome value='false'>\n","comments":"","outputs":1,"x":1578.6810150146484,"y":2566.7148460660665,"z":"815459fd.39651","wires":[["7027ae6b.f4b178"]]},{"id":"89c7c8c8.b5d17","type":"save","name":"save (update) name index","xml":"<save plugin='org.openecomp.sdnc.sli.resource.sql.SqlResource' resource='SQL'\n key=\"`$tmp.gun.sql`\" pfx='pfx'>\n","comments":"","outputs":1,"x":1974.3953247070312,"y":2521.0003370557515,"z":"815459fd.39651","wires":[["c4bb1f67.2b8208"]]},{"id":"6b1a2c58.f6463c","type":"save","name":"save (insert) name index","xml":"<save plugin='org.openecomp.sdnc.sli.resource.sql.SqlResource' resource='SQL'\n key=\"`$tmp.gun.sql`\" pfx='pfx'>\n","comments":"","outputs":1,"x":1967.2523040771484,"y":2615.285805157253,"z":"815459fd.39651","wires":[["2efbba48.fa9f46"]]},{"id":"c4bb1f67.2b8208","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":2167.25252532959,"y":2521.000356129238,"z":"815459fd.39651","wires":[["de5804d8.43d0a"]]},{"id":"2efbba48.fa9f46","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":2164.3950958251953,"y":2613.8573211942403,"z":"815459fd.39651","wires":[["1461e83f.8fcd2"]]},{"id":"3451e34f.617e34","type":"save","name":"save (insert) generated name","xml":"<save plugin='org.openecomp.sdnc.sli.resource.sql.SqlResource' resource='SQL'\n key=\"`$tmp.gun.sql`\" pfx='pfx'>\n","comments":"","outputs":1,"x":1434.538230895996,"y":2702.428627422878,"z":"815459fd.39651","wires":[["38c79c2c.b4756c"]]},{"id":"38c79c2c.b4756c","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":1644.5381622314453,"y":2702.428678921291,"z":"815459fd.39651","wires":[["ab33c5a7.dcc0b8"]]},{"id":"ab33c5a7.dcc0b8","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n <parameter name=\"generate-unique-name-output.error-message\" value=\"Failed insert into GENERIC_RESOURCE_NAME table\" />\n","comments":"","x":1798.8239784240723,"y":2702.4286979947774,"z":"815459fd.39651","wires":[]},{"id":"daa5fca3.255d2","type":"set","name":"set sql statement","xml":"<set>\n<parameter name='tmp.gun.sql' value=\"`'SELECT * from ' + $generate-unique-name-input.index-table-name\n+ ' WHERE ' + $generate-unique-name-input.index-table-prefix-column + ' = '\n+ '$generate-unique-name-input.prefix'`\" />\n","comments":"","x":877.0381546020508,"y":1056.7143959317889,"z":"815459fd.39651","wires":[]},{"id":"13f86661.e45112","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":1315.6095352172852,"y":1589.5714878354754,"z":"815459fd.39651","wires":[["a52ed35f.a619d","ede00228.67c58","2f2db390.dd18b4","5e3d7ef1.ce61d"]]},{"id":"c8e5bd88.33f2c","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":1875.8476676940918,"y":1955.5241436277117,"z":"815459fd.39651","wires":[["e2012ba9.7a3398","ef751cba.ba39c"]]},{"id":"5b9b847.579547c","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":1755.966812133789,"y":2496.714449337551,"z":"815459fd.39651","wires":[["27cff0af.71a1a8","89c7c8c8.b5d17"]]},{"id":"7027ae6b.f4b178","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":1753.1096649169922,"y":2592.4287676130025,"z":"815459fd.39651","wires":[["6b1a2c58.f6463c","efa8896f.d07148"]]},{"id":"27cff0af.71a1a8","type":"set","name":"set sql statement","xml":"<set>\n<parameter name='tmp.gun.sql' value=\"`'update ' + $generate-unique-name-input.index-table-name\n+ ' set index_number = ' + $tmp.gun.index-string + ' where '\n+ $generate-unique-name-input.index-table-prefix-column\n+ ' = $generate-unique-name-input.prefix'`\" />\n","comments":"","x":1944.5380935668945,"y":2472.4284209523885,"z":"815459fd.39651","wires":[]},{"id":"efa8896f.d07148","type":"set","name":"set sql statement","xml":"<set>\n<parameter name='tmp.gun.sql' value=\"`'insert into ' + $generate-unique-name-input.index-table-name\n+ '(' + $generate-unique-name-input.index-table-prefix-column + ', index_number) values ('\n+ ' $generate-unique-name-input.prefix , ' + $tmp.gun.index-string + ')'`\" />\n\n","comments":"","x":1943.1096420288086,"y":2566.7142376218526,"z":"815459fd.39651","wires":[]},{"id":"6dccc1ef.da102","type":"not-found","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":1730.1334075927734,"y":2046.95261996133,"z":"815459fd.39651","wires":[["e3aca01e.dacec"]]},{"id":"c78eb88f.146498","type":"for","name":"for idx from 1 to current index","xml":"<for index='tmp.gun.idx' start='1' end='`$tmp.gun.index-number`' >\n","comments":"","outputs":1,"x":1579.9191818237305,"y":3158.666769436428,"z":"815459fd.39651","wires":[["2219e93c.e8ff8e"]]},{"id":"51214751.d1fbc8","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":1348.2524642944336,"y":3158.666770390102,"z":"815459fd.39651","wires":[["c78eb88f.146498","9ec3e778.91151"]]},{"id":"9ec3e778.91151","type":"returnSuccess","name":"CATCH BREAK","xml":"<return status='success'>\n\n","comments":"","x":1530.8715744018555,"y":3733.666900089809,"z":"815459fd.39651","wires":[]},{"id":"28764d7d.c7ac2a","type":"switchNode","name":"switch generate-unique-name-input.index-length","xml":"<switch test='`$generate-unique-name-input.index-length`'>\n","comments":"","outputs":1,"x":2141.5857467651367,"y":3085.333443096706,"z":"815459fd.39651","wires":[["4cc90e35.6869f8","e1c92d6d.bc2058","c2b50e5a.f02478","a85fdf7a.d2add8"]]},{"id":"4cc90e35.6869f8","type":"outcome","name":"NULL","xml":"<outcome value=''>","comments":"","outputs":1,"x":2421.5857467651367,"y":3015.3335041318624,"z":"815459fd.39651","wires":[["37efe12d.5853c6"]]},{"id":"e1c92d6d.bc2058","type":"outcome","name":"1","xml":"<outcome value='1'>\n","comments":"","outputs":1,"x":2419.9190940856934,"y":3060.3335441861836,"z":"815459fd.39651","wires":[["37efe12d.5853c6"]]},{"id":"c2b50e5a.f02478","type":"outcome","name":"2","xml":"<outcome value='2'>\n","comments":"","outputs":1,"x":2419.9191818237305,"y":3113.6668915067403,"z":"815459fd.39651","wires":[["53bbce6e.e9ae08"]]},{"id":"a85fdf7a.d2add8","type":"outcome","name":"3","xml":"<outcome value='3'>\n","comments":"","outputs":1,"x":2419.919059753418,"y":3210.333624294826,"z":"815459fd.39651","wires":[["708c9f01.058a58"]]},{"id":"37efe12d.5853c6","type":"set","name":"set index-string to idx","xml":"<set>\n<parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />\n","comments":"","x":2606.58589553833,"y":3033.6668476377217,"z":"815459fd.39651","wires":[]},{"id":"53bbce6e.e9ae08","type":"switchNode","name":"switch idx < 10","xml":"<switch test='`$tmp.gun.idx < 10`'>\n","comments":"","outputs":1,"x":2586.5858116149902,"y":3113.6667894635884,"z":"815459fd.39651","wires":[["8575fd95.1a2cb8","faa37e9e.cbd588"]]},{"id":"8575fd95.1a2cb8","type":"outcomeTrue","name":"true","xml":"<outcome value='true'>\n","comments":"","outputs":1,"x":2748.2524452209473,"y":3087.0001625333516,"z":"815459fd.39651","wires":[["c9f6db90.ed3bf"]]},{"id":"faa37e9e.cbd588","type":"outcomeFalse","name":"false","xml":"<outcome value='false'>\n","comments":"","outputs":1,"x":2748.2524032592773,"y":3135.3334984098165,"z":"815459fd.39651","wires":[["ffe607ad.1291a"]]},{"id":"c9f6db90.ed3bf","type":"set","name":"set index-string to '0' + idx","xml":"<set>\n<parameter name='tmp.gun.index-string' value=\"`'' + '0' + $tmp.gun.idx`\" />\n","comments":"","x":2939.919204711914,"y":3086.3333896909444,"z":"815459fd.39651","wires":[]},{"id":"ffe607ad.1291a","type":"set","name":"set index-string to idx","xml":"<set>\n<parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />\n","comments":"","x":2923.252456665039,"y":3135.0001053128926,"z":"815459fd.39651","wires":[]},{"id":"708c9f01.058a58","type":"switchNode","name":"switch idx < 10","xml":"<switch test='`$tmp.gun.idx < 10`'>\n","comments":"","outputs":1,"x":2588.252395629883,"y":3208.66675227029,"z":"815459fd.39651","wires":[["97d62512.465b4","a56b7f05.7ee6d8"]]},{"id":"97d62512.465b4","type":"outcomeTrue","name":"true","xml":"<outcome value='true'>\n","comments":"","outputs":1,"x":2748.252372741699,"y":3182.000130108425,"z":"815459fd.39651","wires":[["9544c9f9.8b8d88"]]},{"id":"a56b7f05.7ee6d8","type":"outcomeFalse","name":"false","xml":"<outcome value='false'>\n","comments":"","outputs":1,"x":2749.91902923584,"y":3257.000088146755,"z":"815459fd.39651","wires":[["6af6f8d2.5bdff8"]]},{"id":"9544c9f9.8b8d88","type":"set","name":"set index-string to '00' + idx","xml":"<set>\n<parameter name='tmp.gun.index-string' value=\"`'' + '00' + $tmp.gun.idx`\" />\n","comments":"","x":2943.252456665039,"y":3182.0001053128926,"z":"815459fd.39651","wires":[]},{"id":"6af6f8d2.5bdff8","type":"switchNode","name":"switch idx < 100","xml":"<switch test='`$tmp.gun.idx < 100`'>\n","comments":"","outputs":1,"x":2906.252410888672,"y":3255.333448818752,"z":"815459fd.39651","wires":[["d2f6dac3.3067","f1aef370.1dca"]]},{"id":"d2f6dac3.3067","type":"outcomeTrue","name":"true","xml":"<outcome value='true'>\n","comments":"","outputs":1,"x":3063.2523880004883,"y":3228.6668266568868,"z":"815459fd.39651","wires":[["a3f93c09.b94c68"]]},{"id":"f1aef370.1dca","type":"outcomeFalse","name":"false","xml":"<outcome value='false'>\n","comments":"","outputs":1,"x":3063.2523460388184,"y":3277.0001625333516,"z":"815459fd.39651","wires":[["66b5ce47.00de2"]]},{"id":"a3f93c09.b94c68","type":"set","name":"set index-string to '0' + idx","xml":"<set>\n<parameter name='tmp.gun.index-string' value=\"`'' + '0' + $tmp.gun.idx`\" />\n","comments":"","x":3255.919174194336,"y":3228.3334812436788,"z":"815459fd.39651","wires":[]},{"id":"66b5ce47.00de2","type":"set","name":"set index-string to idx","xml":"<set>\n<parameter name='tmp.gun.index-string' value='`$tmp.gun.idx`' />\n","comments":"","x":3239.919158935547,"y":3276.666784695217,"z":"815459fd.39651","wires":[]},{"id":"bdd6fd62.a7a3e8","type":"set","name":"set generated-name to prefix + index-string","xml":"<set>\n<parameter name='tmp.gun.generated-name' value='`$generate-unique-name-input.prefix + $tmp.gun.index-string`' />\n","comments":"","x":2125.585838317871,"y":3362.000091961452,"z":"815459fd.39651","wires":[]},{"id":"34bd9b51.b0f2c4","type":"comment","name":"Wrapping around - now check from 1 to the original index","info":"","comments":"","x":1553.2524948120117,"y":3044.143176487514,"z":"815459fd.39651","wires":[]},{"id":"e4c738b5.09d83","type":"comment","name":"check if we've used this name before","info":"","comments":"","x":2112.3002853393555,"y":3477.000365665981,"z":"815459fd.39651","wires":[]},{"id":"583c6a04.040e64","type":"get-resource","name":"get-resource name","xml":"<get-resource plugin='org.openecomp.sdnc.sli.resource.sql.SqlResource' resource='SQL'\n key=\"`$tmp.gun.sql`\" pfx='tmp.gun.namedb'>\n\n","comments":"","outputs":1,"x":2049.919101715088,"y":3617.7144355773926,"z":"815459fd.39651","wires":[["89bf2160.dfb7b","baf26552.043b48"]]},{"id":"89bf2160.dfb7b","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":2228.2524948120117,"y":3572.000272205898,"z":"815459fd.39651","wires":[["fb8fc079.1e77d8"]]},{"id":"2da0ea47.c121be","type":"set","name":"set generate-unique-name-output.error-message","xml":"<set>\n<parameter name='generate-unique-name-output.error-message' value=\"Error reading the GENERIC_RESOURCE_NAME table\" />\n","comments":"","x":2674.204746246338,"y":3545.5716051374166,"z":"815459fd.39651","wires":[]},{"id":"958fa098.04d968","type":"returnFailure","name":"BREAK","xml":"<return status='failure'>\n","comments":"","x":2539.4429931640625,"y":3590.5716928754537,"z":"815459fd.39651","wires":[]},{"id":"a607bdc.33f884","type":"switchNode","name":"switch generate-unique-name-output.error-message","xml":"<switch test='`$generate-unique-name-output.error-message`'>\n","comments":"","outputs":1,"x":1512.3000717163086,"y":3841.5239757810323,"z":"815459fd.39651","wires":[["fb21ca76.e6a0a8","cbee8463.5abd"]]},{"id":"fb21ca76.e6a0a8","type":"outcome","name":"NULL","xml":"<outcome value=''>","comments":"","outputs":1,"x":1785.6334800720215,"y":3814.8572277341573,"z":"815459fd.39651","wires":[["ae2192.db98be7"]]},{"id":"ae2192.db98be7","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":1920.6334800720215,"y":3814.8572277341573,"z":"815459fd.39651","wires":[[]]},{"id":"cbee8463.5abd","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":1785.633445739746,"y":3864.8572487149922,"z":"815459fd.39651","wires":[["7488c39d.2fc9e4"]]},{"id":"7488c39d.2fc9e4","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n","comments":"","x":1935.633445739746,"y":3864.8572487149922,"z":"815459fd.39651","wires":[]},{"id":"968630d4.e3ba48","type":"switchNode","name":"switch found-flag","xml":"<switch test='`$tmp.gun.found-flag`'>\n","comments":"","outputs":1,"x":1394.0143508911133,"y":4021.0478843961446,"z":"815459fd.39651","wires":[["87fd4f0e.54aa38"]]},{"id":"d7f720b6.d1e378","type":"comment","name":"if db name is null we found an index we can use","info":"","comments":"","x":1560.7286911010742,"y":3970.5716594968526,"z":"815459fd.39651","wires":[]},{"id":"87fd4f0e.54aa38","type":"outcome","name":"true","xml":"<outcome value='true'>","comments":"","outputs":1,"x":1553.347671508789,"y":4021.0478414808003,"z":"815459fd.39651","wires":[["5b0ac020.1d8c"]]},{"id":"3b64abd.46fced4","type":"set","name":"set generate-unique-name-output.generated-name","xml":"<set>\n<parameter name='generate-unique-name-output.generated-name' value='`$tmp.gun.generated-name`' />\n","comments":"","x":2029.0143356323242,"y":3969.381382397243,"z":"815459fd.39651","wires":[]},{"id":"5157d8a.7aec1a8","type":"returnSuccess","name":"return success","xml":"<return status='success'>\n<parameter name='' value='' />\n","comments":"","x":1912.4903869628906,"y":4308.190853527614,"z":"815459fd.39651","wires":[]},{"id":"5b0ac020.1d8c","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":1720.0143661499023,"y":4019.3810600553243,"z":"815459fd.39651","wires":[["3b64abd.46fced4","8ca17448.865688","18c7df12.c8f449","5157d8a.7aec1a8","30fee1b0.328f4e"]]},{"id":"8ca17448.865688","type":"switchNode","name":"switch index-exists","xml":"<switch test='`$tmp.gun.index-exists`'>\n","comments":"","outputs":1,"x":1924.7763442993164,"y":4101.52438395364,"z":"815459fd.39651","wires":[["faef6e.b983209","4fa5fc45.9536a4"]]},{"id":"faef6e.b983209","type":"outcomeTrue","name":"true","xml":"<outcome value='true'>\n","comments":"","outputs":1,"x":2103.3477096557617,"y":4077.2386516843526,"z":"815459fd.39651","wires":[["746a09f3.f97ea"]]},{"id":"4fa5fc45.9536a4","type":"outcomeFalse","name":"false","xml":"<outcome value='false'>\n","comments":"","outputs":1,"x":2103.347724914551,"y":4124.381576946804,"z":"815459fd.39651","wires":[["c45a5e4b.d362e"]]},{"id":"f7b6e1cf.1a20f8","type":"save","name":"save (update) name index","xml":"<save plugin='org.openecomp.sdnc.sli.resource.sql.SqlResource' resource='SQL'\n key=\"`$tmp.gun.sql`\" pfx='pfx'>\n","comments":"","outputs":1,"x":2499.0620346069336,"y":4078.667067936489,"z":"815459fd.39651","wires":[["b4fa42a7.4de6f"]]},{"id":"9290ec28.871b68","type":"save","name":"save (insert) name index","xml":"<save plugin='org.openecomp.sdnc.sli.resource.sql.SqlResource' resource='SQL'\n key=\"`$tmp.gun.sql`\" pfx='pfx'>\n","comments":"","outputs":1,"x":2491.919013977051,"y":4172.95253603799,"z":"815459fd.39651","wires":[["d67c7a4a.4b9318"]]},{"id":"b4fa42a7.4de6f","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":2691.919235229492,"y":4078.667087009975,"z":"815459fd.39651","wires":[["36b7cb6f.1526e4"]]},{"id":"36b7cb6f.1526e4","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n <parameter name=\"generate-unique-name-output.error-message\" value=\"`'Failed to update ' + $generate-unique-name-input.index-table-name + ' table'`\" />\n","comments":"","x":2846.205051422119,"y":4078.6671060834615,"z":"815459fd.39651","wires":[]},{"id":"d67c7a4a.4b9318","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":2689.0618057250977,"y":4171.524052074978,"z":"815459fd.39651","wires":[["781ae51.5db729c"]]},{"id":"781ae51.5db729c","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n <parameter name=\"generate-unique-name-output.error-message\" value=\"`'Failed to insert record into ' + $generate-unique-name-input.index-table-name + ' table'`\" />\n","comments":"","x":2843.3476219177246,"y":4171.524071148464,"z":"815459fd.39651","wires":[]},{"id":"18c7df12.c8f449","type":"save","name":"save (insert) generated name","xml":"<save plugin='org.openecomp.sdnc.sli.resource.sql.SqlResource' resource='SQL'\n key=\"`$tmp.gun.sql`\" pfx='pfx'>\n","comments":"","outputs":1,"x":1959.2049407958984,"y":4260.095358303615,"z":"815459fd.39651","wires":[["28aac08f.ba9f6"]]},{"id":"28aac08f.ba9f6","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":2169.2048721313477,"y":4260.095409802028,"z":"815459fd.39651","wires":[["84a0c5c3.0e38f"]]},{"id":"84a0c5c3.0e38f","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n <parameter name=\"generate-unique-name-output.error-message\" value=\"Failed insert into GENERIC_RESOURCE_NAME table\" />\n","comments":"","x":2323.4906883239746,"y":4260.095428875515,"z":"815459fd.39651","wires":[]},{"id":"2219e93c.e8ff8e","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":1822.062026977539,"y":3157.2382835660665,"z":"815459fd.39651","wires":[["28764d7d.c7ac2a","bdd6fd62.a7a3e8","583c6a04.040e64","6a15e97a.43887","552d7ff7.e47298"]]},{"id":"fb8fc079.1e77d8","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":2380.6334915161133,"y":3571.524191311428,"z":"815459fd.39651","wires":[["2da0ea47.c121be","958fa098.04d968"]]},{"id":"746a09f3.f97ea","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":2280.6335220336914,"y":4054.381180218288,"z":"815459fd.39651","wires":[["5a80e34c.340e54","f7b6e1cf.1a20f8"]]},{"id":"c45a5e4b.d362e","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":2277.7763748168945,"y":4150.09549849374,"z":"815459fd.39651","wires":[["9290ec28.871b68","bf62ad1c.b880a8"]]},{"id":"5a80e34c.340e54","type":"set","name":"set sql statement","xml":"<set>\n<parameter name='tmp.gun.sql' value=\"`'update ' + $generate-unique-name-input.index-table-name\n+ ' set index_number = ' + $tmp.gun.index-string + ' where '\n+ $generate-unique-name-input.index-table-prefix-column\n+ ' = $generate-unique-name-input.prefix'`\" />\n","comments":"","x":2469.204803466797,"y":4030.095151833126,"z":"815459fd.39651","wires":[]},{"id":"bf62ad1c.b880a8","type":"set","name":"set sql statement","xml":"<set>\n<parameter name='tmp.gun.sql' value=\"`'insert into ' + $generate-unique-name-input.index-table-name\n+ '(' + $generate-unique-name-input.index-table-prefix-column + ', index_number) values ('\n+ ' $generate-unique-name-input.prefix , ' + $tmp.gun.index-string + ')'`\" />\n\n","comments":"","x":2467.776351928711,"y":4124.38096850259,"z":"815459fd.39651","wires":[]},{"id":"baf26552.043b48","type":"not-found","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":2234.919231414795,"y":3662.952667645046,"z":"815459fd.39651","wires":[["82b7f7fa.6672f8"]]},{"id":"6a15e97a.43887","type":"set","name":"clear namedb.name","xml":"<set>\n<parameter name='tmp.gun.namedb.name' value='' />\n","comments":"","x":2050.633415222168,"y":3412.952600887844,"z":"815459fd.39651","wires":[]},{"id":"7d855b7.633afa4","type":"switchNode","name":"switch generate-unique-name-input.index-length","xml":"<switch test='`$generate-unique-name-input.index-length`'>\n","comments":"","outputs":1,"x":1496.9191436767578,"y":2905.3334411893575,"z":"815459fd.39651","wires":[["ce923cd3.8e2308"]]},{"id":"ce923cd3.8e2308","type":"outcome","name":"NULL","xml":"<outcome value=''>","comments":"","outputs":1,"x":1752.6334762573242,"y":2906.2383503232686,"z":"815459fd.39651","wires":[["8b01f87b.613138"]]},{"id":"8b01f87b.613138","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n <parameter name=\"generate-unique-name-output.error-message\" value=\"We have exhausted the naming index count\" />\n","comments":"","x":1909.7763595581055,"y":2906.2383503232686,"z":"815459fd.39651","wires":[]},{"id":"9932c6f0.d7be","type":"comment","name":"if we get here when there is no index length, then we have used up all 1000","info":"","comments":"","x":1628.3477401733398,"y":2861.952664784023,"z":"815459fd.39651","wires":[]},{"id":"cbd6ef5a.2c87a","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n <parameter name=\"generate-unique-name-output.error-message\" value=\"We have exhausted the naming index count\" />\n","comments":"","x":1388.3477592468262,"y":4421.2383350644795,"z":"815459fd.39651","wires":[]},{"id":"abf49007.ade958","type":"set","name":"set found-flag=false","xml":"<set>\n<parameter name='tmp.gun.found-flag' value='false' />\n","comments":"","x":882.7524185180664,"y":1332.4285988126483,"z":"815459fd.39651","wires":[]},{"id":"8c5f82c3.b5999","type":"set","name":"set found-flag=true","xml":"<set>\n<parameter name='tmp.gun.found-flag' value='true' />\n","comments":"","x":2074.4191093444824,"y":2021.2381881986346,"z":"815459fd.39651","wires":[]},{"id":"e3aca01e.dacec","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":1881.5619316101074,"y":2047.381132534572,"z":"815459fd.39651","wires":[["8c5f82c3.b5999","1aaa10fa.b84327"]]},{"id":"b800310c.fe9408","type":"returnFailure","name":"BREAK","xml":"<return status='failure'>\n","comments":"","x":2539.776210784912,"y":3684.0953830991475,"z":"815459fd.39651","wires":[]},{"id":"e67dd35f.a1d688","type":"comment","name":"found one we can use","info":"","comments":"","x":2357.6336669921875,"y":3615.143305233547,"z":"815459fd.39651","wires":[]},{"id":"ba42760b.fa2f38","type":"set","name":"set found-flag=true","xml":"<set>\n<parameter name='tmp.gun.found-flag' value='true' />\n","comments":"","x":2576.6811294555664,"y":3635.857235363552,"z":"815459fd.39651","wires":[]},{"id":"82b7f7fa.6672f8","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":2383.8239517211914,"y":3662.0001796994893,"z":"815459fd.39651","wires":[["ba42760b.fa2f38","b800310c.fe9408"]]},{"id":"be84dd11.a69268","type":"switchNode","name":"switch generate-unique-name-input.supplied-name","xml":"<switch test='`$generate-unique-name-input.supplied-name`'>\n","comments":"","outputs":1,"x":434.53802490234375,"y":438.8571781430926,"z":"815459fd.39651","wires":[["39b07652.28c332","f539c66d.3d3eb8"]]},{"id":"39b07652.28c332","type":"outcome","name":"NULL","xml":"<outcome value=''>","comments":"","outputs":1,"x":693.1095237731934,"y":465.99997370583674,"z":"815459fd.39651","wires":[["2bb7603f.2a5648"]]},{"id":"f539c66d.3d3eb8","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":693.1095008850098,"y":408.8571438108172,"z":"815459fd.39651","wires":[["d59bbe20.5b5f7"]]},{"id":"9f23cd16.bec0f","type":"switchNode","name":"switch generate-unique-name-input.name-table-type","xml":"<switch test='`$generate-unique-name-input.name-table-type`'>\n","comments":"","outputs":1,"x":1162.3951721191406,"y":344.5714248929705,"z":"815459fd.39651","wires":[["b1fcadbe.cf554"]]},{"id":"b1fcadbe.cf554","type":"outcome","name":"NULL","xml":"<outcome value=''>","comments":"","outputs":1,"x":1495.7283687591553,"y":344.5714344297137,"z":"815459fd.39651","wires":[["a63795d4.9a5d38"]]},{"id":"a63795d4.9a5d38","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='generate-unique-name-output.error-message' value='generate-unique-name-input.name-table-type not supplied' />\n","comments":"","x":1667.3951454162598,"y":344.9047378812518,"z":"815459fd.39651","wires":[]},{"id":"d59bbe20.5b5f7","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":847.3952255249023,"y":407.42857401711603,"z":"815459fd.39651","wires":[["9f23cd16.bec0f","49cbe0ea.56f328","476b8014.965948"]]},{"id":"476b8014.965948","type":"get-resource","name":"get-resource name","xml":"<get-resource plugin='org.openecomp.sdnc.sli.resource.sql.SqlResource' resource='SQL'\n key=\"`$tmp.gun.sql`\" pfx='tmp.gun.namedb'>\n\n","comments":"","outputs":1,"x":1055.9666366577148,"y":437.4285892759051,"z":"815459fd.39651","wires":[["838c4e0d.2a9e48","ce7abeff.e6bf48","ac45ba28.706708"]]},{"id":"838c4e0d.2a9e48","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":1238.5856857299805,"y":424.57148497445246,"z":"815459fd.39651","wires":[["fa29ea47.5c37a8"]]},{"id":"49cbe0ea.56f328","type":"set","name":"set sql statement","xml":"<set>\n<parameter name='tmp.gun.sql' value=\"`'SELECT * from GENERIC_RESOURCE_NAME WHERE type = $generate-unique-name-input.name-table-type'\n+ ' AND name = $generate-unique-name-input.supplied-name'`\" />\n","comments":"","x":1049.5381889343262,"y":389.8096069608416,"z":"815459fd.39651","wires":[]},{"id":"ce7abeff.e6bf48","type":"not-found","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":1246.6810417175293,"y":469.8095955167498,"z":"815459fd.39651","wires":[["ca6a32d3.655a2"]]},{"id":"fa29ea47.5c37a8","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='generate-unique-name-output.error-message' value=\"`'Error reading the ' + $generate-unique-name-input.name-table-index + ' table'`\" />\n\n","comments":"","x":1394.5381088256836,"y":424.14289038521906,"z":"815459fd.39651","wires":[]},{"id":"ac45ba28.706708","type":"other","name":"other","xml":"<outcome value='Other'>\n","comments":"","outputs":1,"x":1238.8238105773926,"y":511.71428912026545,"z":"815459fd.39651","wires":[["98eb6ae5.5954a8"]]},{"id":"98eb6ae5.5954a8","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name='generate-unique-name-output.error-message' value=\"`'The name ' + $generate-unique-name-input.supplied-name + ' has already been used'`\" />\n\n","comments":"","x":1394.5380477905273,"y":511.1428531919207,"z":"815459fd.39651","wires":[]},{"id":"f7a51204.bb90b8","type":"comment","name":"Caller supplied name - make sure it's not already used","info":"","comments":"","x":1192.2523803710938,"y":297.99999659402033,"z":"815459fd.39651","wires":[]},{"id":"ca6a32d3.655a2","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":1395.9667358398438,"y":470.2857021604266,"z":"815459fd.39651","wires":[["34ca7b1d.d047b4","d6f052af.381de"]]},{"id":"d6f052af.381de","type":"save","name":"save (insert) generated name","xml":"<save plugin='org.openecomp.sdnc.sli.resource.sql.SqlResource' resource='SQL'\n key=\"`$tmp.gun.sql`\" pfx='pfx'>\n","comments":"","outputs":1,"x":1635.9667358398438,"y":494.57143824441096,"z":"815459fd.39651","wires":[["6e823b79.5cc254"]]},{"id":"6e823b79.5cc254","type":"failure","name":"failure","xml":"<outcome value='failure'>\n","comments":"","outputs":1,"x":1845.966667175293,"y":494.57148974282404,"z":"815459fd.39651","wires":[["de733429.fcb0b"]]},{"id":"de733429.fcb0b","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n<parameter name=\"generate-unique-name-output.error-message\" value=\"Failed insert into GENERIC_RESOURCE_NAME table\" />\n","comments":"","x":2000.25248336792,"y":494.57150881631037,"z":"815459fd.39651","wires":[]},{"id":"34ca7b1d.d047b4","type":"set","name":"set sql statement","xml":"<set>\n<parameter name='tmp.gun.sql' value=\"`'insert into GENERIC_RESOURCE_NAME values ( '\n+ ' $generate-unique-name-input.name-table-type , $generate-unique-name-input.supplied-name )'`\" />\n\n","comments":"","x":1595.966667175293,"y":444.5716156278338,"z":"815459fd.39651","wires":[]},{"id":"b7b12523.204aa8","type":"set","name":"set sql statement","xml":"<set>\n<parameter name='tmp.gun.sql' value=\"`'insert into GENERIC_RESOURCE_NAME values ( '\n+ ' $generate-unique-name-input.name-table-type , $tmp.gun.generated-name )'`\" />\n\n","comments":"","x":1395.9666900634766,"y":2655.9999880109517,"z":"815459fd.39651","wires":[]},{"id":"552d7ff7.e47298","type":"set","name":"set sql statement","xml":"<set>\n<parameter name='tmp.gun.sql' value=\"`'SELECT * from GENERIC_RESOURCE_NAME WHERE type = $generate-unique-name-input.name-table-type'\n+ ' AND name = $tmp.gun.generated-name'`\" />\n","comments":"","x":2044.0619888305664,"y":3528.3811573301045,"z":"815459fd.39651","wires":[]},{"id":"30fee1b0.328f4e","type":"set","name":"set sql statement","xml":"<set>\n<parameter name='tmp.gun.sql' value=\"`'insert into GENERIC_RESOURCE_NAME values ( '\n+ ' $generate-unique-name-input.name-table-type , $tmp.gun.generated-name )'`\" />\n\n","comments":"","x":1919.7761840820312,"y":4212.666685513088,"z":"815459fd.39651","wires":[]},{"id":"de5804d8.43d0a","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n <parameter name=\"generate-unique-name-output.error-message\" value=\"`'Failed to update ' + $generate-unique-name-input.index-table-name + ' table'`\" />\n","comments":"","x":2318.823875427246,"y":2520.2857050214498,"z":"815459fd.39651","wires":[]},{"id":"1461e83f.8fcd2","type":"returnFailure","name":"return failure","xml":"<return status='failure'>\n <parameter name=\"generate-unique-name-output.error-message\" value=\"`'Failed to insert record into ' + $generate-unique-name-input.index-table-name + ' table'`\" />\n","comments":"","x":2315.9664878845215,"y":2613.571485928127,"z":"815459fd.39651","wires":[]},{"id":"a2c0f526.551af8","type":"outcomeFalse","name":"false","xml":"<outcome value='false'>\n","comments":"","outputs":1,"x":1031.91898727417,"y":2851.0000271115987,"z":"815459fd.39651","wires":[["2da320e7.a153c"]]},{"id":"2da320e7.a153c","type":"block","name":"block : atomic","xml":"<block atomic=\"true\">","atomic":"true","outputs":1,"x":1182.7523956298828,"y":3462.6665510450093,"z":"815459fd.39651","wires":[["7d855b7.633afa4","51214751.d1fbc8","a607bdc.33f884","968630d4.e3ba48","cbd6ef5a.2c87a"]]},{"id":"14f2d9a0.55df8e","type":"success","name":"success","xml":"<outcome value='success'>\n","comments":"","outputs":1,"x":1149.395305633545,"y":1097.4285682950701,"z":"815459fd.39651","wires":[["b1142e6.2fc40d"]]},{"id":"302b87aa.f8d91","type":"not-found","name":"not-found","xml":"<outcome value='not-found'>\n","comments":"","outputs":1,"x":1155.9667701721191,"y":1186.5714420591082,"z":"815459fd.39651","wires":[["ca8d8f3c.52dd98"]]},{"id":"ca8d8f3c.52dd98","type":"block","name":"block","xml":"<block>\n","atomic":"false","comments":"","outputs":1,"x":1287.395320892334,"y":1186.0000480924334,"z":"815459fd.39651","wires":[["af0bf984.64fc58","adc50be3.80b89"]]},{"id":"5e3d7ef1.ce61d","type":"set","name":"set sql statement","xml":"<set>\n<parameter name='tmp.gun.sql' value=\"`'SELECT * from GENERIC_RESOURCE_NAME WHERE type = $generate-unique-name-input.name-table-type'\n+ ' AND name = $tmp.gun.generated-name'`\" />\n","comments":"","x":1539.7405052185059,"y":1919.5714511871338,"z":"815459fd.39651","wires":[]},{"id":"2f2db390.dd18b4","type":"get-resource","name":"get-resource name","xml":"<get-resource plugin='org.openecomp.sdnc.sli.resource.sql.SqlResource' resource='SQL'\n key=\"`$tmp.gun.sql`\" pfx='tmp.gun.namedb'>\n\n","comments":"","outputs":1,"x":1541.1691131591797,"y":2006.7143745422363,"z":"815459fd.39651","wires":[["f1cdba00.3ba7b","6dccc1ef.da102"]]}] |