From 538159381880b761aa4556987c20e8e769524db1 Mon Sep 17 00:00:00 2001 From: Saryu Shah Date: Mon, 13 Nov 2017 16:13:39 +0000 Subject: Documentation for Modify Amsterdam Template Documentation for Modify Amsterdam Template ------------------------------------------------------------- Change-Id: I824c3bf3f09d912a043e5323b9ad14aec07019bd Issue-Id: POLICY-335 Signed-off-by: Saryu Shah --- docs/platform/index.rst | 1 + docs/platform/mat_add_local_catalog.JPG | Bin 0 -> 52472 bytes docs/platform/mat_amsterdam_controller.JPG | Bin 0 -> 25950 bytes docs/platform/mat_amsterdam_drl.JPG | Bin 0 -> 68380 bytes docs/platform/mat_amsterdam_project.JPG | Bin 0 -> 52954 bytes docs/platform/mat_archetype_params.JPG | Bin 0 -> 76417 bytes docs/platform/mat_archetypes.JPG | Bin 0 -> 89327 bytes docs/platform/mat_build_success.JPG | Bin 0 -> 23328 bytes docs/platform/mat_clean_install.JPG | Bin 0 -> 72927 bytes docs/platform/mat_configure.JPG | Bin 0 -> 87992 bytes docs/platform/mat_console_output.JPG | Bin 0 -> 89889 bytes docs/platform/mat_error.JPG | Bin 0 -> 53417 bytes docs/platform/mat_hello_world.JPG | Bin 0 -> 145658 bytes docs/platform/mat_maven_build.JPG | Bin 0 -> 101485 bytes docs/platform/mat_maven_project.JPG | Bin 0 -> 93143 bytes docs/platform/mat_new_project.JPG | Bin 0 -> 58858 bytes docs/platform/mat_nexus_catalog.JPG | Bin 0 -> 35621 bytes docs/platform/mat_project_location.JPG | Bin 0 -> 93686 bytes docs/platform/mat_run_as.JPG | Bin 0 -> 153171 bytes docs/platform/modAmsterTemplate.rst | 102 +++++++++++++++++++++++++++++ 20 files changed, 103 insertions(+) create mode 100755 docs/platform/mat_add_local_catalog.JPG create mode 100755 docs/platform/mat_amsterdam_controller.JPG create mode 100755 docs/platform/mat_amsterdam_drl.JPG create mode 100755 docs/platform/mat_amsterdam_project.JPG create mode 100755 docs/platform/mat_archetype_params.JPG create mode 100755 docs/platform/mat_archetypes.JPG create mode 100755 docs/platform/mat_build_success.JPG create mode 100755 docs/platform/mat_clean_install.JPG create mode 100755 docs/platform/mat_configure.JPG create mode 100755 docs/platform/mat_console_output.JPG create mode 100755 docs/platform/mat_error.JPG create mode 100755 docs/platform/mat_hello_world.JPG create mode 100755 docs/platform/mat_maven_build.JPG create mode 100755 docs/platform/mat_maven_project.JPG create mode 100755 docs/platform/mat_new_project.JPG create mode 100755 docs/platform/mat_nexus_catalog.JPG create mode 100755 docs/platform/mat_project_location.JPG create mode 100755 docs/platform/mat_run_as.JPG create mode 100644 docs/platform/modAmsterTemplate.rst diff --git a/docs/platform/index.rst b/docs/platform/index.rst index 39214543b..92faac72d 100644 --- a/docs/platform/index.rst +++ b/docs/platform/index.rst @@ -10,6 +10,7 @@ Policy Engine Platform offeredapis.rst installation.rst policygui.rst + modAmsterTemplate.rst Policy Software Architecture ---------------------------- diff --git a/docs/platform/mat_add_local_catalog.JPG b/docs/platform/mat_add_local_catalog.JPG new file mode 100755 index 000000000..abcb677ac Binary files /dev/null and b/docs/platform/mat_add_local_catalog.JPG differ diff --git a/docs/platform/mat_amsterdam_controller.JPG b/docs/platform/mat_amsterdam_controller.JPG new file mode 100755 index 000000000..e44be601e Binary files /dev/null and b/docs/platform/mat_amsterdam_controller.JPG differ diff --git a/docs/platform/mat_amsterdam_drl.JPG b/docs/platform/mat_amsterdam_drl.JPG new file mode 100755 index 000000000..81e1374a4 Binary files /dev/null and b/docs/platform/mat_amsterdam_drl.JPG differ diff --git a/docs/platform/mat_amsterdam_project.JPG b/docs/platform/mat_amsterdam_project.JPG new file mode 100755 index 000000000..3f0d14c41 Binary files /dev/null and b/docs/platform/mat_amsterdam_project.JPG differ diff --git a/docs/platform/mat_archetype_params.JPG b/docs/platform/mat_archetype_params.JPG new file mode 100755 index 000000000..4d1b70a8c Binary files /dev/null and b/docs/platform/mat_archetype_params.JPG differ diff --git a/docs/platform/mat_archetypes.JPG b/docs/platform/mat_archetypes.JPG new file mode 100755 index 000000000..f60a3d9b2 Binary files /dev/null and b/docs/platform/mat_archetypes.JPG differ diff --git a/docs/platform/mat_build_success.JPG b/docs/platform/mat_build_success.JPG new file mode 100755 index 000000000..f0dcf3011 Binary files /dev/null and b/docs/platform/mat_build_success.JPG differ diff --git a/docs/platform/mat_clean_install.JPG b/docs/platform/mat_clean_install.JPG new file mode 100755 index 000000000..b8454520c Binary files /dev/null and b/docs/platform/mat_clean_install.JPG differ diff --git a/docs/platform/mat_configure.JPG b/docs/platform/mat_configure.JPG new file mode 100755 index 000000000..24445f9b3 Binary files /dev/null and b/docs/platform/mat_configure.JPG differ diff --git a/docs/platform/mat_console_output.JPG b/docs/platform/mat_console_output.JPG new file mode 100755 index 000000000..867c03d92 Binary files /dev/null and b/docs/platform/mat_console_output.JPG differ diff --git a/docs/platform/mat_error.JPG b/docs/platform/mat_error.JPG new file mode 100755 index 000000000..f59b66d1c Binary files /dev/null and b/docs/platform/mat_error.JPG differ diff --git a/docs/platform/mat_hello_world.JPG b/docs/platform/mat_hello_world.JPG new file mode 100755 index 000000000..e64051937 Binary files /dev/null and b/docs/platform/mat_hello_world.JPG differ diff --git a/docs/platform/mat_maven_build.JPG b/docs/platform/mat_maven_build.JPG new file mode 100755 index 000000000..fdaac4841 Binary files /dev/null and b/docs/platform/mat_maven_build.JPG differ diff --git a/docs/platform/mat_maven_project.JPG b/docs/platform/mat_maven_project.JPG new file mode 100755 index 000000000..8e88b49c3 Binary files /dev/null and b/docs/platform/mat_maven_project.JPG differ diff --git a/docs/platform/mat_new_project.JPG b/docs/platform/mat_new_project.JPG new file mode 100755 index 000000000..0f7b0691f Binary files /dev/null and b/docs/platform/mat_new_project.JPG differ diff --git a/docs/platform/mat_nexus_catalog.JPG b/docs/platform/mat_nexus_catalog.JPG new file mode 100755 index 000000000..5fc11844c Binary files /dev/null and b/docs/platform/mat_nexus_catalog.JPG differ diff --git a/docs/platform/mat_project_location.JPG b/docs/platform/mat_project_location.JPG new file mode 100755 index 000000000..5b94522fb Binary files /dev/null and b/docs/platform/mat_project_location.JPG differ diff --git a/docs/platform/mat_run_as.JPG b/docs/platform/mat_run_as.JPG new file mode 100755 index 000000000..7df839aa1 Binary files /dev/null and b/docs/platform/mat_run_as.JPG differ diff --git a/docs/platform/modAmsterTemplate.rst b/docs/platform/modAmsterTemplate.rst new file mode 100644 index 000000000..690dd5d70 --- /dev/null +++ b/docs/platform/modAmsterTemplate.rst @@ -0,0 +1,102 @@ + +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +**************************************** +Modifying the Amsterdam release template +**************************************** + +.. contents:: + :depth: 3 + + +This tutorial is intended for Policy Drools Applications developers who would like to test their code using the PDP-D in Eclipse instead of installing in a lab. The example for this tutorial will walk through making a change to the Amsterdam Control Loop Template, building the archetype project, and instantiating a controller with the PDP-D. + +Installing the Archetype Project in Eclipse +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +**STEP 1:** First, open the drools-pdp project in Eclipse and navigate to File → New → Project... + + .. image:: mat_new_project.JPG + +**STEP 2:** Navigate to Maven → Maven Project + + .. image:: mat_maven_project.JPG + +**STEP 3:** For demo purposes, the location of the project will be put in Documents/demo. Hit next to proceed. + + .. image:: mat_project_location.JPG + +**STEP 4:** Click "Configure" near the top right. + + .. image:: mat_configure.JPG + +**STEP 5:** Click "Add Remote Catalog..." + + .. image:: mat_add_local_catalog.JPG + +**STEP 6:** Add the ONAP Staging repository archetype-catalog.xml with a description if desired. Click "OK" then "Apply", then "OK". + + .. image:: mat_nexus_catalog.JPG + +**STEP 7:** The ONAP staging archetypes are now an option: + + .. image:: mat_archetypes.JPG + +**STEP 8:** Highlight the option with the Artifact Id "archetype-cl-amsterdam" and hit next. The following screen allows the user to modify some of the configurable parameters of the control loop. For this demo the default parameters that are already populated will be used. Fill out the Groud Id, Artifact Id, Version, and Package and hit "Finish". For the demo the following is used: + + .. image:: mat_archetype_params.JPG + +**STEP 9:** Depending on the IDE in use, an error may be generated about handling the kie-maven-plugin:6.5.0.Final:build plugin. This can be ignored, click "Finish" and then "OK" if a warning pops up about having build errors. + + .. image:: mat_error.JPG + +**STEP 10:** Amsterdam can now be seen in the Project Explorer: + + .. image:: mat_amsterdam_project.JPG + + +Modifying the Amsterdam Template +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +**STEP 1:** Expand the amsterdam project and "src/main/resources". The drl generated from the archetype will be present as follows: + + .. image:: mat_amsterdam_drl.JPG + +**STEP 2:** Now a change will be added to the drl from above. For this tutorial, a new logging statement will be added that will show in the console of Eclipse when the changes are tested. We'll add this in the SETUP rule. + + .. image:: mat_hello_world.JPG + +**STEP 3:** Right click on the Amsterdam project, hover over "Run As", then click "Maven build". + + .. image:: mat_maven_build.JPG + +**STEP 4:** For the goals type "clean install", click "Apply" and then click "Run". + + .. image:: mat_clean_install.JPG + + .. image:: mat_build_success.JPG + +Running the PDP-D with the Amsterdam Controller +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +**STEP 1:** Copy the controller properties file that was generated from the archetype in amsterdam/src/main/config into policy-management/src/main/config + + .. image:: mat_amsterdam_controller.JPG + +**STEP 2:** Go src/main/java and expand the package "org.onap.policy.drools.system". Right click on "Main.java", then hover over "Run As..." and click "Java Application". + + .. image:: mat_run_as.JPG + +**STEP 3:** Search through the console for the logging statement "\***** HELLO WORLD \*****". This indicates that the template change worked. Modifications can continue to be made and the Telemetry API can be used to interact with the PDP-D that is running in Eclipse and to test control loop flows. + + .. image:: mat_console_output.JPG + + + +End of Document + + +.. SSNote: Wiki page ref. https://wiki.onap.org/display/DW/Modifying+the+Amsterdam+release+template + + -- cgit 1.2.3-korg