2 "tosca_definitions_version": "tosca_simple_yaml_1_1_0",
4 "org.onap.nodetypes.policy.MetadataSet": {
5 "derived_from": "tosca.nodetypes.Root",
10 "topology_template": {
12 "apexMetadata_grpc": {
14 "type": "org.onap.nodetypes.policy.MetadataSet",
15 "type_version": "1.0.0",
16 "description": "Metadata set for GRPC",
20 "name": "GrpcPolicyModel",
28 "apexMetadata_adaptive": {
30 "type": "org.onap.nodetypes.policy.MetadataSet",
31 "type_version": "1.0.0",
32 "description": "Metadata set for an Adaptive Policy",
36 "name": "AdaptivePolicyModel",
45 "apexMetadata_decisionMaker": {
47 "type": "org.onap.nodetypes.policy.MetadataSet",
48 "type_version": "1.0.0",
49 "description": "Metadata set for an Adaptive Policy",
53 "name": "DecisionMakerPolicyModel",
58 "name": "DecisionMakerPolicyModel_KeyInfo",
65 "name": "AnswerAlbum",
70 "name": "AnswerAlbum",
73 "UUID": "4ea21a2c-5dc7-337f-ba13-f427a4ae79a1",
74 "description": "Generated description for concept referred to by key \"AnswerAlbum:0.0.1\""
79 "name": "AnswerEvent",
84 "name": "AnswerEvent",
87 "UUID": "ce2233b8-bb89-3c5e-a18f-1d13089d2bb6",
88 "description": "Generated description for concept referred to by key \"AnswerEvent:0.0.1\""
93 "name": "AnswerInitPolicy",
98 "name": "AnswerInitPolicy",
101 "UUID": "c8254064-b171-3ccb-85c0-29b5719ee8fc",
102 "description": "Generated description for concept referred to by key \"AnswerInitPolicy:0.0.1\""
107 "name": "AnswerInitTask",
112 "name": "AnswerInitTask",
115 "UUID": "28fb33d2-a4e0-3046-8302-7baf9a2056d1",
116 "description": "Generated description for concept referred to by key \"AnswerInitTask:0.0.1\""
121 "name": "DecisionEvent",
126 "name": "DecisionEvent",
129 "UUID": "487acc75-b5a1-3285-90cf-98ecd6fb3500",
130 "description": "Generated description for concept referred to by key \"DecisionEvent:0.0.1\""
135 "name": "DecisionMakerPolicy",
140 "name": "DecisionMakerPolicy",
143 "UUID": "9e8dda9a-6f85-311d-842b-00b5b5578edd",
144 "description": "Generated description for concept referred to by key \"DecisionMakerPolicy:0.0.1\""
149 "name": "DecisionMakerPolicyModel",
154 "name": "DecisionMakerPolicyModel",
157 "UUID": "d7789464-e4d1-382e-8481-fba53fa7b9a9",
158 "description": "Generated description for concept referred to by key \"DecisionMakerPolicyModel:0.0.1\""
163 "name": "DecisionMakerPolicyModel_Albums",
168 "name": "DecisionMakerPolicyModel_Albums",
171 "UUID": "e5dfbadd-5229-3ad9-996c-eda030ef5dc1",
172 "description": "Generated description for concept referred to by key \"DecisionMakerPolicyModel_Albums:0.0.1\""
177 "name": "DecisionMakerPolicyModel_Events",
182 "name": "DecisionMakerPolicyModel_Events",
185 "UUID": "b4248202-ff8e-3d45-8b3d-0ed0fd2eaed4",
186 "description": "Generated description for concept referred to by key \"DecisionMakerPolicyModel_Events:0.0.1\""
191 "name": "DecisionMakerPolicyModel_KeyInfo",
196 "name": "DecisionMakerPolicyModel_KeyInfo",
199 "UUID": "693b1b29-c4c6-34ba-98e1-bc1a7576f0f8",
200 "description": "Generated description for concept referred to by key \"DecisionMakerPolicyModel_KeyInfo:0.0.1\""
205 "name": "DecisionMakerPolicyModel_Policies",
210 "name": "DecisionMakerPolicyModel_Policies",
213 "UUID": "2dee1e42-9caa-32b1-9298-784dcdcb9cae",
214 "description": "Generated description for concept referred to by key \"DecisionMakerPolicyModel_Policies:0.0.1\""
219 "name": "DecisionMakerPolicyModel_Schemas",
224 "name": "DecisionMakerPolicyModel_Schemas",
227 "UUID": "c256f102-2681-3f35-bbbd-1f4948587e15",
228 "description": "Generated description for concept referred to by key \"DecisionMakerPolicyModel_Schemas:0.0.1\""
233 "name": "DecisionMakerPolicyModel_Tasks",
238 "name": "DecisionMakerPolicyModel_Tasks",
241 "UUID": "660cbdba-687d-3a05-ba26-69daf93a8158",
242 "description": "Generated description for concept referred to by key \"DecisionMakerPolicyModel_Tasks:0.0.1\""
247 "name": "DitheringAnswerTask",
252 "name": "DitheringAnswerTask",
255 "UUID": "da31cee8-2e84-39d2-9337-9ee3bf347c98",
256 "description": "Generated description for concept referred to by key \"DitheringAnswerTask:0.0.1\""
261 "name": "LastAnswerAlbum",
266 "name": "LastAnswerAlbum",
269 "UUID": "21399145-3fbe-39a5-b863-8a59a8add4a8",
270 "description": "Generated description for concept referred to by key \"LastAnswerAlbum:0.0.1\""
275 "name": "MakeDecisionEvent",
280 "name": "MakeDecisionEvent",
283 "UUID": "02ec632a-aeae-31fe-8f6d-656e1875749f",
284 "description": "Generated description for concept referred to by key \"MakeDecisionEvent:0.0.1\""
289 "name": "OptimisticAnswerTask",
294 "name": "OptimisticAnswerTask",
297 "UUID": "818e6b9e-0109-31f5-a95c-17f6fb016027",
298 "description": "Generated description for concept referred to by key \"OptimisticAnswerTask:0.0.1\""
303 "name": "PessimisticAnswerTask",
308 "name": "PessimisticAnswerTask",
311 "UUID": "8f4a707e-0d8b-3e09-b921-332f6f81f302",
312 "description": "Generated description for concept referred to by key \"PessimisticAnswerTask:0.0.1\""
317 "name": "RandomAnswerTask",
322 "name": "RandomAnswerTask",
325 "UUID": "bfb0af88-b454-3b08-911f-7ff2475350bf",
326 "description": "Generated description for concept referred to by key \"RandomAnswerTask:0.0.1\""
331 "name": "RoundRobinAnswerTask",
336 "name": "RoundRobinAnswerTask",
339 "UUID": "eac6fb59-8aca-3011-b7ba-69875f1db4b6",
340 "description": "Generated description for concept referred to by key \"RoundRobinAnswerTask:0.0.1\""
345 "name": "SimpleIntegerType",
350 "name": "SimpleIntegerType",
353 "UUID": "ab00a5b8-7edd-340f-8140-4d14f571edfb",
354 "description": "Generated description for concept referred to by key \"SimpleIntegerType:0.0.1\""
359 "name": "SimpleStringType",
364 "name": "SimpleStringType",
367 "UUID": "8a4957cf-9493-3a76-8c22-a208e23259af",
368 "description": "Generated description for concept referred to by key \"SimpleStringType:0.0.1\""
376 "name": "DecisionMakerPolicyModel_Policies",
383 "name": "AnswerInitPolicy",
388 "name": "AnswerInitPolicy",
391 "template": "freestyle",
395 "key": "AnswerInitState",
398 "parentKeyName": "AnswerInitPolicy",
399 "parentKeyVersion": "0.0.1",
400 "parentLocalName": "NULL",
401 "localName": "AnswerInitState"
404 "name": "AnswerEvent",
410 "key": "AnswerInitOutput",
413 "parentKeyName": "AnswerInitPolicy",
414 "parentKeyVersion": "0.0.1",
415 "parentLocalName": "AnswerInitState",
416 "localName": "AnswerInitOutput"
419 "name": "AnswerEvent",
422 "outgoingEventReference": [
424 "name": "AnswerEvent",
429 "parentKeyName": "NULL",
430 "parentKeyVersion": "0.0.0",
431 "parentLocalName": "NULL",
438 "contextAlbumReference": [],
439 "taskSelectionLogic": {
441 "logicFlavour": "UNDEFINED",
444 "stateFinalizerLogicMap": {
448 "name": "AnswerInitTask",
455 "name": "AnswerInitTask",
460 "parentKeyName": "AnswerInitPolicy",
461 "parentKeyVersion": "0.0.1",
462 "parentLocalName": "AnswerInitState",
463 "localName": "AnswerInitPolicy"
465 "outputType": "DIRECT",
467 "parentKeyName": "AnswerInitPolicy",
468 "parentKeyVersion": "0.0.1",
469 "parentLocalName": "AnswerInitState",
470 "localName": "AnswerInitOutput"
480 "firstState": "AnswerInitState"
485 "name": "DecisionMakerPolicy",
490 "name": "DecisionMakerPolicy",
493 "template": "freestyle",
497 "key": "MakeDecisionState",
500 "parentKeyName": "DecisionMakerPolicy",
501 "parentKeyVersion": "0.0.1",
502 "parentLocalName": "NULL",
503 "localName": "MakeDecisionState"
506 "name": "MakeDecisionEvent",
512 "key": "DecisionFinalOutput",
515 "parentKeyName": "DecisionMakerPolicy",
516 "parentKeyVersion": "0.0.1",
517 "parentLocalName": "MakeDecisionState",
518 "localName": "DecisionFinalOutput"
521 "name": "DecisionEvent",
524 "outgoingEventReference": [
526 "name": "DecisionEvent",
531 "parentKeyName": "NULL",
532 "parentKeyVersion": "0.0.0",
533 "parentLocalName": "NULL",
540 "contextAlbumReference": [],
541 "taskSelectionLogic": {
542 "key": "TaskSelectionLogic",
543 "logicFlavour": "JAVASCRIPT",
544 "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * Modifications Copyright (C) 2020 Nordix Foundation.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.info(executor.subject.id);\nexecutor.logger.info(executor.inFields);\n\nif (executor.inFields.get(\"mode\").equals(\"random\")) {\n executor.subject.getTaskKey(\"RandomAnswerTask\").copyTo(executor.selectedTask);\n}\nelse if (executor.inFields.get(\"mode\").equals(\"pessimistic\")) {\n executor.subject.getTaskKey(\"PessimisticAnswerTask\").copyTo(executor.selectedTask);\n}\nelse if (executor.inFields.get(\"mode\").equals(\"optimistic\")) {\n executor.subject.getTaskKey(\"OptimisticAnswerTask\").copyTo(executor.selectedTask);\n}\nelse if (executor.inFields.get(\"mode\").equals(\"dithering\")) {\n executor.subject.getTaskKey(\"DitheringAnswerTask\").copyTo(executor.selectedTask);\n}\nelse if (executor.inFields.get(\"mode\").equals(\"roundrobin\")) {\n executor.subject.getTaskKey(\"RoundRobinAnswerTask\").copyTo(executor.selectedTask);\n}\n\nexecutor.logger.info(\"Answer Selected Task:\" + executor.selectedTask);\n\ntrue;"
546 "stateFinalizerLogicMap": {
550 "name": "RandomAnswerTask",
557 "name": "DitheringAnswerTask",
562 "parentKeyName": "DecisionMakerPolicy",
563 "parentKeyVersion": "0.0.1",
564 "parentLocalName": "MakeDecisionState",
565 "localName": "DecisionMakerPolicy"
567 "outputType": "DIRECT",
569 "parentKeyName": "DecisionMakerPolicy",
570 "parentKeyVersion": "0.0.1",
571 "parentLocalName": "MakeDecisionState",
572 "localName": "DecisionFinalOutput"
578 "name": "OptimisticAnswerTask",
583 "parentKeyName": "DecisionMakerPolicy",
584 "parentKeyVersion": "0.0.1",
585 "parentLocalName": "MakeDecisionState",
586 "localName": "DecisionMakerPolicy"
588 "outputType": "DIRECT",
590 "parentKeyName": "DecisionMakerPolicy",
591 "parentKeyVersion": "0.0.1",
592 "parentLocalName": "MakeDecisionState",
593 "localName": "DecisionFinalOutput"
599 "name": "PessimisticAnswerTask",
604 "parentKeyName": "DecisionMakerPolicy",
605 "parentKeyVersion": "0.0.1",
606 "parentLocalName": "MakeDecisionState",
607 "localName": "DecisionMakerPolicy"
609 "outputType": "DIRECT",
611 "parentKeyName": "DecisionMakerPolicy",
612 "parentKeyVersion": "0.0.1",
613 "parentLocalName": "MakeDecisionState",
614 "localName": "DecisionFinalOutput"
620 "name": "RandomAnswerTask",
625 "parentKeyName": "DecisionMakerPolicy",
626 "parentKeyVersion": "0.0.1",
627 "parentLocalName": "MakeDecisionState",
628 "localName": "DecisionMakerPolicy"
630 "outputType": "DIRECT",
632 "parentKeyName": "DecisionMakerPolicy",
633 "parentKeyVersion": "0.0.1",
634 "parentLocalName": "MakeDecisionState",
635 "localName": "DecisionFinalOutput"
641 "name": "RoundRobinAnswerTask",
646 "parentKeyName": "DecisionMakerPolicy",
647 "parentKeyVersion": "0.0.1",
648 "parentLocalName": "MakeDecisionState",
649 "localName": "DecisionMakerPolicy"
651 "outputType": "DIRECT",
653 "parentKeyName": "DecisionMakerPolicy",
654 "parentKeyVersion": "0.0.1",
655 "parentLocalName": "MakeDecisionState",
656 "localName": "DecisionFinalOutput"
666 "firstState": "MakeDecisionState"
674 "name": "DecisionMakerPolicyModel_Tasks",
681 "name": "AnswerInitTask",
686 "name": "AnswerInitTask",
691 "name": "AnswerEvent",
694 "nameSpace": "org.onap.policy.apex.domains.decisionmaker",
704 "name": "SimpleStringType",
715 "name": "SimpleStringType",
726 "name": "SimpleStringType",
737 "name": "SimpleStringType",
748 "name": "SimpleStringType",
759 "name": "SimpleStringType",
770 "name": "SimpleStringType",
778 "toscaPolicyState": ""
783 "key": "AnswerEvent",
786 "name": "AnswerEvent",
789 "nameSpace": "org.onap.policy.apex.domains.decisionmaker",
799 "name": "SimpleStringType",
810 "name": "SimpleStringType",
821 "name": "SimpleStringType",
832 "name": "SimpleStringType",
843 "name": "SimpleStringType",
854 "name": "SimpleStringType",
865 "name": "SimpleStringType",
873 "toscaPolicyState": ""
881 "contextAlbumReference": [
883 "name": "AnswerAlbum",
887 "name": "LastAnswerAlbum",
893 "logicFlavour": "JAVASCRIPT",
894 "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * Modifications Copyright (C) 2020 Nordix Foundation.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.info(executor.subject.id);\nexecutor.logger.info(executor.inFields);\n\nvar answerAlbum = executor.getContextAlbum(\"AnswerAlbum\");\n\nanswerAlbum.put(\"a0\", executor.inFields.get(\"a0\"));\nanswerAlbum.put(\"a1\", executor.inFields.get(\"a1\"));\nanswerAlbum.put(\"a2\", executor.inFields.get(\"a2\"));\nanswerAlbum.put(\"a3\", executor.inFields.get(\"a3\"));\nanswerAlbum.put(\"a4\", executor.inFields.get(\"a4\"));\nanswerAlbum.put(\"a5\", executor.inFields.get(\"a5\"));\nanswerAlbum.put(\"a6\", executor.inFields.get(\"a6\"));\n\nvar lastAnswerAlbum = executor.getContextAlbum(\"LastAnswerAlbum\");\nlastAnswerAlbum.put(\"lastAnswer\", answerAlbum.size() - 1);\n\nexecutor.outFields.put(\"a0\", answerAlbum.get(\"a0\"));\nexecutor.outFields.put(\"a1\", answerAlbum.get(\"a1\"));\nexecutor.outFields.put(\"a2\", answerAlbum.get(\"a2\"));\nexecutor.outFields.put(\"a3\", answerAlbum.get(\"a3\"));\nexecutor.outFields.put(\"a4\", answerAlbum.get(\"a4\"));\nexecutor.outFields.put(\"a5\", answerAlbum.get(\"a5\"));\nexecutor.outFields.put(\"a6\", answerAlbum.get(\"a6\"));\n\nexecutor.logger.info(executor.outFields);\n\ntrue;"
900 "name": "DitheringAnswerTask",
905 "name": "DitheringAnswerTask",
910 "name": "MakeDecisionEvent",
913 "nameSpace": "org.onap.policy.apex.domains.decisionmaker",
923 "name": "SimpleStringType",
931 "toscaPolicyState": ""
936 "key": "DecisionEvent",
939 "name": "DecisionEvent",
942 "nameSpace": "org.onap.policy.apex.domains.decisionmaker",
952 "name": "SimpleStringType",
960 "toscaPolicyState": ""
968 "contextAlbumReference": [
970 "name": "AnswerAlbum",
976 "logicFlavour": "JAVASCRIPT",
977 "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * Modifications Copyright (C) 2020 Nordix Foundation.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.info(executor.subject.id);\nexecutor.logger.info(executor.inFields);\n\nvar size = executor.getContextAlbum(\"AnswerAlbum\").size();\n\nvar selection = 2 + Math.floor(Math.random() * 3);\n\nvar selectionA = \"a\" + selection;\n\nexecutor.logger.info(size);\nexecutor.logger.info(selectionA);\n\nexecutor.outFields.put(\"decision\", executor.getContextAlbum(\"AnswerAlbum\").get(selectionA));\n\nexecutor.logger.info(executor.outFields);\n\ntrue;"
983 "name": "OptimisticAnswerTask",
988 "name": "OptimisticAnswerTask",
993 "name": "MakeDecisionEvent",
996 "nameSpace": "org.onap.policy.apex.domains.decisionmaker",
1006 "name": "SimpleStringType",
1014 "toscaPolicyState": ""
1019 "key": "DecisionEvent",
1022 "name": "DecisionEvent",
1025 "nameSpace": "org.onap.policy.apex.domains.decisionmaker",
1035 "name": "SimpleStringType",
1043 "toscaPolicyState": ""
1051 "contextAlbumReference": [
1053 "name": "AnswerAlbum",
1059 "logicFlavour": "JAVASCRIPT",
1060 "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * Modifications Copyright (C) 2020 Nordix Foundation.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.info(executor.subject.id);\nexecutor.logger.info(executor.inFields);\n\nvar size = executor.getContextAlbum(\"AnswerAlbum\").size();\n\nvar selection = size - Math.floor(Math.random() * size / 2) - 1;\n\nvar selectionA = \"a\" + selection;\n\nexecutor.logger.info(size);\nexecutor.logger.info(selectionA);\n\nexecutor.outFields.put(\"decision\", executor.getContextAlbum(\"AnswerAlbum\").get(selectionA));\n\nexecutor.logger.info(executor.outFields);\n\ntrue;"
1066 "name": "PessimisticAnswerTask",
1071 "name": "PessimisticAnswerTask",
1076 "name": "MakeDecisionEvent",
1079 "nameSpace": "org.onap.policy.apex.domains.decisionmaker",
1089 "name": "SimpleStringType",
1097 "toscaPolicyState": ""
1102 "key": "DecisionEvent",
1105 "name": "DecisionEvent",
1108 "nameSpace": "org.onap.policy.apex.domains.decisionmaker",
1118 "name": "SimpleStringType",
1126 "toscaPolicyState": ""
1134 "contextAlbumReference": [
1136 "name": "AnswerAlbum",
1142 "logicFlavour": "JAVASCRIPT",
1143 "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * Modifications Copyright (C) 2020 Nordix Foundation.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.info(executor.subject.id);\nexecutor.logger.info(executor.inFields);\n\nvar size = executor.getContextAlbum(\"AnswerAlbum\").size();\n\nvar selection = Math.floor(Math.random() * size / 2);\n\nvar selectionA = \"a\" + selection;\n\nexecutor.logger.info(size);\nexecutor.logger.info(selectionA);\n\nexecutor.outFields.put(\"decision\", executor.getContextAlbum(\"AnswerAlbum\").get(selectionA));\n\nexecutor.logger.info(executor.outFields);\n\ntrue;"
1149 "name": "RandomAnswerTask",
1154 "name": "RandomAnswerTask",
1159 "name": "MakeDecisionEvent",
1162 "nameSpace": "org.onap.policy.apex.domains.decisionmaker",
1172 "name": "SimpleStringType",
1180 "toscaPolicyState": ""
1185 "key": "DecisionEvent",
1188 "name": "DecisionEvent",
1191 "nameSpace": "org.onap.policy.apex.domains.decisionmaker",
1201 "name": "SimpleStringType",
1209 "toscaPolicyState": ""
1217 "contextAlbumReference": [
1219 "name": "AnswerAlbum",
1225 "logicFlavour": "JAVASCRIPT",
1226 "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * Modifications Copyright (C) 2020 Nordix Foundation.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.info(executor.subject.id);\nexecutor.logger.info(executor.inFields);\n\nvar size = executor.getContextAlbum(\"AnswerAlbum\").size();\n\nvar selection = Math.floor(Math.random() * size);\n\nvar selectionA = \"a\" + selection;\n\nexecutor.logger.info(size);\nexecutor.logger.info(selectionA);\n\nexecutor.outFields.put(\"decision\", executor.getContextAlbum(\"AnswerAlbum\").get(selectionA));\n\nexecutor.logger.info(executor.outFields);\n\ntrue;"
1232 "name": "RoundRobinAnswerTask",
1237 "name": "RoundRobinAnswerTask",
1242 "name": "MakeDecisionEvent",
1245 "nameSpace": "org.onap.policy.apex.domains.decisionmaker",
1255 "name": "SimpleStringType",
1263 "toscaPolicyState": ""
1268 "key": "DecisionEvent",
1271 "name": "DecisionEvent",
1274 "nameSpace": "org.onap.policy.apex.domains.decisionmaker",
1284 "name": "SimpleStringType",
1292 "toscaPolicyState": ""
1300 "contextAlbumReference": [
1302 "name": "AnswerAlbum",
1306 "name": "LastAnswerAlbum",
1312 "logicFlavour": "JAVASCRIPT",
1313 "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * Modifications Copyright (C) 2020 Nordix Foundation.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.info(executor.subject.id);\nexecutor.logger.info(executor.inFields);\n\nvar size = executor.getContextAlbum(\"AnswerAlbum\").size();\nvar lastAnswer = executor.getContextAlbum(\"LastAnswerAlbum\").get(\"lastAnswer\");\n\nexecutor.logger.info(size);\nexecutor.logger.info(lastAnswer);\n\nvar answer = ++lastAnswer;\nif (answer >= size) {\n answer = 0;\n}\n\nexecutor.getContextAlbum(\"LastAnswerAlbum\").put(\"lastAnswer\", answer)\n\nvar selectionA = \"a\" + answer;\n\nexecutor.logger.info(selectionA);\n\nexecutor.outFields.put(\"decision\", executor.getContextAlbum(\"AnswerAlbum\").get(selectionA));\n\nexecutor.logger.info(executor.outFields);\n\ntrue;"
1322 "name": "DecisionMakerPolicyModel_Events",
1329 "name": "AnswerEvent",
1334 "name": "AnswerEvent",
1337 "nameSpace": "org.onap.policy.apex.domains.decisionmaker",
1347 "name": "SimpleStringType",
1358 "name": "SimpleStringType",
1369 "name": "SimpleStringType",
1380 "name": "SimpleStringType",
1391 "name": "SimpleStringType",
1402 "name": "SimpleStringType",
1413 "name": "SimpleStringType",
1421 "toscaPolicyState": ""
1426 "name": "DecisionEvent",
1431 "name": "DecisionEvent",
1434 "nameSpace": "org.onap.policy.apex.domains.decisionmaker",
1444 "name": "SimpleStringType",
1452 "toscaPolicyState": ""
1457 "name": "MakeDecisionEvent",
1462 "name": "MakeDecisionEvent",
1465 "nameSpace": "org.onap.policy.apex.domains.decisionmaker",
1475 "name": "SimpleStringType",
1483 "toscaPolicyState": ""
1491 "name": "DecisionMakerPolicyModel_Albums",
1498 "name": "AnswerAlbum",
1503 "name": "AnswerAlbum",
1509 "name": "SimpleStringType",
1516 "name": "LastAnswerAlbum",
1521 "name": "LastAnswerAlbum",
1527 "name": "SimpleIntegerType",
1537 "name": "DecisionMakerPolicyModel_Schemas",
1544 "name": "SimpleIntegerType",
1549 "name": "SimpleIntegerType",
1552 "schemaFlavour": "Java",
1553 "schemaDefinition": "java.lang.Integer"
1558 "name": "SimpleStringType",
1563 "name": "SimpleStringType",
1566 "schemaFlavour": "Java",
1567 "schemaDefinition": "java.lang.String"