From: Saryu Shah Date: Mon, 13 Nov 2017 16:13:39 +0000 (+0000) Subject: Documentation for Modify Amsterdam Template X-Git-Tag: v1.1.1~4^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=commitdiff_plain;h=538159381880b761aa4556987c20e8e769524db1 Documentation for Modify Amsterdam Template Documentation for Modify Amsterdam Template ------------------------------------------------------------- Change-Id: I824c3bf3f09d912a043e5323b9ad14aec07019bd Issue-Id: POLICY-335 Signed-off-by: Saryu Shah --- 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 + +