Merge "Updated documentation for Frankfurt changes to api and xacml-pdp"
[policy/parent.git] / docs / apex / APEX-User-Manual.rst
index 01f74fa..10201c0 100644 (file)
@@ -135,7 +135,7 @@ Get the APEX Source Code
 
                .. container:: content
 
-                  .. code:: 
+                  .. code::
                      :number-lines:
 
                      git clone https://gerrit.onap.org/r/policy/apex-pdp
@@ -156,26 +156,26 @@ Build APEX
 
       -  Cygwin: ``/cygdrive/c/dev/apex-pdp``
 
-   .. important:: 
+   .. important::
       A Build requires ONAP Nexus
-         APEX has a dependency to ONAP parent projects. You might need to adjust your Maven M2 settings. The most current 
-         settings can be found in the ONAP oparent repo: `Settings <https://git.onap.org/oparent/plain/settings.xml>`__.
+      APEX has a dependency to ONAP parent projects. You might need to adjust your Maven M2 settings. The most current
+      settings can be found in the ONAP oparent repo: `Settings <https://git.onap.org/oparent/plain/settings.xml>`__.
 
-   .. important:: 
-      A Build needs Space 
-         Building APEX requires approximately 2-3 GB of hard disc space, 1 GB for the actual build with full   
-      distribution and 1-2 GB for the downloaded dependencies 
+   .. important::
+      A Build needs Space
+      Building APEX requires approximately 2-3 GB of hard disc space, 1 GB for the actual build with full
+      distribution and 1-2 GB for the downloaded dependencies
 
-   .. important:: 
+   .. important::
       A Build requires Internet (for first build)
-         During the build, several (a lot) of Maven dependencies will be downloaded and stored in the configured local Maven
-         repository. The first standard build (and any first specific build) requires Internet access to download those
-         dependencies. 
+      During the build, several (a lot) of Maven dependencies will be downloaded and stored in the configured local Maven
+      repository. The first standard build (and any first specific build) requires Internet access to download those
+      dependencies.
 
-   .. important::  
+   .. important::
       Building RPM distributions
-         RPM images are only build if the ``rpm`` package is installed (Unix). To install  ``rpm`` run ``sudo apt-get install rpm``,
-         then build APEX. 
+      RPM images are only build if the ``rpm`` package is installed (Unix). To install  ``rpm`` run ``sudo apt-get install rpm``,
+      then build APEX.
 
    .. container:: paragraph
 
@@ -192,8 +192,8 @@ Build APEX
       |         :number-lines:                                |         :number-lines:                                 |
       |                                                       |                                                        |
       |         # cd /usr/local/src/apex-pdp                  |          >c:                                           |
-      |         # mvn clean install -DskipTest                |          >cd \dev\apex                                 |
-      |                                                       |          >mvn clean install -DskipTests                |
+      |         # mvn clean install -Pdocker -DskipTests      |          >cd \dev\apex                                 |
+      |                                                       |          >mvn clean install -Pdocker -DskipTests       |
       +-------------------------------------------------------+--------------------------------------------------------+
 
 .. container:: paragraph
@@ -211,7 +211,7 @@ Build APEX
 
    .. container:: content
 
-      .. code:: 
+      .. code::
         :number-lines:
 
         [INFO] tools .............................................. SUCCESS [  0.248 s]
@@ -365,9 +365,9 @@ Install with RPM and DPKG
 |       .. container:: content                                                         |
 |                                                                                      |
 |          .. code::                                                                   |
-|             :number-lines:                                                           | 
+|             :number-lines:                                                           |
 |                                                                                      |
-|             # sudo dpkg -i apex-pdp-package-full-2.0.0-SNAPSHOT.deb                  |            
+|             # sudo dpkg -i apex-pdp-package-full-2.0.0-SNAPSHOT.deb                  |
 |             Selecting previously unselected package apex-uservice.                   |
 |             (Reading database ... 288458 files and directories currently installed.) |
 |             Preparing to unpack apex-pdp-package-full-2.0.0-SNAPSHOT.deb ...         |
@@ -402,7 +402,7 @@ Install Manually from Archive (Unix, Cygwin)
 
       .. container:: content
 
-         .. code:: 
+         .. code::
             :number-lines:
 
             # cd /opt
@@ -466,7 +466,7 @@ Install Manually from Archive (Windows, 7Zip, CMD)
 
       .. container:: content
 
-         .. code:: 
+         .. code::
            :number-lines:
 
             >c:
@@ -492,10 +492,10 @@ Build and Install Manually (Unix, Windows, Cygwin)
          from the created artifacts (``rpm``, ``deb``, ``tar.gz``, or
          copying manually).
 
-      .. important::  
-            Building RPM distributions 
-                RPM images are only build if the ``rpm`` package is installed (Unix). To install ``rpm`` run
-                ``sudo apt-get install rpm``, then build APEX.  
+      .. important::
+         Building RPM distributions
+         RPM images are only build if the ``rpm`` package is installed (Unix). To install ``rpm`` run
+         ``sudo apt-get install rpm``, then build APEX.
 
       .. container:: paragraph
 
@@ -509,7 +509,7 @@ Build and Install Manually (Unix, Windows, Cygwin)
 
          -  Windows: ``C:\dev\apex``
 
-        +-------------------------------------------------------+--------------------------------------------------------+
+         +-------------------------------------------------------+--------------------------------------------------------+
          | Unix, Cygwin                                          | Windows                                                |
          +=======================================================+========================================================+
          | .. container::                                        | .. container::                                         |
@@ -520,8 +520,8 @@ Build and Install Manually (Unix, Windows, Cygwin)
          |         :number-lines:                                |         :number-lines:                                 |
          |                                                       |                                                        |
          |         # cd /usr/local/src/apex                      |         >c:                                            |
-         |         # mvn clean install -DskipTests               |         >cd \dev\apex                                  |
-         |                                                       |         >mvn clean install -DskipTests                 |
+         |         # mvn clean install -Pdocker -DskipTests      |         >cd \dev\apex                                  |
+         |                                                       |         >mvn clean install -Pdocker -DskipTests        |
          +-------------------------------------------------------+--------------------------------------------------------+
 
 .. container:: paragraph
@@ -542,7 +542,7 @@ Build and Install Manually (Unix, Windows, Cygwin)
 
    .. container:: content
 
-      .. code:: 
+      .. code::
          :number-lines:
 
          [INFO] tools .............................................. SUCCESS [  0.248 s]
@@ -760,7 +760,7 @@ APEX User and Group
 
             .. container:: content
 
-               .. code:: 
+               .. code::
                   :number-lines:
 
                   # sudo groupadd apexuser
@@ -807,19 +807,19 @@ Environment Settings: APEX_HOME and APEX_USER
    |                                                |                                                         |
    |          # export APEX_USER=apexuser           |         >set APEX_HOME=C:\apex\apex-full-2.0.0-SNAPSHOT |
    |          # cd /opt/app/policy/apex-pdp         |                                                         |
-   |          # export APEX_HOME=`pwd`              |                                                         | 
+   |          # export APEX_HOME=`pwd`              |                                                         |
    |                                                |                                                         |
    +------------------------------------------------+                                                         |
    | .. container::                                 |                                                         |
    |                                                |                                                         |
    |    .. container:: content                      |                                                         |
    |                                                |                                                         |
-   |       .. code:: tcsh                           |                                                         |
+   |       .. code::tcsh                            |                                                         |
    |          :number-lines:                        |                                                         |
    |                                                |                                                         |
    |          # setenv APEX_USER apexuser           |                                                         |
    |          # cd /opt/app/policy/apex-pdp         |                                                         |
-   |          # setenv APEX_HOME `pwd`              |                                                         | 
+   |          # setenv APEX_HOME `pwd`              |                                                         |
    |                                                |                                                         |
    +------------------------------------------------+---------------------------------------------------------+
    | .. container::                                 | .. container::                                          |
@@ -831,7 +831,7 @@ Environment Settings: APEX_HOME and APEX_USER
    |                                                |                                                         |
    |          # env | grep APEX                     |          >set APEX_HOME                                 |
    |          # APEX_USER=apexuser                  |          APEX_HOME=\apex\apex-full-2.0.0-SNAPSHOT       |
-   |          # APEX_HOME=/opt/app/policy/apex-pdp  |                                                         | 
+   |          # APEX_HOME=/opt/app/policy/apex-pdp  |                                                         |
    |                                                |                                                         |
    +------------------------------------------------+---------------------------------------------------------+
 
@@ -910,7 +910,7 @@ Edit the APEX Logging Settings
 
    .. container:: paragraph
 
-      ``<property name="VAR_LOG" value="/var/log/onap/policy/apex-pdp/" />``
+      ``<property name="logDir" value="/var/log/onap/policy/apex-pdp/" />``
 
    .. container:: paragraph
 
@@ -918,7 +918,7 @@ Edit the APEX Logging Settings
 
    .. container:: paragraph
 
-      ``<property name="VAR_LOG" value="/PATH/TO/LOG/DIRECTORY/" />``
+      ``<property name="logDir" value="/PATH/TO/LOG/DIRECTORY/" />``
 
    .. container:: paragraph
 
@@ -926,7 +926,7 @@ Edit the APEX Logging Settings
 
    .. container:: paragraph
 
-      ``<property name="VAR_LOG" value="C:/apex/apex-full-2.0.0-SNAPSHOT/logs" />``
+      ``<property name="logDir" value="C:/apex/apex-full-2.0.0-SNAPSHOT/logs" />``
 
    .. container:: paragraph
 
@@ -942,19 +942,19 @@ Create Directories for Logging
       APEX was installed manually or when the log directory was changed
       in the settings (see above).
 
-   +------------------------------------------------------------------+-------------------------------------------------------+
-   | Unix, Cygwin                                                     | Windows                                               |
-   +==================================================================+=======================================================+
-   | .. container::                                                   | .. container::                                        |
-   |                                                                  |                                                       |
-   |    .. container:: content                                        |    .. container:: content                             |
-   |                                                                  |                                                       |
-   |       .. code::                                                  |       .. code::                                       |
-   |         :number-lines:                                           |         :number-lines:                                |
-   |                                                                  |                                                       |
-   |         mkdir -p /var/log/onap/policy/apex-pdp                   |         >mkdir C:\apex\apex-full-2.0.0-SNAPSHOT\logs  |
-   |         chown -R apexuser:apexuser /var/log/onap/policy/apex-pdp |                                                       |
-   +------------------------------------------------------------------+-------------------------------------------------------+
+   +-----------------------------------------------------------------------+-------------------------------------------------------+
+   | Unix, Cygwin                                                          | Windows                                               |
+   +=======================================================================+=======================================================+
+   | .. container::                                                        | .. container::                                        |
+   |                                                                       |                                                       |
+   |    .. container:: content                                             |    .. container:: content                             |
+   |                                                                       |                                                       |
+   |       .. code::                                                       |       .. code::                                       |
+   |         :number-lines:                                                |         :number-lines:                                |
+   |                                                                       |                                                       |
+   |         sudo mkdir -p /var/log/onap/policy/apex-pdp                   |         >mkdir C:\apex\apex-full-2.0.0-SNAPSHOT\logs  |
+   |         sudo chown -R apexuser:apexuser /var/log/onap/policy/apex-pdp |                                                       |
+   +-----------------------------------------------------------------------+-------------------------------------------------------+
 
 Verify the APEX Installation
 ----------------------------
@@ -981,7 +981,7 @@ Verify Installation - run Engine
 
          .. container:: content
 
-            .. code:: 
+            .. code::
                :number-lines:
 
                Starting Apex service with parameters [] . . .
@@ -1017,16 +1017,35 @@ Verify Installation - run an Example
       Unix scripts but runs Java as a Windows application, thus the
       configuration file must be given as a Windows path.
 
+   .. container:: paragraph
+
+      On Unix/Linux flavoured platforms, give the commands below:
+
+   .. container:: listingblock
+
+      .. container:: content
+
+      .. code::
+         :number-lines:
+
+         sudo su - apexuser
+         export APEX_HOME <path to apex installation>
+         export APEX_USER apexuser
+
+   .. container:: paragraph
+
+         You can now try to run apex.
+
    .. container:: listingblock
 
       .. container:: content
 
-         .. code:: 
-                :number-lines:
+      .. code::
+         :number-lines:
 
-               # $APEX_HOME/bin/apexEngine.sh -c $APEX_HOME/examples/config/SampleDomain/Stdin2StdoutJsonEventJava.json (1)
-               # $APEX_HOME/bin/apexEngine.sh -c C:/apex/apex-full-2.0.0-SNAPSHOT/examples/config/SampleDomain/Stdin2StdoutJsonEventJava.json (2)
-               >%APEX_HOME%\bin\apexEngine.bat -c %APEX_HOME%\examples\config\SampleDomain\Stdin2StdoutJsonEventJava.json :: (3)
+          # $APEX_HOME/bin/apexEngine.sh -c $APEX_HOME/examples/config/SampleDomain/Stdin2StdoutJsonEventJava.json (1)
+          # $APEX_HOME/bin/apexEngine.sh -c C:/apex/apex-full-2.0.0-SNAPSHOT/examples/config/SampleDomain/Stdin2StdoutJsonEventJava.json (2)
+          >%APEX_HOME%\bin\apexEngine.bat -c %APEX_HOME%\examples\config\SampleDomain\Stdin2StdoutJsonEventJava.json :: (3)
 
 .. container:: colist arabic
 
@@ -1040,15 +1059,14 @@ Verify Installation - run an Example
 
 .. container:: paragraph
 
-   The engine should start successfully. Assuming the logging levels are
-   not change (default level is ``info``), the output should look
-   similar to this (last few lines)
+   The engine should start successfully. Assuming the logging levels are set to ``info`` in the built system, the output
+   should look similar to this (last few lines)
 
 .. container:: listingblock
 
    .. container:: content
 
-      .. code:: 
+      .. code::
          :number-lines:
 
          Starting Apex service with parameters [-c, v:/dev/ericsson/apex/onap/apex-pdp/packages/apex-pdp-package-full/target/install_hierarchy/examples/config/SampleDomain/Stdin2StdoutJsonEventJava.json] . . .
@@ -1134,7 +1152,7 @@ Verify a Full Installation - REST Editor
 
       .. container:: content
 
-         .. code:: 
+         .. code::
             :number-lines:
 
             # $APEX_HOME/bin/apexApps.sh rest-editor
@@ -1143,7 +1161,7 @@ Verify a Full Installation - REST Editor
 
    .. container:: content
 
-      .. code:: 
+      .. code::
             :number-lines:
 
             >%APEX_HOME%\bin\apexApps.bat rest-editor
@@ -1160,7 +1178,7 @@ Verify a Full Installation - REST Editor
 
    .. container:: content
 
-      .. code:: 
+      .. code::
          :number-lines:
 
          Apex Editor REST endpoint (ApexEditorMain: Config=[ApexEditorParameters: URI=http://localhost:18989/apexservices/, TTL=-1sec], State=READY) starting at http://localhost:18989/apexservices/ . . .
@@ -1343,7 +1361,7 @@ Build a Docker Image
 
          .. container:: content
 
-            .. code:: 
+            .. code::
                :number-lines:
 
                #
@@ -1437,37 +1455,38 @@ General Configuration Format
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   {
                     "engineServiceParameters":{
                       ... (1)
                       "engineParameters":{ (2)
-                        "engineParameters":{...}, (3)
+                        "executorParameters":{...}, (3)
                         "contextParameters":{...} (4)
+                        "taskParameters":[...] (5)
                       }
                     },
-                    "eventInputParameters":{ (5)
-                      "input1":{ (6)
+                    "eventInputParameters":{ (6)
+                      "input1":{ (7)
                         "carrierTechnologyParameters":{...},
                         "eventProtocolParameters":{...}
                       },
-                      "input2":{...}, (7)
+                      "input2":{...}, (8)
                         "carrierTechnologyParameters":{...},
                         "eventProtocolParameters":{...}
                       },
-                      ... (8)
+                      ... (9)
                     },
-                    "eventOutputParameters":{ (9)
-                      "output1":{ (10)
+                    "eventOutputParameters":{ (10)
+                      "output1":{ (11)
                         "carrierTechnologyParameters":{...},
                         "eventProtocolParameters":{...}
                       },
-                      "output2":{ (11)
+                      "output2":{ (12)
                         "carrierTechnologyParameters":{...},
                         "eventProtocolParameters":{...}
                       },
-                      ... (12)
+                      ... (13)
                     }
                   }
 
@@ -1488,31 +1507,35 @@ General Configuration Format
             |                                   | for context schemas, persistence, |
             |                                   | etc.                              |
             +-----------------------------------+-----------------------------------+
-            | **5**                             | configuration of the input        |
+            | **5**                             | list of task parameters that      |
+            |                                   | should be made available in task  |
+            |                                   | logic (optional).                 |
+            +-----------------------------------+-----------------------------------+
+            | **6**                             | configuration of the input        |
             |                                   | interface                         |
             +-----------------------------------+-----------------------------------+
-            | **6**                             | an example input called           |
+            | **7**                             | an example input called           |
             |                                   | ``input1`` with carrier           |
             |                                   | technology and event protocol     |
             +-----------------------------------+-----------------------------------+
-            | **7**                             | an example input called           |
+            | **8**                             | an example input called           |
             |                                   | ``input2`` with carrier           |
             |                                   | technology and event protocol     |
             +-----------------------------------+-----------------------------------+
-            | **8**                             | any further input configuration   |
+            | **9**                             | any further input configuration   |
             +-----------------------------------+-----------------------------------+
-            | **9**                             | configuration of the output       |
+            | **10**                            | configuration of the output       |
             |                                   | interface                         |
             +-----------------------------------+-----------------------------------+
-            | **10**                            | an example output called          |
+            | **11**                            | an example output called          |
             |                                   | ``output1`` with carrier          |
             |                                   | technology and event protocol     |
             +-----------------------------------+-----------------------------------+
-            | **11**                            | an example output called          |
+            | **12**                            | an example output called          |
             |                                   | ``output2`` with carrier          |
             |                                   | technology and event protocol     |
             +-----------------------------------+-----------------------------------+
-            | **12**                            | any further output configuration  |
+            | **13**                            | any further output configuration  |
             +-----------------------------------+-----------------------------------+
 
 Engine Service Parameters
@@ -1528,7 +1551,7 @@ Engine Service Parameters
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   "engineServiceParameters" : {
                     "name"          : "AADMApexEngine", (1)
@@ -1539,8 +1562,9 @@ Engine Service Parameters
                     "policyModelFileName" : "examples/models/VPN/VPNPolicyModelJava.json", (6)
                     "periodicEventPeriod": 1000, (7)
                     "engineParameters":{ (8)
-                      "engineParameters":{...}, (9)
-                      "contextParameters":{...} (10)
+                      "executorParameters":{...}, (9)
+                      "contextParameters":{...}, (10)
+                      "taskParameters":[...] (11)
                     }
                   }
 
@@ -1599,6 +1623,10 @@ Engine Service Parameters
             |                                   | for context schemas, persistence, |
             |                                   | etc.                              |
             +-----------------------------------+-----------------------------------+
+            | **11**                            | list of task parameters that      |
+            |                                   | should be made available in task  |
+            |                                   | logic (optional).                 |
+            +-----------------------------------+-----------------------------------+
 
          .. container:: paragraph
 
@@ -1684,7 +1712,7 @@ Input and Output Interfaces
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   "eventInputParameters": { (1)
                     "FirstConsumer": { (2)
@@ -1796,7 +1824,7 @@ Event Filters
 
                .. container:: content
 
-                  .. code:: 
+                  .. code::
 
                      "eventInputParameters": {
                        "Input1": {
@@ -1866,7 +1894,7 @@ Configure the Javascript Executor
 
                .. container:: content
 
-                  .. code:: 
+                  .. code::
 
                      "engineServiceParameters":{
                        "engineParameters":{
@@ -1891,7 +1919,7 @@ Configure the Jython Executor
 
                .. container:: content
 
-                  .. code:: 
+                  .. code::
 
                      "engineServiceParameters":{
                        "engineParameters":{
@@ -1916,7 +1944,7 @@ Configure the JRuby Executor
 
                .. container:: content
 
-                  .. code:: 
+                  .. code::
 
                      "engineServiceParameters":{
                        "engineParameters":{
@@ -1941,7 +1969,7 @@ Configure the Java Executor
 
                .. container:: content
 
-                  .. code:: 
+                  .. code::
 
                      "engineServiceParameters":{
                        "engineParameters":{
@@ -1966,7 +1994,7 @@ Configure the MVEL Executor
 
                .. container:: content
 
-                  .. code:: 
+                  .. code::
 
                      "engineServiceParameters":{
                        "engineParameters":{
@@ -2016,7 +2044,7 @@ Configure AVRO Schema Handler
 
                .. container:: content
 
-                  .. code:: 
+                  .. code::
 
                      "engineServiceParameters":{
                        "engineParameters":{
@@ -2079,6 +2107,49 @@ Configure AVRO Schema Handler
                      -  Since AVRO uses lazy initialization, this
                         rejection might only become visible at runtime
 
+Configure Task Parameters
+#########################
+
+            .. container:: paragraph
+
+               The Task Parameters are added to the configuration as
+               follows:
+
+            .. container:: listingblock
+
+               .. container:: content
+
+                  .. code::
+
+                     "engineServiceParameters": {
+                       "engineParameters": {
+                         "taskParameters": [
+                           {
+                             "key": "ParameterKey1",
+                             "value": "ParameterValue1"
+                           },
+                           {
+                             "taskId": "Task_Act0",
+                             "key": "ParameterKey2",
+                             "value": "ParameterValue2"
+                           }
+                         ]
+                       }
+                     }
+
+            .. container:: paragraph
+
+               TaskParameters can be used to pass parameters from ApexConfig
+               to the policy logic. In the config, these are optional.
+               The list of task parameters provided in the config may be added
+               to the tasks or existing task parameters in the task will be overriden.
+
+            .. container:: paragraph
+
+               If taskId is provided in ApexConfig for an entry, then that
+               parameter is updated only for that particular task. Otherwise,
+               the task parameter is added to all tasks.
+
 Carrier Technologies
 --------------------
 
@@ -2193,7 +2264,7 @@ Standard Output
 
                   .. container:: content
 
-                     .. code:: 
+                     .. code::
 
                         "carrierTechnologyParameters" : {
                           "carrierTechnology" : "FILE", (1)
@@ -2231,7 +2302,7 @@ File Input
 
                   .. container:: content
 
-                     .. code:: 
+                     .. code::
 
                         "carrierTechnologyParameters" : {
                           "carrierTechnology" : "FILE", (1)
@@ -2260,7 +2331,7 @@ File Output
 
                   .. container:: content
 
-                     .. code:: 
+                     .. code::
 
                         "carrierTechnologyParameters" : {
                           "carrierTechnology" : "FILE", (1)
@@ -2297,7 +2368,7 @@ Event Requestor Input
 
                   .. container:: content
 
-                     .. code:: 
+                     .. code::
 
                         "carrierTechnologyParameters" : {
                           "carrierTechnology": "EVENT_REQUESTOR" (1)
@@ -2320,7 +2391,7 @@ Event Requestor Output
 
                   .. container:: content
 
-                     .. code:: 
+                     .. code::
 
                         "carrierTechnologyParameters" : {
                           "carrierTechnology": "EVENT_REQUESTOR" (1)
@@ -2342,7 +2413,7 @@ Peering Event Requestors
 
                   .. container:: content
 
-                     .. code:: 
+                     .. code::
 
                         "eventInputParameters": {
                           "EventRequestorConsumer": {
@@ -2442,7 +2513,7 @@ Kafka Input
 
                   .. container:: content
 
-                     .. code:: 
+                     .. code::
 
                         "carrierTechnologyParameters" : {
                           "carrierTechnology" : "KAFKA", (1)
@@ -2500,7 +2571,7 @@ Kafka Output
 
                   .. container:: content
 
-                     .. code:: 
+                     .. code::
 
                         "carrierTechnologyParameters" : {
                           "carrierTechnology" : "KAFKA", (1)
@@ -2570,7 +2641,7 @@ JMS Input
 
                   .. container:: content
 
-                     .. code:: 
+                     .. code::
 
                         "carrierTechnologyParameters" : {
                           "carrierTechnology" : "JMS", (1)
@@ -2629,7 +2700,7 @@ JMS Output with Text
 
                   .. container:: content
 
-                     .. code:: 
+                     .. code::
 
                         "carrierTechnologyParameters" : {
                           "carrierTechnology" : "JMS", (1)
@@ -2730,7 +2801,7 @@ Websocket Client
 
                   .. container:: content
 
-                     .. code:: 
+                     .. code::
 
                         "carrierTechnologyParameters" : {
                           "carrierTechnology" : "WEBSOCKET", (1)
@@ -2768,7 +2839,7 @@ Websocket Server
 
                   .. container:: content
 
-                     .. code:: 
+                     .. code::
 
                         "carrierTechnologyParameters" : {
                           "carrierTechnology" : "WEBSOCKET", (1)
@@ -2797,7 +2868,7 @@ REST Client IO
 
                APEX can act as REST client on the input as well as on
                the output interface. The media type is
-               ``application/json``, so this plugin does only work with
+               ``application/json``, so this plugin only works with
                the JSON Event protocol.
 
 REST Client Input
@@ -2812,12 +2883,19 @@ REST Client Input
                   by the server configured via the URL. For instance,
                   the server could support a wait timeout via the URL as
                   ``?timeout=100ms``.
+                  The httpCodeFilter is used for filtering the status
+                  code, and it can be configured as a regular expression
+                  string. The default httpCodeFilter is "[2][0-9][0-9]"
+                  - for successful response codes.
+                  The response with HTTP status code that matches the
+                  given regular expression is forwarded to the task,
+                  otherwise it is logged as a failure.
 
                .. container:: listingblock
 
                   .. container:: content
 
-                     .. code:: 
+                     .. code::
 
                         "carrierTechnologyParameters" : {
                           "carrierTechnology" : "RESTCLIENT", (1)
@@ -2825,16 +2903,19 @@ REST Client Input
                             "org.onap.policy.apex.plugins.event.carrier.restclient.RESTClientCarrierTechnologyParameters",
                           "parameters" : {
                             "url" : "http://example.org:8080/triggers/events", (2)
+                            "httpCodeFilter" : "[2][0-9][0-9]" (3)
                           }
                         }
 
                .. container:: colist arabic
 
-                  +-------+---------------------------------------+
-                  | **1** | set REST client as carrier technology |
-                  +-------+---------------------------------------+
-                  | **2** | the URL of the HTTP server for events |
-                  +-------+---------------------------------------+
+                  +-------+--------------------------------------------------+
+                  | **1** | set REST client as carrier technology            |
+                  +-------+--------------------------------------------------+
+                  | **2** | the URL of the HTTP server for events            |
+                  +-------+--------------------------------------------------+
+                  | **3** | use HTTP CODE FILTER for filtering status code   |
+                  +-------+--------------------------------------------------+
 
 REST Client Output
 ==================
@@ -2846,12 +2927,21 @@ REST Client Output
                   POST (no configuration required). To change it to PUT
                   simply add the configuration parameter (as shown in
                   the example below).
+                  The URL can be configured statically or tagged
+                  as ``?example.{site}.org:8080/{trig}/events``,
+                  all tags such as ``site`` and ``trig`` in the URL
+                  need to be set in the properties object available to
+                  the tasks. In addition, the keys should exactly match
+                  with the tags defined in url. The scope of the properties
+                  object is per HTTP call. Hence, key/value pairs set
+                  in the properties object by task are only available
+                  for that specific HTTP call.
 
                .. container:: listingblock
 
                   .. container:: content
 
-                     .. code:: 
+                     .. code::
 
                         "carrierTechnologyParameters" : {
                           "carrierTechnology" : "RESTCLIENT", (1)
@@ -2859,6 +2949,7 @@ REST Client Output
                             "org.onap.policy.apex.plugins.event.carrier.restclient.RESTClientCarrierTechnologyParameters",
                           "parameters" : {
                             "url" : "http://example.com:8888/actions/events", (2)
+                            "url" : "http://example.{site}.com:8888/{trig}/events", (2')
                             "httpMethod" : "PUT" (3)
                           }
                         }
@@ -2868,7 +2959,9 @@ REST Client Output
                   +-------+--------------------------------------------------+
                   | **1** | set REST client as carrier technology            |
                   +-------+--------------------------------------------------+
-                  | **2** | the URL of the HTTP server for events            |
+                  | **2** | the static URL of the HTTP server for events     |
+                  +-------+--------------------------------------------------+
+                  | **2'**| the tagged URL of the HTTP server for events     |
                   +-------+--------------------------------------------------+
                   | **3** | use HTTP PUT (remove this line to use HTTP POST) |
                   +-------+--------------------------------------------------+
@@ -2908,7 +3001,7 @@ REST Server IO
                -  Maximum port: 65535
 
                -  The media type is ``application/json``, so this plugin
-                  does only work with the JSON Event protocol.
+                  only works with the JSON Event protocol.
 
             .. container:: paragraph
 
@@ -2961,7 +3054,7 @@ REST Server Stand-alone
 
                   .. container:: content
 
-                     .. code:: 
+                     .. code::
 
                         "eventInputParameters": {
                           "MyConsumer": {
@@ -3016,7 +3109,7 @@ REST Server Stand-alone
 
                   .. container:: content
 
-                     .. code:: 
+                     .. code::
 
                         "eventOutputParameters": {
                           "MyProducer": {
@@ -3066,7 +3159,7 @@ REST Server Stand-alone in Servlet
 
                   .. container:: content
 
-                     .. code:: 
+                     .. code::
 
                         <servlet>
                           ...
@@ -3084,7 +3177,7 @@ REST Requestor IO
 
                APEX can act as REST requestor on the input as well as on
                the output interface. The media type is
-               ``application/json``, so this plugin does only work with
+               ``application/json``, so this plugin only works with
                the JSON Event protocol.
 
 REST Requestor Input
@@ -3093,20 +3186,38 @@ REST Requestor Input
                .. container:: paragraph
 
                   APEX will connect to a given URL to request an input.
+                  The URL can be configured statically or tagged
+                  as ``?example.{site}.org:8080/{trig}/events``,
+                  all tags such as ``site`` and ``trig`` in the URL
+                  need to be set in the properties object available to
+                  the tasks. In addition, the keys should exactly match
+                  with the tags defined in url. The scope of the properties
+                  object is per HTTP call. Hence, key/value pairs set
+                  in the properties object by task are only available
+                  for that specific HTTP call.
+                  The httpCodeFilter is used for filtering the status
+                  code, and it can be configured as a regular expression
+                  string. The default httpCodeFilter is "[2][0-9][0-9]"
+                  - for successful response codes.
+                  The response with HTTP status code that matches the
+                  given regular expression is forwarded to the task,
+                  otherwise it is logged as a failure.
 
                .. container:: listingblock
 
                   .. container:: content
 
-                     .. code:: 
+                     .. code::
 
                         "carrierTechnologyParameters": {
                           "carrierTechnology": "RESTREQUESTOR", (1)
                           "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restrequestor.RESTRequestorCarrierTechnologyParameters",
                           "parameters": {
                             "url": "http://localhost:54321/some/path/to/rest/resource", (2)
+                            "url": "http://localhost:54321/{site}/path/to/rest/{resValue}", (2')
                             "httpMethod": "POST", (3)
-                            "restRequestTimeout": 2000 (4)
+                            "restRequestTimeout": 2000, (4)
+                            "httpCodeFilter" : "[2][0-9][0-9]" (5)
                           }
                         },
 
@@ -3115,12 +3226,16 @@ REST Requestor Input
                   +-------+--------------------------------------------------+
                   | **1** | set REST requestor as carrier technology         |
                   +-------+--------------------------------------------------+
-                  | **2** | the URL of the HTTP server for events            |
+                  | **2** | the static URL of the HTTP server for events     |
+                  +-------+--------------------------------------------------+
+                  | **2'**| the tagged URL of the HTTP server for events     |
                   +-------+--------------------------------------------------+
                   | **3** | use HTTP PUT (remove this line to use HTTP POST) |
                   +-------+--------------------------------------------------+
                   | **4** | request timeout in milliseconds                  |
                   +-------+--------------------------------------------------+
+                  | **5** | use HTTP CODE FILTER for filtering status code   |
+                  +-------+--------------------------------------------------+
 
                .. container:: paragraph
 
@@ -3131,7 +3246,7 @@ REST Requestor Input
 
                   .. container:: content
 
-                     .. code:: 
+                     .. code::
 
                         "eventName": "GuardResponseEvent", (1)
                         "eventNameFilter": "GuardResponseEvent", (2)
@@ -3165,7 +3280,7 @@ REST Requestor Output
 
                   .. container:: content
 
-                     .. code:: 
+                     .. code::
 
                         "carrierTechnologyParameters": {
                           "carrierTechnology": "RESTREQUESTOR", (1)
@@ -3187,7 +3302,7 @@ REST Requestor Output
 
                   .. container:: content
 
-                     .. code:: 
+                     .. code::
 
                         "eventNameFilter": "GuardRequestEvent", (1)
                         "requestorMode": true, (2)
@@ -3206,6 +3321,142 @@ REST Requestor Output
                   | **4** | a general request timeout |
                   +-------+---------------------------+
 
+gRPC IO
+#######
+
+            .. container:: paragraph
+
+               APEX can send requests over gRPC at the output side, and get back
+               response at the input side. This can be used to send requests to CDS
+               over gRPC. The media type is ``application/json``, so this plugin
+               only works with the JSON Event protocol.
+
+gRPC Output
+===========
+
+               .. container:: paragraph
+
+                  APEX will connect to a given host to send a request over
+                  gRPC.
+
+               .. container:: listingblock
+
+                  .. container:: content
+
+                     .. code::
+
+                        "carrierTechnologyParameters": {
+                          "carrierTechnology": "GRPC", (1)
+                          "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.grpc.GrpcCarrierTechnologyParameters",
+                          "parameters": {
+                            "host": "cds-blueprints-processor-grpc", (2)
+                            "port": 9111, (2')
+                            "username": "ccsdkapps", (3)
+                            "password": ccsdkapps, (4)
+                            "timeout" : 10 (5)
+                          }
+                        },
+
+               .. container:: colist arabic
+
+                  +-------+--------------------------------------------------+
+                  | **1** | set GRPC as carrier technology                   |
+                  +-------+--------------------------------------------------+
+                  | **2** | the host to which request is sent                |
+                  +-------+--------------------------------------------------+
+                  | **2'**| the value for port                               |
+                  +-------+--------------------------------------------------+
+                  | **3** | username required to initiate connection         |
+                  +-------+--------------------------------------------------+
+                  | **4** | password required to initiate connection         |
+                  +-------+--------------------------------------------------+
+                  | **5** | the timeout value for completing the request     |
+                  +-------+--------------------------------------------------+
+
+               .. container:: paragraph
+
+                  Further settings are required on the producer to
+                  define the event that is requested, for example:
+
+               .. container:: listingblock
+
+                  .. container:: content
+
+                     .. code::
+
+                        "eventName": "GRPCRequestEvent", (1)
+                        "eventNameFilter": "GRPCRequestEvent", (2)
+                        "requestorMode": true, (3)
+                        "requestorPeer": "GRPCRequestConsumer", (4)
+                        "requestorTimeout": 500 (5)
+
+               .. container:: colist arabic
+
+                  +-------+---------------------------+
+                  | **1** | the event name            |
+                  +-------+---------------------------+
+                  | **2** | a filter on the event     |
+                  +-------+---------------------------+
+                  | **3** | the mode of the requestor |
+                  +-------+---------------------------+
+                  | **4** | a peer for the requestor  |
+                  +-------+---------------------------+
+                  | **5** | a general request timeout |
+                  +-------+---------------------------+
+
+gRPC Input
+==========
+
+               .. container:: paragraph
+
+                  APEX will connect to the host specified in the producer
+                  side, anad take in response back at the consumer side.
+
+               .. container:: listingblock
+
+                  .. container:: content
+
+                     .. code::
+
+                        "carrierTechnologyParameters": {
+                          "carrierTechnology": "GRPC", (1)
+                          "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.grpc.GrpcCarrierTechnologyParameters"
+                        },
+
+               .. container:: colist arabic
+
+                  +-------+------------------------------------------+
+                  | **1** | set GRPC as carrier technology           |
+                  +-------+------------------------------------------+
+
+               .. container:: paragraph
+
+                  Further settings are required on the consumer to
+                  define the event that is requested, for example:
+
+               .. container:: listingblock
+
+                  .. container:: content
+
+                     .. code::
+
+                        "eventNameFilter": "GRPCResponseEvent", (1)
+                        "requestorMode": true, (2)
+                        "requestorPeer": "GRPCRequestProducer", (3)
+                        "requestorTimeout": 500 (4)
+
+               .. container:: colist arabic
+
+                  +-------+---------------------------+
+                  | **1** | a filter on the event     |
+                  +-------+---------------------------+
+                  | **2** | the mode of the requestor |
+                  +-------+---------------------------+
+                  | **3** | a peer for the requestor  |
+                  +-------+---------------------------+
+                  | **4** | a general request timeout |
+                  +-------+---------------------------+
+
 Event Protocols, Format and Encoding
 ------------------------------------
 
@@ -3287,7 +3538,7 @@ JSON Event
 
                .. container:: content
 
-                  .. code:: 
+                  .. code::
 
                      "eventProtocolParameters":{
                        "eventProtocol" : "JSON"
@@ -3310,7 +3561,7 @@ JSON Event
 
                .. container:: content
 
-                  .. code:: 
+                  .. code::
 
                      "eventProtocolParameters":{
                        "eventProtocol" : "JSON",
@@ -3366,7 +3617,7 @@ APEX Event
 
                .. container:: content
 
-                  .. code:: 
+                  .. code::
 
                      "eventProtocolParameters":{
                        "eventProtocol" : "APEX"
@@ -3400,7 +3651,7 @@ JMS Text
 
                   .. container:: content
 
-                     .. code:: 
+                     .. code::
 
                         "eventProtocolParameters":{
                           "eventProtocol" : "JMSTEXT",
@@ -3427,7 +3678,7 @@ JMS Object
 
                   .. container:: content
 
-                     .. code:: 
+                     .. code::
 
                         "eventProtocolParameters":{
                           "eventProtocol" : "JMSOBJECT",
@@ -3462,7 +3713,7 @@ YAML Event
 
                .. container:: content
 
-                  .. code:: 
+                  .. code::
 
                      "eventProtocolParameters":{
                        "eventProtocol" : "XML",
@@ -3496,7 +3747,7 @@ XML Event
 
                .. container:: content
 
-                  .. code:: 
+                  .. code::
 
                      "eventProtocolParameters":{
                        "eventProtocol" : "XML",
@@ -3524,7 +3775,7 @@ A configuration example
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   {
                     "engineServiceParameters" : {
@@ -3763,7 +4014,7 @@ The APEX Engine
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   usage: org.onap.policy.apex.service.engine.main.ApexMain [options...]
                   options
@@ -3852,7 +4103,7 @@ The APEX CLI Editor
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   usage: org.onap.policy.apex.auth.clieditor.ApexCLIEditorMain [options...]
                   options
@@ -3876,6 +4127,103 @@ The APEX CLI Editor
                    -wd,--working-directory <WORKING_DIRECTORY>    the working directory that is the root for the CLI editor and is the
                                                                   root from which to look for included macro files
 
+The APEX CLI Tosca Editor
+-------------------------
+
+         .. container:: paragraph
+
+            As per the new Policy LifeCycle API, the policies are expected to be defined as ToscaServiceTemplate. The CLI Tosca Editor is an extended version of the APEX CLI Editor which can generate the policies in ToscaServiceTemplate way.
+
+         .. container:: paragraph
+
+            The APEX config file(.json), command file(.apex) and the tosca template skeleton(.json) file paths need to be passed as input arguments to the CLI Tosca Editor. Policy in ToscaServiceTemplate format is generated as the output. This can be used as the input to Policy API for creating policies.
+
+         .. container:: paragraph
+
+            On UNIX and Cygwin systems use:
+
+         .. container:: ulist
+
+            -  ``apexCLIToscaEditor.sh`` - starts the CLI Tosca editor,
+               all the arguments supported by the basic CLI Editor are supported in addition to the mandatory arguments needed to generate ToscaServiceTemplate.
+
+            -  ``apexApps.sh cli-tosca-editor`` - starts the CLI Tosca editor,
+               all the arguments supported by the basic CLI Editor are supported in addition to the mandatory arguments needed to generate ToscaServiceTemplate.
+
+         .. container:: paragraph
+
+            On Windows systems use:
+
+         .. container:: ulist
+
+            -  ``apexCLIToscaEditor.bat`` - starts the CLI Tosca editor,
+               all the arguments supported by the basic CLI Editor are supported in addition to the mandatory arguments needed to generate ToscaServiceTemplate.
+
+            -  ``apexApps.bat cli-tosca-editor`` - starts the CLI Tosca
+               editor, all the arguments supported by the basic CLI Editor are supported in addition to the mandatory arguments needed to generate ToscaServiceTemplate.
+
+         .. container:: paragraph
+
+            Summary of alternatives to start the APEX CLI Tosca Editor:
+
+     +-----------------------------------------------------------------+--------------------------------------------------------------------+
+     | Unix, Cygwin                                                    | Windows                                                            |
+     +=================================================================+====================================================================+
+     | .. container::                                                  | .. container::                                                     |
+     |                                                                 |                                                                    |
+     |    .. container:: listingblock                                  |    .. container:: listingblock                                     |
+     |                                                                 |                                                                    |
+     |       .. container:: content                                    |       .. container:: content                                       |
+     |                                                                 |                                                                    |
+     |          .. code::                                              |          .. code::                                                 |
+     |                                                                 |                                                                    |
+     |             # $APEX_HOME/bin/apexCLIToscaEditor.sh.sh [args]    |             > %APEX_HOME%\bin\apexCLIToscaEditor.bat [args]        |
+     |             # $APEX_HOME/bin/apexApps.sh cli-tosca-editor [args]|             > %APEX_HOME%\bin\apexApps.bat cli-tosca-editor [args] |
+     +-----------------------------------------------------------------+--------------------------------------------------------------------+
+
+         .. container:: paragraph
+
+            The option ``-h`` provides a help screen with all command
+            line arguments.
+
+         .. container:: listingblock
+
+            .. container:: content
+
+               .. code::
+
+                  usage: org.onap.policy.apex.auth.clieditor.tosca.ApexCliToscaEditorMain [options...]
+                  options
+                   -a,--model-props-file <MODEL_PROPS_FILE>         name of the apex model properties file to use
+                   -ac,--apex-config-file <APEX_CONFIG_FILE>        name of the file containing apex configuration details
+                   -c,--command-file <COMMAND_FILE>                 name of a file containing editor commands to run into the editor
+                   -h,--help                                        outputs the usage of this command
+                   -i,--input-model-file <INPUT_MODEL_FILE>         name of a file that contains an input model for the editor
+                   -if,--ignore-failures <IGNORE_FAILURES_FLAG>     true or false, ignore failures of commands in command files and
+                                                                    continue executing the command file
+                   -l,--log-file <LOG_FILE>                         name of a file that will contain command logs from the editor, will
+                                                                    log to standard output if not specified or suppressed with "-nl" flag
+                   -m,--metadata-file <CMD_METADATA_FILE>           name of the command metadata file to use
+                   -nl,--no-log                                     if specified, no logging or output of commands to standard output or
+                                                                    log file is carried out
+                   -ot,--output-tosca-file <OUTPUT_TOSCA_FILE>      name of a file that will contain the output ToscaServiceTemplate
+                   -t,--tosca-template-file <TOSCA_TEMPLATE_FILE>   name of the input file containing tosca template which needs to be
+                                                                    updated with policy
+                   -wd,--working-directory <WORKING_DIRECTORY>      the working directory that is the root for the CLI editor and is the
+                                                                    root from which to look for included macro files
+
+         .. container:: paragraph
+
+            An example command to run the APEX CLI Tosca editor on windows machine is given below.
+
+         .. container:: listingblock
+
+            .. container:: content
+
+               .. code::
+
+                  %APEX_HOME%/\bin/\apexCLIToscaEditor.bat -c %APEX_HOME%\examples\PolicyModel.apex -ot %APEX_HOME%\examples\test.json  -l %APEX_HOME%\examples\test.log -ac %APEX_HOME%\examples\RESTServerStandaloneJsonEvent.json -t %APEX_HOME%\examples\ToscaTemplate.json
+
 The APEX REST Editor
 --------------------
 
@@ -3939,7 +4287,7 @@ The APEX REST Editor
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   usage: org.onap.policy.apex.client.editor.rest.ApexEditorMain [options...]
                   -h,--help                        outputs the usage of this command
@@ -3958,7 +4306,7 @@ The APEX REST Editor
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   Apex Editor REST endpoint (ApexEditorMain: Config=[ApexEditorParameters: URI=http://localhost:18989/apexservices/, TTL=-1sec], State=READY) starting at http://localhost:18989/apexservices/ . . .
                   Sep 05, 2018 11:24:30 PM org.glassfish.grizzly.http.server.NetworkListener start
@@ -4012,7 +4360,7 @@ The APEX Monitoring Client
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   usage: org.onap.policy.apex.client.monitoring.rest.ApexMonitoringRestMain [options...]
                   -h,--help                        outputs the usage of this command
@@ -4028,7 +4376,7 @@ The APEX Monitoring Client
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   Apex Services REST endpoint (ApexMonitoringRestMain: Config=[ApexMonitoringRestParameters: URI=http://localhost:18989/apexservices/, TTL=-1sec], State=READY) starting at http://localhost:18989/apexservices/ . . .
                   Sep 05, 2018 11:26:20 PM org.glassfish.grizzly.http.server.NetworkListener start
@@ -4082,7 +4430,7 @@ The APEX Deployment Client
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   usage: org.onap.policy.apex.client.deployment.rest.ApexDeploymentRestMain [options...]
                   -h,--help                        outputs the usage of this command
@@ -4098,7 +4446,7 @@ The APEX Deployment Client
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   Apex Services REST endpoint (ApexDeploymentRestMain: Config=[ApexDeploymentRestParameters: URI=http://localhost:18989/apexservices/, TTL=-1sec], State=READY) starting at http://localhost:18989/apexservices/ . . .
                   Sep 05, 2018 11:27:09 PM org.glassfish.grizzly.http.server.NetworkListener start
@@ -4155,7 +4503,7 @@ The APEX Full Client
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   usage: org.onap.policy.apex.client.full.rest.ApexServicesRestMain [options...]
                   -h,--help                        outputs the usage of this command
@@ -4171,7 +4519,7 @@ The APEX Full Client
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   Apex Editor REST endpoint (ApexServicesRestMain: Config=[ApexServicesRestParameters: URI=http://localhost:18989/apexservices/, TTL=-1sec], State=READY) starting at http://localhost:18989/apexservices/ . . .
                   Sep 05, 2018 11:28:28 PM org.glassfish.grizzly.http.server.NetworkListener start
@@ -4240,7 +4588,7 @@ The APEX Full Client
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   apexApps.sh - runs APEX applications
 
@@ -4260,7 +4608,7 @@ The APEX Full Client
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   apexApps.sh: supported applications:
                    --> ws-echo engine eng-monitoring full-client eng-deployment tpl-event-json model-2-cli rest-editor cli-editor ws-console
@@ -4274,7 +4622,7 @@ The APEX Full Client
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   apexApps.sh: application 'ws-console'
                    --> a simple console sending events to APEX, connect to APEX consumer port
@@ -4290,7 +4638,7 @@ The APEX Full Client
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   apexApps.sh ws-echo -p 8888
 
@@ -4333,7 +4681,7 @@ Application: Create Event Templates
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   gen-model2event v{release-version} - generates JSON templates for events generated from a policy model
                   usage: gen-model2event
@@ -4355,7 +4703,7 @@ Application: Create Event Templates
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   apexApps.sh tpl-event-json -m $APEX_HOME/examples/models/SampleDomain/SamplePolicyModelJAVA.json -t stimuli
 
@@ -4367,7 +4715,7 @@ Application: Create Event Templates
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   gen-model2event: starting Event generator
                    --> model file: examples/models/SampleDomain/SamplePolicyModelJAVA.json
@@ -4407,7 +4755,7 @@ Application: Create Event Templates
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   {
                           "name" : "Event0000",
@@ -4457,7 +4805,7 @@ Application: Convert a Policy Model to CLI Editor Commands
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   usage: gen-model2cli
                    -h,--help                 prints this help and usage screen
@@ -4474,7 +4822,7 @@ Application: Convert a Policy Model to CLI Editor Commands
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   apexApps.sh model-2-cli -m $APEX_HOME/examples/models/SampleDomain/SamplePolicyModelJAVA.json
 
@@ -4486,7 +4834,7 @@ Application: Convert a Policy Model to CLI Editor Commands
 
             .. container:: content
 
-               .. code:: 
+               .. code::
 
                   gen-model2cli: starting CLI generator
                    --> model file: examples/models/SampleDomain/SamplePolicyModelJAVA.json
@@ -4942,32 +5290,32 @@ Create the input event ``SALE_INPUT`` and the output event ``SALE_AUTH``
                parameter fields.
 
             .. tip
-                       
-                          .. container:: title
-                          
-                             Field Schema types                                        
-               
-                          .. container:: paragraph
-                          
-                             APEX natively supports schema definitions in ``Java`` and ``Avro``.                                                 
-                                                                                       
-                          .. container:: paragraph                                     
-                                                                                       
-                             ``Java`` schema definitions are simply the name of a Java Class. There are some restrictions:                                             
-                                                                                       
-                          .. container:: ulist                                         
-                                                                                       
-                             -  the class must be instantiatable, i.e. not an Java interface or abstract class                                                  
-                                                                                       
-                             -  primitive types are not supported, i.e. use ``java.lang.Integer`` instead of ``int``, etc.                               
-                                                                                       
-                             -  it must be possible to find the class, i.e. the class must be contained in the Java classpath.                                        
-                                                                                       
-                          .. container:: paragraph                                     
-                                                                                       
-                             ``Avro`` schema definitions can be any valid `Avro <https://avro.apache.org/docs/current/spec.html>`__ 
-                             schema. For events using fields defined with ``Avro`` schemas, any incoming event containing that field must                                
-                             contain a value that conforms to the Avro schema.                                       
+
+               .. container:: title
+
+                  Field Schema types
+
+               .. container:: paragraph
+
+                  APEX natively supports schema definitions in ``Java`` and ``Avro``.
+
+               .. container:: paragraph
+
+                  ``Java`` schema definitions are simply the name of a Java Class. There are some restrictions:
+
+               .. container:: ulist
+
+                  -  the class must be instantiatable, i.e. not an Java interface or abstract class
+
+                  -  primitive types are not supported, i.e. use ``java.lang.Integer`` instead of ``int``, etc.
+
+                  -  it must be possible to find the class, i.e. the class must be contained in the Java classpath.
+
+               .. container:: paragraph
+
+                  ``Avro`` schema definitions can be any valid `Avro <https://avro.apache.org/docs/current/spec.html>`__
+                  schema. For events using fields defined with ``Avro`` schemas, any incoming event containing that field must
+                  contain a value that conforms to the Avro schema.
 
             .. container:: paragraph
 
@@ -5004,10 +5352,10 @@ Create the input event ``SALE_INPUT`` and the output event ``SALE_AUTH``
                the event definition pane.
 
             .. tip::
-                          Optional Fields in APEX Events
-                          Parameter fields can be *optional* in events. If a parameter is not marked as *optional* then by default it
-                          is *mandatory*, so it must appear in any input event passed to APEX. If an *optional* field is not set
-                          for an output event then value will be set to ``null``.
+               Optional Fields in APEX Events
+               Parameter fields can be *optional* in events. If a parameter is not marked as *optional* then by default it
+               is *mandatory*, so it must appear in any input event passed to APEX. If an *optional* field is not set
+               for an output event then value will be set to ``null``.
 
             .. container:: imageblock
 
@@ -5217,7 +5565,7 @@ Create a new Policy and add the *"No Booze before 11:30"* check
 
                .. container:: content
 
-                  .. code:: 
+                  .. code::
 
                      /*
                       * ============LICENSE_START=======================================================
@@ -5325,7 +5673,7 @@ Create a new Policy and add the *"No Booze before 11:30"* check
 
                .. container:: content
 
-                  .. code:: 
+                  .. code::
 
                      /*
                       * ============LICENSE_START=======================================================
@@ -5494,60 +5842,60 @@ Create a new Policy and add the *"No Booze before 11:30"* check
                default task is automatically selected and no 'Task
                Selection Logic' is required.
 
-            .. note:: 
-                          .. container:: title 
-                          
-                             State Output Mappings 
-
-               .. container:: paragraph                                             
-
-                             In a 'Policy' 'State' a 'State Output Mapping' has 3 roles:      
-                             1) Select which 'State' should be executed next, 2) Select       
-                             the type of the state’s 'Outgoing Event', and 3)                 
-                             Populate the state’s 'Outgoing Event'. This is how states are    
-                             chained together to form a (`Directed Acyclic Graph              
-                             (DAG) <https://en.wikipedia.org/wiki/Directed_acyclic_graph>`__ )
-                             of states. The final state(s) of a policy are those that do      
-                             not select any 'next' state. Since a 'State' can only            
-                             accept a single type of event, the type of the event emitted     
-                             by a previous 'State' must be match the incoming event type      
-                             of the next 'State'. This is also how the last state(s) in       
-                             a policy can emit events of different types. The 'State          
-                             Output Mapping' is also responsible for taking the               
-                             fields that are output by the task executed in the state and     
-                             populating the state’s output event before it is emitted.        
-                                                                                            
-               .. container:: paragraph                                           
-                                                                                            
-                             Each 'Task' referenced in 'State' must have a defined            
-                             'Output Mapping' to take the output of the task, select an       
-                             'Outgoing Event' type for the state, populate the state’s        
-                             outgoing event, and then select the next state to be             
-                             executed (if any).                                               
-                                                                                            
-               .. container:: paragraph                                             
-                                                                                            
-                          There are 2 basic types of output mappings:                       
-                                                                                            
-               .. container:: olist arabic                                          
-                                                                                            
-                          #. **Direct Output Mappings** have a single value for             
-                             'Next State' and a single value for 'State Output              
-                             Event'. The outgoing event for the state is                    
-                             automatically created, any outgoing event parameters           
-                             that were present in the incoming event are copied             
-                             into the outgoing event, then any task output fields           
-                             that have the same name and type as parameters in the          
-                             outgoing event are automatically copied into                   
-                             the outgoing event.                                            
-                                                                                            
-                          #. **Logic-based State Output Mappings / Finalizers**             
-                             have some logic defined that dynamically selects               
-                             and creates the 'State Outgoing Event', manages                
-                             the population of the outgoing event parameters                
-                             (perhaps changing or adding to the outputs from the            
-                             task), and then dynamically selects the next state to          
-                             be executed (if any).                                          
+            .. note::
+               .. container:: title
+
+                  State Output Mappings
+
+               .. container:: paragraph
+
+                  In a 'Policy' 'State' a 'State Output Mapping' has 3 roles:
+                  1) Select which 'State' should be executed next, 2) Select
+                  the type of the state’s 'Outgoing Event', and 3)
+                  Populate the state’s 'Outgoing Event'. This is how states are
+                  chained together to form a (`Directed Acyclic Graph
+                  (DAG) <https://en.wikipedia.org/wiki/Directed_acyclic_graph>`__ )
+                  of states. The final state(s) of a policy are those that do
+                  not select any 'next' state. Since a 'State' can only
+                  accept a single type of event, the type of the event emitted
+                  by a previous 'State' must be match the incoming event type
+                  of the next 'State'. This is also how the last state(s) in
+                  a policy can emit events of different types. The 'State
+                  Output Mapping' is also responsible for taking the
+                  fields that are output by the task executed in the state and
+                  populating the state’s output event before it is emitted.
+
+               .. container:: paragraph
+
+                  Each 'Task' referenced in 'State' must have a defined
+                  'Output Mapping' to take the output of the task, select an
+                  'Outgoing Event' type for the state, populate the state’s
+                  outgoing event, and then select the next state to be
+                  executed (if any).
+
+               .. container:: paragraph
+
+               There are 2 basic types of output mappings:
+
+               .. container:: olist arabic
+
+               #. **Direct Output Mappings** have a single value for
+                  'Next State' and a single value for 'State Output
+                  Event'. The outgoing event for the state is
+                  automatically created, any outgoing event parameters
+                  that were present in the incoming event are copied
+                  into the outgoing event, then any task output fields
+                  that have the same name and type as parameters in the
+                  outgoing event are automatically copied into
+                  the outgoing event.
+
+               #. **Logic-based State Output Mappings / Finalizers**
+                  have some logic defined that dynamically selects
+                  and creates the 'State Outgoing Event', manages
+                  the population of the outgoing event parameters
+                  (perhaps changing or adding to the outputs from the
+                  task), and then dynamically selects the next state to
+                  be executed (if any).
 
             .. container:: paragraph
 
@@ -5841,7 +6189,7 @@ Test Policy Step 1
 
                .. container:: content
 
-                  .. code:: 
+                  .. code::
 
                      #-------------------------------------------------------------------------------
                      # ============LICENSE_START=======================================================
@@ -6143,7 +6491,7 @@ Extend the Policy with the new Scenario
 
                .. container:: content
 
-                  .. code:: 
+                  .. code::
 
                      /*
                       * ============LICENSE_START=======================================================
@@ -6320,7 +6668,7 @@ Extend the Policy with the new Scenario
 
                .. container:: content
 
-                  .. code:: 
+                  .. code::
 
                      /*
                       * ============LICENSE_START=======================================================
@@ -6429,7 +6777,7 @@ Test Policy Step 2
 
                .. container:: content
 
-                  .. code:: 
+                  .. code::
 
                      {
                          "engineServiceParameters" : {
@@ -6499,26 +6847,26 @@ Test Policy Step 2
                |                                              |                                                            |                           |
                |                                              |                                                            | at *08:41:06              |
                |                                              |       .. container:: content                               | GMT* on *Monday,          |
-               |       .. container:: content                 |                                                            | 02 January                |        
+               |       .. container:: content                 |                                                            | 02 January                |
                |                                              |          .. code::                                         | 2017*.                    |
                |                                              |                                                            |                           |
-               |                                              |             {                                              | Sale is not               |    
+               |                                              |             {                                              | Sale is not               |
                |          .. code::                           |               "nameSpace": "com.hyperm",                   | authorized. Uses          |
                |                                              |               "name": "SALE_AUTH",                         | the                       |
                |                                              |               "version": "0.0.1",                          | ``MorningBoozeCheck``     |
                |             {                                |               "source": "",                                |                           |
-               |               "nameSpace": "com.hyperm",     |               "target": "",                                | task.                     |     
+               |               "nameSpace": "com.hyperm",     |               "target": "",                                | task.                     |
                |               "name": "SALE_INPUT",          |               "amount": 1249,                              |                           |
                |                "version": "0.0.1",           |               "assistant_ID":12,                           | Note this test            |
                |               "time": 1483346466000,         |               "authorised": false,                         | is copied from            |
                |               "sale_ID": 99999992,           |               "branch_ID": 2,                              | Step 1 above,             |
-               |               "amount": 1249,                |               "item_ID": 1012,                             | and demonstrates          |    
+               |               "amount": 1249,                |               "item_ID": 1012,                             | and demonstrates          |
                |               "item_ID": 1012,               |               "message": "Sale not authorised by policy ta | that the                  |
                |               "quantity": 1,                 |                sk MorningBoozeCheck for time 08:41:06  GMT.| original                  |
                |               "assistant_ID": 12,            |                Alcohol can not be sold between 00:00:00    | ``MorningBoozeCheck``     |
                |               "branch_ID": 2                 |                GMT and 11:30:00 GMT",                      |                           |
                |              }                               |               "notes": null,                               | task is                   |
-               |                                              |               "quantity": 1,                               | executed.                 |    
+               |                                              |               "quantity": 1,                               | executed.                 |
                |                                              |               "sale_ID": 99999992,                         |                           |
                |                                              |               "time": 1483346466000                        |                           |
                |                                              |             }                                              |                           |
@@ -6633,7 +6981,7 @@ Policy 2 in CLI Editor
 
                .. container:: content
 
-                  .. code:: 
+                  .. code::
 
                      #-------------------------------------------------------------------------------
                      # ============LICENSE_START=======================================================
@@ -7044,7 +7392,7 @@ Standard Logging Configuration
 
             The standard logging configuration defines a context *APEX*,
             which is used in the standard output pattern. The location
-            for log files is defined in the property ``VAR_LOG`` and set
+            for log files is defined in the property ``logDir`` and set
             to ``/var/log/onap/policy/apex-pdp``. The standard status
             listener is set to *NOP* and the overall logback
             configuration is set to no debug.
@@ -7053,14 +7401,14 @@ Standard Logging Configuration
 
             .. container:: content
 
-               .. code:: 
+               .. code::
                  :number-lines:
 
                  <configuration debug="false">
                    <statusListener class="ch.qos.logback.core.status.NopStatusListener" />
 
                     <contextName>Apex</contextName>
-                    <property name="VAR_LOG" value="/var/log/onap/policy/apex-pdp/" />
+                    <property name="logDir" value="/var/log/onap/policy/apex-pdp/" />
 
                    ...appenders
                    ...loggers
@@ -7075,7 +7423,7 @@ Standard Logging Configuration
 
    .. container:: content
 
-      .. code:: 
+      .. code::
         :number-lines:
 
         <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
@@ -7093,7 +7441,7 @@ Standard Logging Configuration
 
    .. container:: content
 
-      .. code:: 
+      .. code::
         :number-lines:
 
         <root level="info">
@@ -7109,11 +7457,11 @@ Standard Logging Configuration
 
    .. container:: content
 
-      .. code:: 
+      .. code::
         :number-lines:
 
         <appender name="FILE" class="ch.qos.logback.core.FileAppender">
-          <file>${VAR_LOG}/apex.log</file>
+          <file>${logDir}/apex.log</file>
           <encoder>
             <pattern>%d %-5relative [procId=${processId}] [%thread] %-5level %logger{26} - %msg %n %ex{full}</pattern>
           </encoder>
@@ -7128,11 +7476,11 @@ Standard Logging Configuration
 
    .. container:: content
 
-      .. code:: 
+      .. code::
         :number-lines:
 
         <appender name="CTXT_FILE" class="ch.qos.logback.core.FileAppender">
-          <file>${VAR_LOG}/apex_ctxt.log</file>
+          <file>${logDir}/apex_ctxt.log</file>
           <encoder>
             <pattern>%d %-5relative [procId=${processId}] [%thread] %-5level %logger{26} - %msg %n %ex{full}</pattern>
           </encoder>
@@ -7151,7 +7499,7 @@ Standard Logging Configuration
 
    .. container:: content
 
-      .. code:: 
+      .. code::
         :number-lines:
 
 
@@ -7176,7 +7524,7 @@ Adding Logback Status and Debug
 
       .. container:: content
 
-         .. code:: 
+         .. code::
 
             <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" />
 
@@ -7190,7 +7538,7 @@ Adding Logback Status and Debug
 
       .. container:: content
 
-         .. code:: 
+         .. code::
 
             <configuration debug="true">
             ...
@@ -7216,7 +7564,7 @@ Logging External Components
 
       .. container:: content
 
-         .. code:: 
+         .. code::
 
             <logger name="org.infinispan" level="INFO" additivity="false">
               <appender-ref ref="STDOUT" />
@@ -7231,7 +7579,7 @@ Logging External Components
 
       .. container:: content
 
-         .. code:: 
+         .. code::
 
             <logger name="org.apache.zookeeper.ClientCnxn" level="INFO" additivity="false">
               <appender-ref ref="STDOUT" />
@@ -7260,7 +7608,7 @@ Configuring loggers for Policy Logic
 
       .. container:: content
 
-         .. code:: 
+         .. code::
 
             <appender name="POLICY_APPENDER_STDOUT" class="ch.qos.logback.core.ConsoleAppender">
               <encoder>
@@ -7282,7 +7630,7 @@ Configuring loggers for Policy Logic
 
       .. container:: content
 
-         .. code:: 
+         .. code::
 
             <logger name="org.onap.policy.apex.executionlogging.TaskExecutionLogging" level="TRACE" additivity="false">
               <appender-ref ref="POLICY_APPENDER_STDOUT" />
@@ -7309,14 +7657,14 @@ Rolling File Appenders
 
       .. container:: content
 
-         .. code:: 
+         .. code::
 
             <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
-              <file>${VAR_LOG}/apex.log</file>
+              <file>${logDir}/apex.log</file>
               <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
                 <!-- rollover daily -->
                 <!-- <fileNamePattern>xstream-%d{yyyy-MM-dd}.%i.txt</fileNamePattern> -->
-                <fileNamePattern>${VAR_LOG}/apex_%d{yyyy-MM-dd}.%i.log.gz
+                <fileNamePattern>${logDir}/apex_%d{yyyy-MM-dd}.%i.log.gz
                 </fileNamePattern>
                 <maxHistory>4</maxHistory>
                 <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
@@ -7340,13 +7688,13 @@ Rolling File Appenders
 
       .. container:: content
 
-         .. code:: 
+         .. code::
 
             <appender name="CTXT-FILE"
                   class="ch.qos.logback.core.rolling.RollingFileAppender">
-              <file>${VAR_LOG}/apex_ctxt.log</file>
+              <file>${logDir}/apex_ctxt.log</file>
               <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-                <fileNamePattern>${VAR_LOG}/apex_ctxt_%d{yyyy-MM-dd}.%i.log.gz
+                <fileNamePattern>${logDir}/apex_ctxt_%d{yyyy-MM-dd}.%i.log.gz
                 </fileNamePattern>
                 <maxHistory>4</maxHistory>
                 <timeBasedFileNamingAndTriggeringPolicy
@@ -7378,13 +7726,13 @@ Example Configuration for Logging Logic
 
       .. container:: content
 
-         .. code:: 
+         .. code::
 
             <configuration debug="false">
                 <statusListener class="ch.qos.logback.core.status.NopStatusListener" />
 
                 <contextName>Apex</contextName>
-                <property name="VAR_LOG" value="/var/log/onap/policy/apex-pdp/" />
+                <property name="logDir" value="/var/log/onap/policy/apex-pdp/" />
 
                 <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
                     <encoder>
@@ -7393,7 +7741,7 @@ Example Configuration for Logging Logic
                 </appender>
 
                 <appender name="FILE" class="ch.qos.logback.core.FileAppender">
-                    <file>${VAR_LOG}/apex.log</file>
+                    <file>${logDir}/apex.log</file>
                     <encoder>
                         <pattern>
                             %d %-5relative [procId=${processId}] [%thread] %-5level%logger{26} - %msg %n %ex{full}
@@ -7437,16 +7785,16 @@ Example Configuration for a Production Server
 
       .. container:: content
 
-         .. code:: 
+         .. code::
 
             <configuration debug="false">
                 <statusListener class="ch.qos.logback.core.status.NopStatusListener" />
 
                 <contextName>Apex</contextName>
-                <property name="VAR_LOG" value="/var/log/onap/policy/apex-pdp/" />
+                <property name="logDir" value="/var/log/onap/policy/apex-pdp/" />
 
                 <appender name="FILE" class="ch.qos.logback.core.FileAppender">
-                    <file>${VAR_LOG}/apex.log</file>
+                    <file>${logDir}/apex.log</file>
                     <encoder>
                         <pattern>
                             %d %-5relative [procId=${processId}] [%thread] %-5level%logger{26} - %msg %n %ex{full}
@@ -7611,7 +7959,7 @@ A Websocket Configuration for the VPN Domain
 
                .. container:: content
 
-                  .. code:: 
+                  .. code::
                     :number-lines:
 
                     {
@@ -7674,7 +8022,7 @@ Start APEX Engine
 
       .. container:: content
 
-         .. code:: 
+         .. code::
             :number-lines:
 
             #: $APEX_HOME/bin/apexEngine.sh -c $APEX_HOME/examples/config/VPN/Ws2WsServerAvroContextJsonEvent.json
@@ -7683,7 +8031,7 @@ Start APEX Engine
 
    .. container:: content
 
-      .. code:: 
+      .. code::
         :number-lines:
 
         #: %APEX_HOME%\bin\apexEngine.bat -c %APEX_HOME%\examples\config\VPN\Ws2WsServerAvroContextJsonEvent.json
@@ -7700,7 +8048,7 @@ Start APEX Engine
 
    .. container:: content
 
-      .. code:: 
+      .. code::
         :number-lines:
 
          2017-07-28 13:17:20,834 Apex [main] INFO c.e.a.s.engine.runtime.EngineService - engine model VPNPolicyModelAvro:0.0.1 added to the engine-AxArtifactKey:(name=VPNApexEngine-0,version=0.0.1)
@@ -7723,9 +8071,9 @@ Run the Websocket Echo Client
       (``cmd`` on Windows). Then use the APEX application launcher to
       start the client.
 
-   .. important::  
+   .. important::
       APEX engine needs to run first
-         The example assumes that an APEX engine configured for *produce* carrier technology Websocket and *JSON* event protocol is executed first.
+      The example assumes that an APEX engine configured for *produce* carrier technology Websocket and *JSON* event protocol is executed first.
 
    +---------------------------------------------------------+-----------------------------------------------------------+
    | Unix, Cygwin                                            | Windows                                                   |
@@ -7768,7 +8116,7 @@ Run the Websocket Echo Client
 
       .. container:: content
 
-         .. code:: 
+         .. code::
 
             # $APEX_HOME/bin/apexApps.sh ws-echo -p 42452 (1)
             > %APEX_HOME%\bin\apexApps.bat ws-echo -p 42452 (2)
@@ -7791,7 +8139,7 @@ Run the Websocket Echo Client
 
       .. container:: content
 
-         .. code:: 
+         .. code::
 
             ws-simple-echo: starting simple event echo
              --> server: localhost
@@ -7813,10 +8161,10 @@ Run the Websocket Console Client
       (``cmd`` on Windows). Then use the APEX application launcher to
       start the client.
 
-   .. important::  
+   .. important::
       APEX engine needs to run first
-         The example assumes that an APEX engine configured for *consume* carrier technology Websocket and *JSON* event
-         protocol is executed first.
+      The example assumes that an APEX engine configured for *consume* carrier technology Websocket and *JSON* event
+      protocol is executed first.
 
    +------------------------------------------------------------+--------------------------------------------------------------+
    | Unix, Cygwin                                               | Windows                                                      |
@@ -7859,7 +8207,7 @@ Run the Websocket Console Client
 
       .. container:: content
 
-         .. code:: 
+         .. code::
 
             # $APEX_HOME/bin/apexApps.sh ws-console -p 42450 (1)
             > %APEX_HOME%\bin\apexApps.sh ws-console -p 42450 (2)
@@ -7882,7 +8230,7 @@ Run the Websocket Console Client
 
       .. container:: content
 
-         .. code:: 
+         .. code::
 
             ws-simple-console: starting simple event console
              --> server: localhost
@@ -7921,7 +8269,7 @@ Send Events
 
       .. container:: content
 
-         .. code:: 
+         .. code::
            :number-lines:
 
            #: $APEX_HOME/examples/events/VPN
@@ -7940,7 +8288,7 @@ Send Events
 
    .. container:: content
 
-      .. code:: 
+      .. code::
         :number-lines:
 
         {Link=L09, LinkUp=true}
@@ -7982,7 +8330,7 @@ Send Events
 
    .. container:: content
 
-      .. code:: 
+      .. code::
         :number-lines:
 
         ws-simple-echo: received