diff options
author | 2018-11-08 20:06:03 +0000 | |
---|---|---|
committer | 2018-11-08 20:06:03 +0000 | |
commit | f5f76a2e0d8fb2fd6e17bb5f0e85a3f7d29cf0c4 (patch) | |
tree | 1370b6bad00367b6009f3dfb6a16a7008e4379e1 /tools/model-generator/src/test/resources/models/AutoLearnPolicyModel.json | |
parent | 8e6b49616df8e47a1c00629b20dcf947ea0bca68 (diff) | |
parent | cad452cdb6d999f822fe11dc4fdd232cce30ff6a (diff) |
Merge "Refactor unit test data" into casablanca3.0.0-ONAP2.0.3
Diffstat (limited to 'tools/model-generator/src/test/resources/models/AutoLearnPolicyModel.json')
-rw-r--r-- | tools/model-generator/src/test/resources/models/AutoLearnPolicyModel.json | 1719 |
1 files changed, 0 insertions, 1719 deletions
diff --git a/tools/model-generator/src/test/resources/models/AutoLearnPolicyModel.json b/tools/model-generator/src/test/resources/models/AutoLearnPolicyModel.json deleted file mode 100644 index 166795002..000000000 --- a/tools/model-generator/src/test/resources/models/AutoLearnPolicyModel.json +++ /dev/null @@ -1,1719 +0,0 @@ -{ - "apexPolicyModel" : { - "key" : { - "name" : "AutoLearnPolicyModel", - "version" : "0.0.1" - }, - "keyInformation" : { - "key" : { - "name" : "AutoLearnKeyInformation", - "version" : "0.0.1" - }, - "keyInfoMap" : { - "entry" : [ { - "key" : { - "name" : "ALDatatypes", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "ALDatatypes", - "version" : "0.0.1" - }, - "UUID" : "148a50d2-e4f0-3783-9c91-e94df6d01512", - "description" : "Generated description for concept referred to by key \"ALDatatypes:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearn", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearn", - "version" : "0.0.1" - }, - "UUID" : "391e51da-a4a5-36e7-91b9-7f847542b2de", - "description" : "Generated description for concept referred to by key \"AutoLearn:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearnActEvent", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnActEvent", - "version" : "0.0.1" - }, - "UUID" : "4999200f-19a0-3c67-94fe-217a5ca5a177", - "description" : "Generated description for concept referred to by key \"AutoLearnActEvent:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearnActTask", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnActTask", - "version" : "0.0.1" - }, - "UUID" : "f3b2ddd9-7c2a-305e-88e1-37de0980c80c", - "description" : "Generated description for concept referred to by key \"AutoLearnActTask:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearnAlbum", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnAlbum", - "version" : "0.0.1" - }, - "UUID" : "af6c71e7-df5c-3e39-9d2f-23201f7eeaf3", - "description" : "Generated description for concept referred to by key \"AutoLearnAlbum:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearnContext", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnContext", - "version" : "0.0.1" - }, - "UUID" : "f1ed359e-7152-3cdb-8f85-b99e9eb9af9b", - "description" : "Generated description for concept referred to by key \"AutoLearnContext:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearnDecideEvent", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnDecideEvent", - "version" : "0.0.1" - }, - "UUID" : "2d19b051-7446-38f3-a12f-b6e94ea2be92", - "description" : "Generated description for concept referred to by key \"AutoLearnDecideEvent:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearnDecideTask0", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnDecideTask0", - "version" : "0.0.1" - }, - "UUID" : "9f1a710f-e3b6-3c9a-9c66-188750abca16", - "description" : "Generated description for concept referred to by key \"AutoLearnDecideTask0:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearnDecideTask1", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnDecideTask1", - "version" : "0.0.1" - }, - "UUID" : "2c7ff214-1a87-3b08-af9b-434045c9e2fd", - "description" : "Generated description for concept referred to by key \"AutoLearnDecideTask1:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearnDecideTask2", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnDecideTask2", - "version" : "0.0.1" - }, - "UUID" : "124d809b-b080-3e76-b42b-ad7c8e810801", - "description" : "Generated description for concept referred to by key \"AutoLearnDecideTask2:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearnDecideTask3", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnDecideTask3", - "version" : "0.0.1" - }, - "UUID" : "0cc1787e-a326-3f36-848d-0a30da63ec83", - "description" : "Generated description for concept referred to by key \"AutoLearnDecideTask3:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearnDecideTask4", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnDecideTask4", - "version" : "0.0.1" - }, - "UUID" : "db69570f-65f4-3b33-9e34-1c4b3ee92669", - "description" : "Generated description for concept referred to by key \"AutoLearnDecideTask4:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearnDecideTask5", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnDecideTask5", - "version" : "0.0.1" - }, - "UUID" : "bd9f2bcf-a3b8-33c7-a48a-3452ede151ff", - "description" : "Generated description for concept referred to by key \"AutoLearnDecideTask5:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearnDecideTask6", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnDecideTask6", - "version" : "0.0.1" - }, - "UUID" : "172e9c74-aeee-37d9-a483-0f772cd36b81", - "description" : "Generated description for concept referred to by key \"AutoLearnDecideTask6:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearnEstablishEvent", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnEstablishEvent", - "version" : "0.0.1" - }, - "UUID" : "430b00e0-5c4a-3a78-b636-3873d6277601", - "description" : "Generated description for concept referred to by key \"AutoLearnEstablishEvent:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearnEstablishTask", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnEstablishTask", - "version" : "0.0.1" - }, - "UUID" : "6915102a-6564-327c-bcf9-d8c040463794", - "description" : "Generated description for concept referred to by key \"AutoLearnEstablishTask:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearnEvents", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnEvents", - "version" : "0.0.1" - }, - "UUID" : "1fcbf5a7-2b81-3d62-b870-e3340628d9d5", - "description" : "Generated description for concept referred to by key \"AutoLearnEvents:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearnKeyInformation", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnKeyInformation", - "version" : "0.0.1" - }, - "UUID" : "253488fd-2140-33ad-8374-00d43d3a54ca", - "description" : "Generated description for concept referred to by key \"AutoLearnKeyInformation:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearnMatchEvent", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnMatchEvent", - "version" : "0.0.1" - }, - "UUID" : "1723626c-8fec-3cfd-a071-b1e3bd92637d", - "description" : "Generated description for concept referred to by key \"AutoLearnMatchEvent:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearnMatchTask", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnMatchTask", - "version" : "0.0.1" - }, - "UUID" : "eb3d5b15-79d7-3e24-8513-f658a1e77416", - "description" : "Generated description for concept referred to by key \"AutoLearnMatchTask:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearnPolicies", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnPolicies", - "version" : "0.0.1" - }, - "UUID" : "72a6d6cf-d04f-3cd6-b9eb-1313e477219b", - "description" : "Generated description for concept referred to by key \"AutoLearnPolicies:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearnPolicy", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnPolicy", - "version" : "0.0.1" - }, - "UUID" : "e96b40b3-2447-3cf3-8848-34c908f21c92", - "description" : "Generated description for concept referred to by key \"AutoLearnPolicy:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearnPolicyModel", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnPolicyModel", - "version" : "0.0.1" - }, - "UUID" : "0c87dd54-fe77-3b05-bb05-93c9cd8c964d", - "description" : "Generated description for concept referred to by key \"AutoLearnPolicyModel:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearnTasks", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnTasks", - "version" : "0.0.1" - }, - "UUID" : "beb03fdd-0a6e-3669-90b8-218ae9df96a4", - "description" : "Generated description for concept referred to by key \"AutoLearnTasks:0.0.1\"" - } - }, { - "key" : { - "name" : "AutoLearnTriggerEvent", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnTriggerEvent", - "version" : "0.0.1" - }, - "UUID" : "6bd03d79-85f3-373b-a4ab-cbaad89ebd1a", - "description" : "Generated description for concept referred to by key \"AutoLearnTriggerEvent:0.0.1\"" - } - }, { - "key" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "UUID" : "fb6eac3f-53b0-3f87-984d-b27246d9e891", - "description" : "Generated description for concept referred to by key \"MonitoredValue:0.0.1\"" - } - } ] - } - }, - "policies" : { - "key" : { - "name" : "AutoLearnPolicies", - "version" : "0.0.1" - }, - "policyMap" : { - "entry" : [ { - "key" : { - "name" : "AutoLearnPolicy", - "version" : "0.0.1" - }, - "value" : { - "policyKey" : { - "name" : "AutoLearnPolicy", - "version" : "0.0.1" - }, - "template" : "MEDA", - "state" : { - "entry" : [ { - "key" : "Act", - "value" : { - "stateKey" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "NULL", - "localName" : "Act" - }, - "trigger" : { - "name" : "AutoLearnDecideEvent", - "version" : "0.0.1" - }, - "stateOutputs" : { - "entry" : [ { - "key" : "Act_NULL", - "value" : { - "key" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Act", - "localName" : "Act_NULL" - }, - "outgoingEvent" : { - "name" : "AutoLearnActEvent", - "version" : "0.0.1" - }, - "nextState" : { - "parentKeyName" : "NULL", - "parentKeyVersion" : "0.0.0", - "parentLocalName" : "NULL", - "localName" : "NULL" - } - } - } ] - }, - "contextAlbumReference" : [ ], - "taskSelectionLogic" : { - "key" : "TaskSelectionLogic", - "logicFlavour" : "MVEL", - "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\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 */\nlogger.debug(subject.id + \":\" + subject.stateName);\nsubject.defaultTaskKey.copyTo(selectedTask);\nlogger.debug(subject.id + \":\" + subject.stateName) + \", using default task\" + subject.defaultTaskKey.getID();\nreturn true;" - }, - "stateFinalizerLogicMap" : { - "entry" : [ ] - }, - "defaultTask" : { - "name" : "AutoLearnActTask", - "version" : "0.0.1" - }, - "taskReferences" : { - "entry" : [ { - "key" : { - "name" : "AutoLearnActTask", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Act", - "localName" : "AutoLearnActTask_DIRECT_Act_NULL" - }, - "outputType" : "DIRECT", - "output" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Act", - "localName" : "Act_NULL" - } - } - } ] - } - } - }, { - "key" : "Decide", - "value" : { - "stateKey" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "NULL", - "localName" : "Decide" - }, - "trigger" : { - "name" : "AutoLearnEstablishEvent", - "version" : "0.0.1" - }, - "stateOutputs" : { - "entry" : [ { - "key" : "Decide_Act", - "value" : { - "key" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Decide", - "localName" : "Decide_Act" - }, - "outgoingEvent" : { - "name" : "AutoLearnDecideEvent", - "version" : "0.0.1" - }, - "nextState" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "NULL", - "localName" : "Act" - } - } - } ] - }, - "contextAlbumReference" : [ { - "name" : "AutoLearnAlbum", - "version" : "0.0.1" - } ], - "taskSelectionLogic" : { - "key" : "TaskSelectionLogic", - "logicFlavour" : "JAVA", - "logic" : "org.onap.policy.apex.examples.adaptive.model.java.AutoLearnPolicyDecideTaskSelectionLogic" - }, - "stateFinalizerLogicMap" : { - "entry" : [ ] - }, - "defaultTask" : { - "name" : "AutoLearnDecideTask0", - "version" : "0.0.1" - }, - "taskReferences" : { - "entry" : [ { - "key" : { - "name" : "AutoLearnDecideTask0", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Decide", - "localName" : "AutoLearnDecideTask0_DIRECT_Decide_Act" - }, - "outputType" : "DIRECT", - "output" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Decide", - "localName" : "Decide_Act" - } - } - }, { - "key" : { - "name" : "AutoLearnDecideTask1", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Decide", - "localName" : "AutoLearnDecideTask1_DIRECT_Decide_Act" - }, - "outputType" : "DIRECT", - "output" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Decide", - "localName" : "Decide_Act" - } - } - }, { - "key" : { - "name" : "AutoLearnDecideTask2", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Decide", - "localName" : "AutoLearnDecideTask2_DIRECT_Decide_Act" - }, - "outputType" : "DIRECT", - "output" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Decide", - "localName" : "Decide_Act" - } - } - }, { - "key" : { - "name" : "AutoLearnDecideTask3", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Decide", - "localName" : "AutoLearnDecideTask3_DIRECT_Decide_Act" - }, - "outputType" : "DIRECT", - "output" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Decide", - "localName" : "Decide_Act" - } - } - }, { - "key" : { - "name" : "AutoLearnDecideTask4", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Decide", - "localName" : "AutoLearnDecideTask4_DIRECT_Decide_Act" - }, - "outputType" : "DIRECT", - "output" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Decide", - "localName" : "Decide_Act" - } - } - }, { - "key" : { - "name" : "AutoLearnDecideTask5", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Decide", - "localName" : "AutoLearnDecideTask5_DIRECT_Decide_Act" - }, - "outputType" : "DIRECT", - "output" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Decide", - "localName" : "Decide_Act" - } - } - }, { - "key" : { - "name" : "AutoLearnDecideTask6", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Decide", - "localName" : "AutoLearnDecideTask6_DIRECT_Decide_Act" - }, - "outputType" : "DIRECT", - "output" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Decide", - "localName" : "Decide_Act" - } - } - } ] - } - } - }, { - "key" : "Establish", - "value" : { - "stateKey" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "NULL", - "localName" : "Establish" - }, - "trigger" : { - "name" : "AutoLearnMatchEvent", - "version" : "0.0.1" - }, - "stateOutputs" : { - "entry" : [ { - "key" : "Establish_Decide", - "value" : { - "key" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Establish", - "localName" : "Establish_Decide" - }, - "outgoingEvent" : { - "name" : "AutoLearnEstablishEvent", - "version" : "0.0.1" - }, - "nextState" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "NULL", - "localName" : "Decide" - } - } - } ] - }, - "contextAlbumReference" : [ ], - "taskSelectionLogic" : { - "key" : "TaskSelectionLogic", - "logicFlavour" : "MVEL", - "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\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 */\nlogger.debug(subject.id + \":\" + subject.stateName);\nsubject.defaultTaskKey.copyTo(selectedTask);\nlogger.debug(subject.id + \":\" + subject.stateName) + \", using default task\" + subject.defaultTaskKey.getID();\nreturn true;" - }, - "stateFinalizerLogicMap" : { - "entry" : [ ] - }, - "defaultTask" : { - "name" : "AutoLearnEstablishTask", - "version" : "0.0.1" - }, - "taskReferences" : { - "entry" : [ { - "key" : { - "name" : "AutoLearnEstablishTask", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Establish", - "localName" : "AutoLearnEstablishTask_DIRECT_Establish_Decide" - }, - "outputType" : "DIRECT", - "output" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Establish", - "localName" : "Establish_Decide" - } - } - } ] - } - } - }, { - "key" : "Match", - "value" : { - "stateKey" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "NULL", - "localName" : "Match" - }, - "trigger" : { - "name" : "AutoLearnTriggerEvent", - "version" : "0.0.1" - }, - "stateOutputs" : { - "entry" : [ { - "key" : "Match_Establish", - "value" : { - "key" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Match", - "localName" : "Match_Establish" - }, - "outgoingEvent" : { - "name" : "AutoLearnMatchEvent", - "version" : "0.0.1" - }, - "nextState" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "NULL", - "localName" : "Establish" - } - } - } ] - }, - "contextAlbumReference" : [ ], - "taskSelectionLogic" : { - "key" : "TaskSelectionLogic", - "logicFlavour" : "MVEL", - "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\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 */\nlogger.debug(subject.id + \":\" + subject.stateName);\nsubject.defaultTaskKey.copyTo(selectedTask);\nlogger.debug(subject.id + \":\" + subject.stateName) + \", using default task\" + subject.defaultTaskKey.getID();\nreturn true;" - }, - "stateFinalizerLogicMap" : { - "entry" : [ ] - }, - "defaultTask" : { - "name" : "AutoLearnMatchTask", - "version" : "0.0.1" - }, - "taskReferences" : { - "entry" : [ { - "key" : { - "name" : "AutoLearnMatchTask", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Match", - "localName" : "AutoLearnMatchTask_DIRECT_Match_Establish" - }, - "outputType" : "DIRECT", - "output" : { - "parentKeyName" : "AutoLearnPolicy", - "parentKeyVersion" : "0.0.1", - "parentLocalName" : "Match", - "localName" : "Match_Establish" - } - } - } ] - } - } - } ] - }, - "firstState" : "Match" - } - } ] - } - }, - "tasks" : { - "key" : { - "name" : "AutoLearnTasks", - "version" : "0.0.1" - }, - "taskMap" : { - "entry" : [ { - "key" : { - "name" : "AutoLearnActTask", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnActTask", - "version" : "0.0.1" - }, - "inputFields" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - }, - "outputFields" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - }, - "taskParameters" : { - "entry" : [ ] - }, - "contextAlbumReference" : [ ], - "taskLogic" : { - "key" : "TaskLogic", - "logicFlavour" : "MVEL", - "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\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 */\nlogger.debug(\"AutoLearnActTask execution logic\");\nlogger.debug(\"inFields : \" + inFields);\noutFields[\"MonitoredValue\"] = inFields[\"MonitoredValue\"];\noutFields[\"LastMonitoredValue\"] = inFields[\"LastMonitoredValue\"];\nlogger.debug(\"outFields : \" + outFields);\nreturn true;" - } - } - }, { - "key" : { - "name" : "AutoLearnDecideTask0", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnDecideTask0", - "version" : "0.0.1" - }, - "inputFields" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - }, - "outputFields" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - }, - "taskParameters" : { - "entry" : [ ] - }, - "contextAlbumReference" : [ ], - "taskLogic" : { - "key" : "TaskLogic", - "logicFlavour" : "MVEL", - "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\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 */\nlogger.debug(\"AutoLearnDecideTask0: inFields:\" + inFields);\njava.util.Random rand = new java.util.Random(System.currentTimeMillis());\ndouble MIN = -100.0;\ndouble MAX = 100.0;\ndouble WANT = 50.0;\n\ndouble inval = (Double)(inFields[\"MonitoredValue\"]);\ndouble ret = inval;\n///////////////\ndouble diff = (1.0/2.0) * (Math.abs(inval - WANT));\n///////////////\nret = inval + diff;\nif (ret > MAX)\n ret = MAX;\nif (ret<MIN)\n ret = MIN;\n\noutFields[\"MonitoredValue\"] = ret;\noutFields[\"LastMonitoredValue\"] = inval;\nlogger.debug(\"AutoLearnDecideTask0: outFields:\" + outFields);\nreturn true;" - } - } - }, { - "key" : { - "name" : "AutoLearnDecideTask1", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnDecideTask1", - "version" : "0.0.1" - }, - "inputFields" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - }, - "outputFields" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - }, - "taskParameters" : { - "entry" : [ ] - }, - "contextAlbumReference" : [ ], - "taskLogic" : { - "key" : "TaskLogic", - "logicFlavour" : "MVEL", - "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\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 */\nlogger.debug(\"AutoLearnDecideTask1: inFields:\" + inFields);\njava.util.Random rand = new java.util.Random(System.currentTimeMillis());\ndouble MIN = -100.0;\ndouble MAX = 100.0;\ndouble WANT = 50.0;\n\ndouble inval = (Double)(inFields[\"MonitoredValue\"]);\ndouble ret = inval;\n///////////////\ndouble diff = (1.0/5.0) * (Math.abs(inval - WANT));\n///////////////\nret = inval + diff;\nif (ret > MAX)\n ret = MAX;\nif (ret<MIN)\n ret = MIN;\n\noutFields[\"MonitoredValue\"] = ret;\noutFields[\"LastMonitoredValue\"] = inval;\nlogger.debug(\"AutoLearnDecideTask1: outFields:\" + outFields);\nreturn true;" - } - } - }, { - "key" : { - "name" : "AutoLearnDecideTask2", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnDecideTask2", - "version" : "0.0.1" - }, - "inputFields" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - }, - "outputFields" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - }, - "taskParameters" : { - "entry" : [ ] - }, - "contextAlbumReference" : [ ], - "taskLogic" : { - "key" : "TaskLogic", - "logicFlavour" : "MVEL", - "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\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 */\nlogger.debug(\"AutoLearnDecideTask2: inFields:\" + inFields);\njava.util.Random rand = new java.util.Random(System.currentTimeMillis());\ndouble MIN = -100.0;\ndouble MAX = 100.0;\ndouble WANT = 50.0;\n\ndouble inval = (Double)(inFields[\"MonitoredValue\"]);\ndouble ret = inval;\n///////////////\ndouble diff = (1.0/10.0) * (Math.abs(inval - WANT));\n///////////////\nret = inval + diff;\nif (ret > MAX)\n ret = MAX;\nif (ret<MIN)\n ret = MIN;\n\noutFields[\"MonitoredValue\"] = ret;\noutFields[\"LastMonitoredValue\"] = inval;\nlogger.debug(\"AutoLearnDecideTask2: outFields:\" + outFields);\nreturn true;" - } - } - }, { - "key" : { - "name" : "AutoLearnDecideTask3", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnDecideTask3", - "version" : "0.0.1" - }, - "inputFields" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - }, - "outputFields" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - }, - "taskParameters" : { - "entry" : [ ] - }, - "contextAlbumReference" : [ ], - "taskLogic" : { - "key" : "TaskLogic", - "logicFlavour" : "MVEL", - "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\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 */\nlogger.debug(\"AutoLearnDecideTask3: inFields:\" + inFields);\njava.util.Random rand = new java.util.Random(System.currentTimeMillis());\ndouble MIN = -100.0;\ndouble MAX = 100.0;\ndouble WANT = 50.0;\n\ndouble inval = (Double)(inFields[\"MonitoredValue\"]);\ndouble ret = inval;\n///////////////\ndouble diff = rand.nextGaussian()*((MAX - WANT) / 50.0);\n///////////////\nret = inval + diff;\nif (ret > MAX)\n ret = MAX;\nif (ret<MIN)\n ret = MIN;\n\noutFields[\"MonitoredValue\"] = ret;\noutFields[\"LastMonitoredValue\"] = inval;\nlogger.debug(\"AutoLearnDecideTask3: outFields:\" + outFields);\nreturn true;" - } - } - }, { - "key" : { - "name" : "AutoLearnDecideTask4", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnDecideTask4", - "version" : "0.0.1" - }, - "inputFields" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - }, - "outputFields" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - }, - "taskParameters" : { - "entry" : [ ] - }, - "contextAlbumReference" : [ ], - "taskLogic" : { - "key" : "TaskLogic", - "logicFlavour" : "MVEL", - "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\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 */\nlogger.debug(\"AutoLearnDecideTask4: inFields:\" + inFields);\njava.util.Random rand = new java.util.Random(System.currentTimeMillis());\ndouble MIN = -100.0;\ndouble MAX = 100.0;\ndouble WANT = 50.0;\n\ndouble inval = (Double)(inFields[\"MonitoredValue\"]);\ndouble ret = inval;\n///////////////\ndouble diff = (-1.0/10.0) * (Math.abs(inval - WANT));\n///////////////\nret = inval + diff;\nif (ret > MAX)\n ret = MAX;\nif (ret<MIN)\n ret = MIN;\n\noutFields[\"MonitoredValue\"] = ret;\noutFields[\"LastMonitoredValue\"] = inval;\nlogger.debug(\"AutoLearnDecideTask4: outFields:\" + outFields);\nreturn true;" - } - } - }, { - "key" : { - "name" : "AutoLearnDecideTask5", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnDecideTask5", - "version" : "0.0.1" - }, - "inputFields" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - }, - "outputFields" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - }, - "taskParameters" : { - "entry" : [ ] - }, - "contextAlbumReference" : [ ], - "taskLogic" : { - "key" : "TaskLogic", - "logicFlavour" : "MVEL", - "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\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 */\nlogger.debug(\"AutoLearnDecideTask5: inFields:\" + inFields);\njava.util.Random rand = new java.util.Random(System.currentTimeMillis());\ndouble MIN = -100.0;\ndouble MAX = 100.0;\ndouble WANT = 50.0;\n\ndouble inval = (Double)(inFields[\"MonitoredValue\"]);\ndouble ret = inval;\n///////////////\ndouble diff = (-1.0/5.0) * (Math.abs(inval - WANT));\n///////////////\nret = inval + diff;\nif (ret > MAX)\n ret = MAX;\nif (ret < MIN)\n ret = MIN;\n\noutFields[\"MonitoredValue\"] = ret;\noutFields[\"LastMonitoredValue\"] = inval;\nlogger.debug(\"AutoLearnDecideTask5: outFields:\" + outFields);\nreturn true;" - } - } - }, { - "key" : { - "name" : "AutoLearnDecideTask6", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnDecideTask6", - "version" : "0.0.1" - }, - "inputFields" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - }, - "outputFields" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - }, - "taskParameters" : { - "entry" : [ ] - }, - "contextAlbumReference" : [ ], - "taskLogic" : { - "key" : "TaskLogic", - "logicFlavour" : "MVEL", - "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\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 */\nlogger.debug(\"AutoLearnDecideTask6: inFields:\" + inFields);\njava.util.Random rand = new java.util.Random(System.currentTimeMillis());\ndouble MIN = -100.0;\ndouble MAX = 100.0;\ndouble WANT = 50.0;\n\ndouble inval = (Double)(inFields[\"MonitoredValue\"]);\ndouble ret = inval;\n///////////////\ndouble diff = (-1.0/2.0) * (Math.abs(inval - WANT));\n///////////////\nret = inval + diff;\nif (ret > MAX)\n ret = MAX;\nif (ret<MIN)\n ret = MIN;\n\noutFields[\"MonitoredValue\"] = ret;\noutFields[\"LastMonitoredValue\"] = inval;\nlogger.debug(\"AutoLearnDecideTask6: outFields:\" + outFields);\nreturn true;" - } - } - }, { - "key" : { - "name" : "AutoLearnEstablishTask", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnEstablishTask", - "version" : "0.0.1" - }, - "inputFields" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - }, - "outputFields" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - }, - "taskParameters" : { - "entry" : [ ] - }, - "contextAlbumReference" : [ ], - "taskLogic" : { - "key" : "TaskLogic", - "logicFlavour" : "MVEL", - "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\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 */\nlogger.debug(\"AutoLearnActTask execution logic\");\nlogger.debug(\"inFields : \" + inFields);\noutFields[\"MonitoredValue\"] = inFields[\"MonitoredValue\"];\noutFields[\"LastMonitoredValue\"] = inFields[\"LastMonitoredValue\"];\nlogger.debug(\"outFields : \" + outFields);\nreturn true;" - } - } - }, { - "key" : { - "name" : "AutoLearnMatchTask", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnMatchTask", - "version" : "0.0.1" - }, - "inputFields" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - }, - "outputFields" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - }, - "taskParameters" : { - "entry" : [ ] - }, - "contextAlbumReference" : [ ], - "taskLogic" : { - "key" : "TaskLogic", - "logicFlavour" : "MVEL", - "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\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 */\nlogger.debug(\"AutoLearnActTask execution logic\");\nlogger.debug(\"inFields : \" + inFields);\noutFields[\"MonitoredValue\"] = inFields[\"MonitoredValue\"];\noutFields[\"LastMonitoredValue\"] = inFields[\"LastMonitoredValue\"];\nlogger.debug(\"outFields : \" + outFields);\nreturn true;" - } - } - } ] - } - }, - "events" : { - "key" : { - "name" : "AutoLearnEvents", - "version" : "0.0.1" - }, - "eventMap" : { - "entry" : [ { - "key" : { - "name" : "AutoLearnActEvent", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnActEvent", - "version" : "0.0.1" - }, - "nameSpace" : "org.onap.policy.apex.examples.adaptive.events", - "source" : "Act", - "target" : "External", - "parameter" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - } - } - }, { - "key" : { - "name" : "AutoLearnDecideEvent", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnDecideEvent", - "version" : "0.0.1" - }, - "nameSpace" : "org.onap.policy.apex.examples.adaptive.events", - "source" : "Decide", - "target" : "Act", - "parameter" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - } - } - }, { - "key" : { - "name" : "AutoLearnEstablishEvent", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnEstablishEvent", - "version" : "0.0.1" - }, - "nameSpace" : "org.onap.policy.apex.examples.adaptive.events", - "source" : "Establish", - "target" : "Decide", - "parameter" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - } - } - }, { - "key" : { - "name" : "AutoLearnMatchEvent", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnMatchEvent", - "version" : "0.0.1" - }, - "nameSpace" : "org.onap.policy.apex.examples.adaptive.events", - "source" : "Match", - "target" : "Establish", - "parameter" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - } - } - }, { - "key" : { - "name" : "AutoLearnTriggerEvent", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnTriggerEvent", - "version" : "0.0.1" - }, - "nameSpace" : "org.onap.policy.apex.examples.adaptive.events", - "source" : "External", - "target" : "Match", - "parameter" : { - "entry" : [ { - "key" : "LastMonitoredValue", - "value" : { - "key" : "LastMonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - }, { - "key" : "MonitoredValue", - "value" : { - "key" : "MonitoredValue", - "fieldSchemaKey" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "optional" : false - } - } ] - } - } - } ] - } - }, - "albums" : { - "key" : { - "name" : "AutoLearnContext", - "version" : "0.0.1" - }, - "albums" : { - "entry" : [ { - "key" : { - "name" : "AutoLearnAlbum", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearnAlbum", - "version" : "0.0.1" - }, - "scope" : "APPLICATION", - "isWritable" : true, - "itemSchema" : { - "name" : "AutoLearn", - "version" : "0.0.1" - } - } - } ] - } - }, - "schemas" : { - "key" : { - "name" : "ALDatatypes", - "version" : "0.0.1" - }, - "schemas" : { - "entry" : [ { - "key" : { - "name" : "AutoLearn", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "AutoLearn", - "version" : "0.0.1" - }, - "schemaFlavour" : "Java", - "schemaDefinition" : "org.onap.policy.apex.examples.adaptive.concepts.AutoLearn" - } - }, { - "key" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "value" : { - "key" : { - "name" : "MonitoredValue", - "version" : "0.0.1" - }, - "schemaFlavour" : "Java", - "schemaDefinition" : "java.lang.Double" - } - } ] - } - } - } -}
\ No newline at end of file |