summaryrefslogtreecommitdiffstats
path: root/examples/examples-decisionmaker/src
diff options
context:
space:
mode:
Diffstat (limited to 'examples/examples-decisionmaker/src')
-rw-r--r--examples/examples-decisionmaker/src/main/resources/examples/config/DecisionMaker/AnswerInitiationEvent.json14
-rw-r--r--examples/examples-decisionmaker/src/main/resources/examples/config/DecisionMaker/ApexConfigRESTClient.json67
-rw-r--r--examples/examples-decisionmaker/src/main/resources/examples/config/DecisionMaker/ApexConfigRESTServer.json72
-rw-r--r--examples/examples-decisionmaker/src/main/resources/examples/html/DecisionMaker/MakeDecisionExtraMode_Client.html156
-rw-r--r--examples/examples-decisionmaker/src/main/resources/examples/html/DecisionMaker/MakeDecisionExtraMode_Server.html156
-rw-r--r--examples/examples-decisionmaker/src/main/resources/examples/html/DecisionMaker/MakeDecision_Client.html153
-rw-r--r--examples/examples-decisionmaker/src/main/resources/examples/html/DecisionMaker/MakeDecision_Server.html153
-rw-r--r--examples/examples-decisionmaker/src/site-docs/adoc/fragments/AnswerInitiationEvents.adoc6
-rw-r--r--examples/examples-decisionmaker/src/site-docs/adoc/fragments/ApexConfigRESTClient.adoc2
-rw-r--r--examples/examples-decisionmaker/src/site-docs/adoc/fragments/ApexConfigRESTServer.adoc2
-rw-r--r--examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecisionExtraMode_Client.adoc2
-rw-r--r--examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecisionExtraMode_Server.adoc2
-rw-r--r--examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecision_Client.adoc2
-rw-r--r--examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecision_Server.adoc2
-rw-r--r--examples/examples-decisionmaker/src/site-docs/adoc/fragments/dockerfile.adoc20
-rw-r--r--examples/examples-decisionmaker/src/site/asciidoc/dockerfile.adoc14
-rw-r--r--examples/examples-decisionmaker/src/site/site.xml2
17 files changed, 780 insertions, 45 deletions
diff --git a/examples/examples-decisionmaker/src/main/resources/examples/config/DecisionMaker/AnswerInitiationEvent.json b/examples/examples-decisionmaker/src/main/resources/examples/config/DecisionMaker/AnswerInitiationEvent.json
new file mode 100644
index 000000000..6df3115d6
--- /dev/null
+++ b/examples/examples-decisionmaker/src/main/resources/examples/config/DecisionMaker/AnswerInitiationEvent.json
@@ -0,0 +1,14 @@
+{
+ "nameSpace": "org.onap.policy.apex.domains.decisionmaker",
+ "name": "AnswerEvent",
+ "version": "0.0.1",
+ "source": "dcae",
+ "target": "apex",
+ "a0" : "choice 0",
+ "a1" : "choice 1",
+ "a2" : "choice 2",
+ "a3" : "choice 3",
+ "a4" : "choice 4",
+ "a5" : "choice 5",
+ "a6" : "choice 6"
+}
diff --git a/examples/examples-decisionmaker/src/main/resources/examples/config/DecisionMaker/ApexConfigRESTClient.json b/examples/examples-decisionmaker/src/main/resources/examples/config/DecisionMaker/ApexConfigRESTClient.json
new file mode 100644
index 000000000..9fa0b6ddd
--- /dev/null
+++ b/examples/examples-decisionmaker/src/main/resources/examples/config/DecisionMaker/ApexConfigRESTClient.json
@@ -0,0 +1,67 @@
+{
+ "engineServiceParameters": {
+ "name": "MyApexEngine",
+ "version": "0.0.1",
+ "id": 45,
+ "instanceCount": 4,
+ "deploymentPort": 12345,
+ "policyModelFileName": "examples/models/DecisionMaker/DecisionMakerPolicyModel.json",
+ "engineParameters": {
+ "executorParameters": {
+ "JAVASCRIPT": {
+ "parameterClassName": "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters"
+ }
+ }
+ }
+ },
+ "eventInputParameters": {
+ "VNFInitConsumer": {
+ "carrierTechnologyParameters": {
+ "carrierTechnology": "FILE",
+ "parameters": {
+ "fileName": "examples/config/DecisionMaker/AnswerInitiationEvent.json"
+ }
+ },
+ "eventProtocolParameters": {
+ "eventProtocol": "JSON"
+ }
+ },
+ "DMaaPConsumer": {
+ "carrierTechnologyParameters": {
+ "carrierTechnology": "RESTCLIENT",
+ "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RESTClientCarrierTechnologyParameters",
+ "parameters": {
+ "url": "http://localhost:3904/events/toApex/APEX/1?timeout=60000"
+ }
+ },
+ "eventProtocolParameters": {
+ "eventProtocol": "JSON"
+ }
+ }
+ },
+ "eventOutputParameters": {
+ "logProducer": {
+ "carrierTechnologyParameters": {
+ "carrierTechnology": "FILE",
+ "parameters": {
+ "fileName": "/tmp/EventsOut.json"
+ }
+ },
+ "eventProtocolParameters": {
+ "eventProtocol": "JSON"
+ }
+ },
+ "DMaapProducer": {
+ "carrierTechnologyParameters": {
+ "carrierTechnology": "RESTCLIENT",
+ "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RESTClientCarrierTechnologyParameters",
+ "parameters": {
+ "url": "http://localhost:3904/events/fromApex"
+ }
+ },
+ "eventProtocolParameters": {
+ "eventProtocol": "JSON"
+ }
+ }
+ }
+}
diff --git a/examples/examples-decisionmaker/src/main/resources/examples/config/DecisionMaker/ApexConfigRESTServer.json b/examples/examples-decisionmaker/src/main/resources/examples/config/DecisionMaker/ApexConfigRESTServer.json
new file mode 100644
index 000000000..edf1b9cc3
--- /dev/null
+++ b/examples/examples-decisionmaker/src/main/resources/examples/config/DecisionMaker/ApexConfigRESTServer.json
@@ -0,0 +1,72 @@
+{
+ "engineServiceParameters": {
+ "name": "MyApexEngine",
+ "version": "0.0.1",
+ "id": 45,
+ "instanceCount": 4,
+ "deploymentPort": 12345,
+ "policyModelFileName": "examples/models/DecisionMaker/DecisionMakerPolicyModel.json",
+ "engineParameters": {
+ "executorParameters": {
+ "JAVASCRIPT": {
+ "parameterClassName": "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters"
+ }
+ }
+ }
+ },
+ "eventInputParameters": {
+ "VNFInitConsumer": {
+ "carrierTechnologyParameters": {
+ "carrierTechnology": "FILE",
+ "parameters": {
+ "fileName": "examples/config/DecisionMaker/AnswerInitiationEvent.json"
+ }
+ },
+ "eventProtocolParameters": {
+ "eventProtocol": "JSON"
+ }
+ },
+ "RESTConsumer": {
+ "carrierTechnologyParameters": {
+ "carrierTechnology": "RESTSERVER",
+ "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restserver.RESTServerCarrierTechnologyParameters",
+ "parameters": {
+ "standalone": true,
+ "host": "0.0.0.0",
+ "port": 23324
+ }
+ },
+ "eventProtocolParameters": {
+ "eventProtocol": "JSON"
+ },
+ "synchronousMode": true,
+ "synchronousPeer": "RESTProducer",
+ "synchronousTimeout": 500
+ }
+ },
+ "eventOutputParameters": {
+ "logProducer": {
+ "carrierTechnologyParameters": {
+ "carrierTechnology": "FILE",
+ "parameters": {
+ "fileName": "/tmp/EventsOut.json"
+ }
+ },
+ "eventProtocolParameters": {
+ "eventProtocol": "JSON"
+ }
+ },
+ "RESTProducer": {
+ "carrierTechnologyParameters":{
+ "carrierTechnology" : "RESTSERVER",
+ "parameterClassName" : "org.onap.policy.apex.plugins.event.carrier.restserver.RESTServerCarrierTechnologyParameters"
+ },
+ "eventProtocolParameters":{
+ "eventProtocol" : "JSON"
+ },
+ "synchronousMode" : true,
+ "synchronousPeer" : "RESTConsumer",
+ "synchronousTimeout" : 500
+ }
+ }
+}
diff --git a/examples/examples-decisionmaker/src/main/resources/examples/html/DecisionMaker/MakeDecisionExtraMode_Client.html b/examples/examples-decisionmaker/src/main/resources/examples/html/DecisionMaker/MakeDecisionExtraMode_Client.html
new file mode 100644
index 000000000..1077939b0
--- /dev/null
+++ b/examples/examples-decisionmaker/src/main/resources/examples/html/DecisionMaker/MakeDecisionExtraMode_Client.html
@@ -0,0 +1,156 @@
+<!--
+ ============LICENSE_START=======================================================
+ Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ SPDX-License-Identifier: Apache-2.0
+ ============LICENSE_END=========================================================
+-->
+
+<!-- http://localhost:3904/events/toApex -->
+
+<html>
+<head>
+<script src="http://code.jquery.com/jquery-latest.js"></script>
+<script>
+ $(document).ready(function() {
+ $("#answerspost").click(function(e) {
+ var elements = document.getElementById("answerform").elements;
+
+ var formValues = new Object;
+ formValues["name"] = "AnswerEvent";
+ for (var i = 0, element; element = elements[i++];) {
+ if (element.type === "text" && element.value != "") {
+ formValues[element.name] = element.value;
+ }
+ }
+ console.log(formValues);
+ var stringifiedForm = JSON.stringify(formValues);
+ console.log(stringifiedForm);
+ $.ajax({
+ type : "POST",
+ url : "http://localhost:3904/events/toApex",
+ data : stringifiedForm,
+ crossDomain : true,
+ contentType : "application/json; charset=utf-8",
+ success : function(data) {
+ alert("Answers Set Successfully !!!");
+ },
+ failure : function(errMsg) {
+ alert(errMsg);
+ }
+ });
+ e.preventDefault(); //STOP default action
+
+ });
+ });
+</script>
+<script>
+ $(document).ready(function() {
+ $("#modepost").click(function(e) {
+ var elements = document.getElementById("modeform").elements;
+
+ var formValues = new Object;
+ formValues["name"] = "MakeDecisionEvent";
+ for (var i = 0, element; element = elements[i++];) {
+ if (element.type === "radio" && element.checked) {
+ formValues[element.name] = element.value;
+ }
+ }
+ console.log(formValues);
+ var stringifiedForm = JSON.stringify(formValues);
+ console.log(stringifiedForm);
+ $.ajax({
+ type : "POST",
+ url : "http://localhost:3904/events/toApex",
+ data : stringifiedForm,
+ crossDomain : true,
+ contentType : "application/json; charset=utf-8",
+ success : function(data) {
+ alert("Decision Taken: " + data.decision);
+ },
+ failure : function(errMsg) {
+ alert(errMsg);
+ }
+ });
+ e.preventDefault(); //STOP default action
+
+ });
+ });
+</script>
+</head>
+<body>
+ <h3>Decision Maker Answers</h3>
+ <form name="answerform" id="answerform" method="POST">
+ <table>
+ <tr>
+ <td>First Answer:</td>
+ <td><input type="text" name="a0" value="Never Ever" /></td>
+ </tr>
+ <tr>
+ <td>Second Answer:</td>
+ <td><input type="text" name="a1" value="No" /></td>
+ </tr>
+ <tr>
+ <td>Third Answer:</td>
+ <td><input type="text" name="a2" value="Maybe not" /></td>
+ </tr>
+ <tr>
+ <td>Fourth Answer</td>
+ <td><input type="text" name="a3" value="Wait" /></td>
+ </tr>
+ <tr>
+ <td>Fifth Answer:</td>
+ <td><input type="text" name="a4" value="Maybe" /></td>
+ </tr>
+ <tr>
+ <td>Sixth Answer:</td>
+ <td><input type="text" name="a5" value="Yes" /></td>
+ </tr>
+ <tr>
+ <td>Seventh Answer:</td>
+ <td><input type="text" name="a6" value="Absolutely" /></td>
+ </tr>
+ <tr>
+ <td />
+ <td><input type="button" class="btn btn-info" id="answerspost"
+ value="Set Answers"></td>
+ </tr>
+ </table>
+ </form>
+ <h3>Decision Maker Mode</h3>
+ <form name="modeform" id="modeform" method="POST">
+ <table>
+ <tr>
+ <td><input name="mode" type="radio" value="random"
+ checked="checked">random</td>
+ <td><input name="mode" type="radio" value="pessimistic">pessimistic</td>
+ <td><input name="mode" type="radio" value="optimistic">
+ optimistic</td>
+ <td><input name="mode" type="radio" value="dithering">dithering</td>
+ <td><input name="mode" type="radio" value="roundrobin">round
+ robin</td>
+ </tr>
+ <tr>
+ <td />
+ <td />
+ <td />
+ <td />
+ <td><input type="button" class="btn btn-info" id="modepost"
+ value="Make Decision"></td>
+ </tr>
+ </table>
+ </form>
+</body>
+</html>
diff --git a/examples/examples-decisionmaker/src/main/resources/examples/html/DecisionMaker/MakeDecisionExtraMode_Server.html b/examples/examples-decisionmaker/src/main/resources/examples/html/DecisionMaker/MakeDecisionExtraMode_Server.html
new file mode 100644
index 000000000..06df67e59
--- /dev/null
+++ b/examples/examples-decisionmaker/src/main/resources/examples/html/DecisionMaker/MakeDecisionExtraMode_Server.html
@@ -0,0 +1,156 @@
+<!--
+ ============LICENSE_START=======================================================
+ Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ SPDX-License-Identifier: Apache-2.0
+ ============LICENSE_END=========================================================
+-->
+
+<!-- http://localhost:23324/apex/EventIn -->
+
+<html>
+<head>
+<script src="http://code.jquery.com/jquery-latest.js"></script>
+<script>
+ $(document).ready(function() {
+ $("#answerspost").click(function(e) {
+ var elements = document.getElementById("answerform").elements;
+
+ var formValues = new Object;
+ formValues["name"] = "AnswerEvent";
+ for (var i = 0, element; element = elements[i++];) {
+ if (element.type === "text" && element.value != "") {
+ formValues[element.name] = element.value;
+ }
+ }
+ console.log(formValues);
+ var stringifiedForm = JSON.stringify(formValues);
+ console.log(stringifiedForm);
+ $.ajax({
+ type : "POST",
+ url : "http://localhost:23324/apex/RESTConsumer/EventIn",
+ data : stringifiedForm,
+ crossDomain : true,
+ contentType : "application/json; charset=utf-8",
+ success : function(data) {
+ alert("Answers Set Successfully !!!");
+ },
+ failure : function(errMsg) {
+ alert(errMsg);
+ }
+ });
+ e.preventDefault(); //STOP default action
+
+ });
+ });
+</script>
+<script>
+ $(document).ready(function() {
+ $("#modepost").click(function(e) {
+ var elements = document.getElementById("modeform").elements;
+
+ var formValues = new Object;
+ formValues["name"] = "MakeDecisionEvent";
+ for (var i = 0, element; element = elements[i++];) {
+ if (element.type === "radio" && element.checked) {
+ formValues[element.name] = element.value;
+ }
+ }
+ console.log(formValues);
+ var stringifiedForm = JSON.stringify(formValues);
+ console.log(stringifiedForm);
+ $.ajax({
+ type : "POST",
+ url : "http://localhost:23324/apex/RESTConsumer/EventIn",
+ data : stringifiedForm,
+ crossDomain : true,
+ contentType : "application/json; charset=utf-8",
+ success : function(data) {
+ alert("Decision Taken: " + data.decision);
+ },
+ failure : function(errMsg) {
+ alert(errMsg);
+ }
+ });
+ e.preventDefault(); //STOP default action
+
+ });
+ });
+</script>
+</head>
+<body>
+ <h3>Decision Maker Answers</h3>
+ <form name="answerform" id="answerform" method="POST">
+ <table>
+ <tr>
+ <td>First Answer:</td>
+ <td><input type="text" name="a0" value="Never Ever" /></td>
+ </tr>
+ <tr>
+ <td>Second Answer:</td>
+ <td><input type="text" name="a1" value="No" /></td>
+ </tr>
+ <tr>
+ <td>Third Answer:</td>
+ <td><input type="text" name="a2" value="Maybe not" /></td>
+ </tr>
+ <tr>
+ <td>Fourth Answer</td>
+ <td><input type="text" name="a3" value="Wait" /></td>
+ </tr>
+ <tr>
+ <td>Fifth Answer:</td>
+ <td><input type="text" name="a4" value="Maybe" /></td>
+ </tr>
+ <tr>
+ <td>Sixth Answer:</td>
+ <td><input type="text" name="a5" value="Yes" /></td>
+ </tr>
+ <tr>
+ <td>Seventh Answer:</td>
+ <td><input type="text" name="a6" value="Absolutely" /></td>
+ </tr>
+ <tr>
+ <td />
+ <td><input type="button" class="btn btn-info" id="answerspost"
+ value="Set Answers"></td>
+ </tr>
+ </table>
+ </form>
+ <h3>Decision Maker Mode</h3>
+ <form name="modeform" id="modeform" method="POST">
+ <table>
+ <tr>
+ <td><input name="mode" type="radio" value="random"
+ checked="checked">random</td>
+ <td><input name="mode" type="radio" value="pessimistic">pessimistic</td>
+ <td><input name="mode" type="radio" value="optimistic">
+ optimistic</td>
+ <td><input name="mode" type="radio" value="dithering">dithering</td>
+ <td><input name="mode" type="radio" value="roundrobin">round
+ robin</td>
+ </tr>
+ <tr>
+ <td />
+ <td />
+ <td />
+ <td />
+ <td><input type="button" class="btn btn-info" id="modepost"
+ value="Make Decision"></td>
+ </tr>
+ </table>
+ </form>
+</body>
+</html>
diff --git a/examples/examples-decisionmaker/src/main/resources/examples/html/DecisionMaker/MakeDecision_Client.html b/examples/examples-decisionmaker/src/main/resources/examples/html/DecisionMaker/MakeDecision_Client.html
new file mode 100644
index 000000000..f7a3f0c5b
--- /dev/null
+++ b/examples/examples-decisionmaker/src/main/resources/examples/html/DecisionMaker/MakeDecision_Client.html
@@ -0,0 +1,153 @@
+<!--
+ ============LICENSE_START=======================================================
+ Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ SPDX-License-Identifier: Apache-2.0
+ ============LICENSE_END=========================================================
+-->
+
+<!-- http://localhost:3904/events/toApex -->
+
+<html>
+<head>
+<script src="http://code.jquery.com/jquery-latest.js"></script>
+<script>
+ $(document).ready(function() {
+ $("#answerspost").click(function(e) {
+ var elements = document.getElementById("answerform").elements;
+
+ var formValues = new Object;
+ formValues["name"] = "AnswerEvent";
+ for (var i = 0, element; element = elements[i++];) {
+ if (element.type === "text" && element.value != "") {
+ formValues[element.name] = element.value;
+ }
+ }
+ console.log(formValues);
+ var stringifiedForm = JSON.stringify(formValues);
+ console.log(stringifiedForm);
+ $.ajax({
+ type : "POST",
+ url : "http://localhost:3904/events/toApex",
+ data : stringifiedForm,
+ crossDomain : true,
+ contentType : "application/json; charset=utf-8",
+ success : function(data) {
+ alert("Answers Set Successfully !!!");
+ },
+ failure : function(errMsg) {
+ alert(errMsg);
+ }
+ });
+ e.preventDefault(); //STOP default action
+
+ });
+ });
+</script>
+<script>
+ $(document).ready(function() {
+ $("#modepost").click(function(e) {
+ var elements = document.getElementById("modeform").elements;
+
+ var formValues = new Object;
+ formValues["name"] = "MakeDecisionEvent";
+ for (var i = 0, element; element = elements[i++];) {
+ if (element.type === "radio" && element.checked) {
+ formValues[element.name] = element.value;
+ }
+ }
+ console.log(formValues);
+ var stringifiedForm = JSON.stringify(formValues);
+ console.log(stringifiedForm);
+ $.ajax({
+ type : "POST",
+ url : "http://localhost:3904/events/toApex",
+ data : stringifiedForm,
+ crossDomain : true,
+ contentType : "application/json; charset=utf-8",
+ success : function(data) {
+ alert("Decision Taken: " + data.decision);
+ },
+ failure : function(errMsg) {
+ alert(errMsg);
+ }
+ });
+ e.preventDefault(); //STOP default action
+
+ });
+ });
+</script>
+</head>
+<body>
+ <h3>Decision Maker Answers</h3>
+ <form name="answerform" id="answerform" method="POST">
+ <table>
+ <tr>
+ <td>First Answer:</td>
+ <td><input type="text" name="a0" value="Never Ever" /></td>
+ </tr>
+ <tr>
+ <td>Second Answer:</td>
+ <td><input type="text" name="a1" value="No" /></td>
+ </tr>
+ <tr>
+ <td>Third Answer:</td>
+ <td><input type="text" name="a2" value="Maybe not" /></td>
+ </tr>
+ <tr>
+ <td>Fourth Answer</td>
+ <td><input type="text" name="a3" value="Wait" /></td>
+ </tr>
+ <tr>
+ <td>Fifth Answer:</td>
+ <td><input type="text" name="a4" value="Maybe" /></td>
+ </tr>
+ <tr>
+ <td>Sixth Answer:</td>
+ <td><input type="text" name="a5" value="Yes" /></td>
+ </tr>
+ <tr>
+ <td>Seventh Answer:</td>
+ <td><input type="text" name="a6" value="Absolutely" /></td>
+ </tr>
+ <tr>
+ <td />
+ <td><input type="button" class="btn btn-info" id="answerspost"
+ value="Set Answers"></td>
+ </tr>
+ </table>
+ </form>
+ <h3>Decision Maker Mode</h3>
+ <form name="modeform" id="modeform" method="POST">
+ <table>
+ <tr>
+ <td><input name="mode" type="radio" value="random"
+ checked="checked">random</td>
+ <td><input name="mode" type="radio" value="pessimistic">pessimistic</td>
+ <td><input name="mode" type="radio" value="optimistic">
+ optimistic</td>
+ <td><input name="mode" type="radio" value="dithering">dithering</td>
+ </tr>
+ <tr>
+ <td />
+ <td />
+ <td />
+ <td><input type="button" class="btn btn-info" id="modepost"
+ value="Make Decision"></td>
+ </tr>
+ </table>
+ </form>
+</body>
+</html>
diff --git a/examples/examples-decisionmaker/src/main/resources/examples/html/DecisionMaker/MakeDecision_Server.html b/examples/examples-decisionmaker/src/main/resources/examples/html/DecisionMaker/MakeDecision_Server.html
new file mode 100644
index 000000000..4c8f311af
--- /dev/null
+++ b/examples/examples-decisionmaker/src/main/resources/examples/html/DecisionMaker/MakeDecision_Server.html
@@ -0,0 +1,153 @@
+<!--
+ ============LICENSE_START=======================================================
+ Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ SPDX-License-Identifier: Apache-2.0
+ ============LICENSE_END=========================================================
+-->
+
+<!-- http://localhost:23324/apex/eventInput/EventIn -->
+
+<html>
+<head>
+<script src="http://code.jquery.com/jquery-latest.js"></script>
+<script>
+ $(document).ready(function() {
+ $("#answerspost").click(function(e) {
+ var elements = document.getElementById("answerform").elements;
+
+ var formValues = new Object;
+ formValues["name"] = "AnswerEvent";
+ for (var i = 0, element; element = elements[i++];) {
+ if (element.type === "text" && element.value != "") {
+ formValues[element.name] = element.value;
+ }
+ }
+ console.log(formValues);
+ var stringifiedForm = JSON.stringify(formValues);
+ console.log(stringifiedForm);
+ $.ajax({
+ type : "POST",
+ url : "http://localhost:23324/apex/RESTConsumer/EventIn",
+ data : stringifiedForm,
+ crossDomain : true,
+ contentType : "application/json; charset=utf-8",
+ success : function(data) {
+ alert("Answers Set Successfully !!!");
+ },
+ failure : function(errMsg) {
+ alert(errMsg);
+ }
+ });
+ e.preventDefault(); //STOP default action
+
+ });
+ });
+</script>
+<script>
+ $(document).ready(function() {
+ $("#modepost").click(function(e) {
+ var elements = document.getElementById("modeform").elements;
+
+ var formValues = new Object;
+ formValues["name"] = "MakeDecisionEvent";
+ for (var i = 0, element; element = elements[i++];) {
+ if (element.type === "radio" && element.checked) {
+ formValues[element.name] = element.value;
+ }
+ }
+ console.log(formValues);
+ var stringifiedForm = JSON.stringify(formValues);
+ console.log(stringifiedForm);
+ $.ajax({
+ type : "POST",
+ url : "http://localhost:23324/apex/RESTConsumer/EventIn",
+ data : stringifiedForm,
+ crossDomain : true,
+ contentType : "application/json; charset=utf-8",
+ success : function(data) {
+ alert("Decision Taken: " + data.decision);
+ },
+ failure : function(errMsg) {
+ alert(errMsg);
+ }
+ });
+ e.preventDefault(); //STOP default action
+
+ });
+ });
+</script>
+</head>
+<body>
+ <h3>Decision Maker Answers</h3>
+ <form name="answerform" id="answerform" method="POST">
+ <table>
+ <tr>
+ <td>First Answer:</td>
+ <td><input type="text" name="a0" value="Never Ever" /></td>
+ </tr>
+ <tr>
+ <td>Second Answer:</td>
+ <td><input type="text" name="a1" value="No" /></td>
+ </tr>
+ <tr>
+ <td>Third Answer:</td>
+ <td><input type="text" name="a2" value="Maybe not" /></td>
+ </tr>
+ <tr>
+ <td>Fourth Answer</td>
+ <td><input type="text" name="a3" value="Wait" /></td>
+ </tr>
+ <tr>
+ <td>Fifth Answer:</td>
+ <td><input type="text" name="a4" value="Maybe" /></td>
+ </tr>
+ <tr>
+ <td>Sixth Answer:</td>
+ <td><input type="text" name="a5" value="Yes" /></td>
+ </tr>
+ <tr>
+ <td>Seventh Answer:</td>
+ <td><input type="text" name="a6" value="Absolutely" /></td>
+ </tr>
+ <tr>
+ <td />
+ <td><input type="button" class="btn btn-info" id="answerspost"
+ value="Set Answers"></td>
+ </tr>
+ </table>
+ </form>
+ <h3>Decision Maker Mode</h3>
+ <form name="modeform" id="modeform" method="POST">
+ <table>
+ <tr>
+ <td><input name="mode" type="radio" value="random"
+ checked="checked">random</td>
+ <td><input name="mode" type="radio" value="pessimistic">pessimistic</td>
+ <td><input name="mode" type="radio" value="optimistic">
+ optimistic</td>
+ <td><input name="mode" type="radio" value="dithering">dithering</td>
+ </tr>
+ <tr>
+ <td />
+ <td />
+ <td />
+ <td><input type="button" class="btn btn-info" id="modepost"
+ value="Make Decision"></td>
+ </tr>
+ </table>
+ </form>
+</body>
+</html>
diff --git a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/AnswerInitiationEvents.adoc b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/AnswerInitiationEvents.adoc
index 98a876a1a..a6a3d582e 100644
--- a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/AnswerInitiationEvents.adoc
+++ b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/AnswerInitiationEvents.adoc
@@ -11,10 +11,10 @@
// @author Sven van der Meer (sven.van.der.meer@ericsson.com)
//
-== Initiation Events
+== Initiation Event
-.Initiation Events
+.Initiation Event
[source,json,options="nowrap"]
----
-include::{adsite-examples-decisionmaker-dir}/main/resources/config/AnswerInitiationEvents.txt[Initiation Events]
+include::{adsite-examples-decisionmaker-dir}/main/resources/examples/config/DecisionMaker/AnswerInitiationEvent.json[Initiation Event]
---- \ No newline at end of file
diff --git a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/ApexConfigRESTClient.adoc b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/ApexConfigRESTClient.adoc
index 51d0139d7..74bbfb6c7 100644
--- a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/ApexConfigRESTClient.adoc
+++ b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/ApexConfigRESTClient.adoc
@@ -16,5 +16,5 @@
.Config REst Client
[source,json,options="nowrap"]
----
-include::{adsite-examples-decisionmaker-dir}/main/resources/config/ApexConfigRESTClient.json[Config Rest Client]
+include::{adsite-examples-decisionmaker-dir}/main/resources/examples/config/DecisionMaker/ApexConfigRESTClient.json[Config Rest Client]
---- \ No newline at end of file
diff --git a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/ApexConfigRESTServer.adoc b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/ApexConfigRESTServer.adoc
index 28051195c..89aa91bf1 100644
--- a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/ApexConfigRESTServer.adoc
+++ b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/ApexConfigRESTServer.adoc
@@ -16,5 +16,5 @@
.Config REST Server
[source,json,options="nowrap"]
----
-include::{adsite-examples-decisionmaker-dir}/main/resources/config/ApexConfigRESTServer.json[Config REST Server]
+include::{adsite-examples-decisionmaker-dir}/main/resources/examples/config/DecisionMaker/ApexConfigRESTServer.json[Config REST Server]
---- \ No newline at end of file
diff --git a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecisionExtraMode_Client.adoc b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecisionExtraMode_Client.adoc
index ee962481d..ee88f5fca 100644
--- a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecisionExtraMode_Client.adoc
+++ b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecisionExtraMode_Client.adoc
@@ -16,5 +16,5 @@
.HTML Client, Extra Mode
[source,html,options="nowrap"]
----
-include::{adsite-examples-decisionmaker-dir}/main/resources/html/MakeDecisionExtraMode_Client.html[HTML Client, Extra Mode]
+include::{adsite-examples-decisionmaker-dir}/main/resources/examples/html/DecisionMaker/MakeDecisionExtraMode_Client.html[HTML Client, Extra Mode]
---- \ No newline at end of file
diff --git a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecisionExtraMode_Server.adoc b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecisionExtraMode_Server.adoc
index 035e855ca..50673161a 100644
--- a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecisionExtraMode_Server.adoc
+++ b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecisionExtraMode_Server.adoc
@@ -16,5 +16,5 @@
.HTML Server, Extra Mode
[source,html,options="nowrap"]
----
-include::{adsite-examples-decisionmaker-dir}/main/resources/html/MakeDecisionExtraMode_Server.html[HTML Server, Extra Mode]
+include::{adsite-examples-decisionmaker-dir}/main/resources/examples/html/DecisionMaker/MakeDecisionExtraMode_Server.html[HTML Server, Extra Mode]
---- \ No newline at end of file
diff --git a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecision_Client.adoc b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecision_Client.adoc
index deab6a86e..c3d1bd7ab 100644
--- a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecision_Client.adoc
+++ b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecision_Client.adoc
@@ -16,5 +16,5 @@
.HTML Client
[source,html,options="nowrap"]
----
-include::{adsite-examples-decisionmaker-dir}/main/resources/html/MakeDecision_Client.html[HTML Client]
+include::{adsite-examples-decisionmaker-dir}/main/resources/examples/html/DecisionMaker/MakeDecision_Client.html[HTML Client]
---- \ No newline at end of file
diff --git a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecision_Server.adoc b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecision_Server.adoc
index 25e624a19..f805d6148 100644
--- a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecision_Server.adoc
+++ b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecision_Server.adoc
@@ -16,5 +16,5 @@
.HTML Server
[source,html,options="nowrap"]
----
-include::{adsite-examples-decisionmaker-dir}/main/resources/html/MakeDecision_Server.html[HTML Server]
+include::{adsite-examples-decisionmaker-dir}/main/resources/examples/html/DecisionMaker/MakeDecision_Server.html[HTML Server]
---- \ No newline at end of file
diff --git a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/dockerfile.adoc b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/dockerfile.adoc
deleted file mode 100644
index 14e40b2c2..000000000
--- a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/dockerfile.adoc
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// ============LICENSE_START=======================================================
-// Copyright (C) 2016-2018 Ericsson. All rights reserved.
-// ================================================================================
-// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE
-// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode
-//
-// SPDX-License-Identifier: CC-BY-4.0
-// ============LICENSE_END=========================================================
-//
-// @author Sven van der Meer (sven.van.der.meer@ericsson.com)
-//
-
-== Dockerfile
-
-.Dockerfile
-[source,bash,options="nowrap"]
-----
-include::{adsite-examples-decisionmaker-dir}/../Dockerfile[Dockerfile]
----- \ No newline at end of file
diff --git a/examples/examples-decisionmaker/src/site/asciidoc/dockerfile.adoc b/examples/examples-decisionmaker/src/site/asciidoc/dockerfile.adoc
deleted file mode 100644
index be86a7439..000000000
--- a/examples/examples-decisionmaker/src/site/asciidoc/dockerfile.adoc
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// ============LICENSE_START=======================================================
-// Copyright (C) 2016-2018 Ericsson. All rights reserved.
-// ================================================================================
-// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE
-// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode
-//
-// SPDX-License-Identifier: CC-BY-4.0
-// ============LICENSE_END=========================================================
-//
-// @author Sven van der Meer (sven.van.der.meer@ericsson.com)
-//
-
-include::{adsite-examples-decisionmaker-dir}/site-docs/adoc/fragments/dockerfile.adoc[]
diff --git a/examples/examples-decisionmaker/src/site/site.xml b/examples/examples-decisionmaker/src/site/site.xml
index 63631c843..d65f22ee5 100644
--- a/examples/examples-decisionmaker/src/site/site.xml
+++ b/examples/examples-decisionmaker/src/site/site.xml
@@ -33,8 +33,6 @@
<item href="RandomAnswerTask.html" name="Task Logic: Random Answer" />
<item href="RoundRobinAnswerTask.html" name="Task Logic: RoundRobin Answer" />
</item>
- <item href="dockerfile.html" name="Dockerfile" />
-
</menu>
<menu ref="reports" inherit="top" />
<menu ref="modules" />