From 8c69f0434102b0328ae4754783a01c36f7e35c97 Mon Sep 17 00:00:00 2001 From: "aditya.puthuparambil" Date: Thu, 19 Mar 2020 10:52:46 +0000 Subject: Apex-pdp tutorial documentation changes Issue-ID: POLICY-2424 Signed-off-by: aditya.puthuparambil Change-Id: I92491c904b65a0db93c9e6eaba676c653c276175 --- .../adoc/fragments/032-s1-new-events.adoc | 43 ++++++++++++---------- 1 file changed, 24 insertions(+), 19 deletions(-) (limited to 'examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/032-s1-new-events.adoc') diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/032-s1-new-events.adoc b/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/032-s1-new-events.adoc index 682d214ab..a8711dd3a 100644 --- a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/032-s1-new-events.adoc +++ b/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/032-s1-new-events.adoc @@ -1,32 +1,20 @@ // // ============LICENSE_START======================================================= // Copyright (C) 2016-2018 Ericsson. All rights reserved. +// Modifications Copyright (C) 2020 Nordix Foundation. // ================================================================================ // This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE // Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// +// // SPDX-License-Identifier: CC-BY-4.0 // ============LICENSE_END========================================================= // // @author Sven van der Meer (sven.van.der.meer@ericsson.com) // -=== Create the input event `SALE_INPUT` and the output event `SALE_AUTH` - -Using the APEX Policy Editor, click on the 'Events' tab. In the 'Events' pane, right click and select 'New': - -.Create a new Event type -image::mfp/MyFirstPolicy_P1_newEvent1.png[Right click to create a new event] +=== APEX Context Item Schemas -Create a new event type called `SALE_INPUT`. Use the 'Generate UUID' button to create a new unique ID for the event type, and fill in a description for the event. Add a namespace, e.g. `com.hyperm`. We can add hard-coded strings for the `Source` and `Target`, e.g. `POS` and `APEX`. At this stage we will not add any parameter fields, we will leave this until later. Use the `Submit` button to create the event. - -.Populate the `SALE_INPUT` event -image::mfp/MyFirstPolicy_P1_newEvent2.png["Fill in the necessary information for the 'SALE_INPUT' event and click 'Submit'"] - -Repeat the same steps for a new event type called `SALE_AUTH`. -Just use `APEX` as source and `POS` as target, since this is the output event coming from APEX going to the sales point. - -Before we can add parameter fields to an event we must first define APEX Context Item Schemas that can be used by those fields. +We must first define APEX Context Item Schemas that can be used as parameter fields to an event. To create new item schemas, click on the 'Context Item Schemas' tab. In that 'Context Item Schemas' pane, right click and select 'Create new ContextSchema'. @@ -54,7 +42,7 @@ Create item schemas with the following characteristics, each with its own unique .Create new Item Schemas image::mfp/MyFirstPolicy_P1_newItemSchema2.png["Create a new Item Schema"] -The item schemas can now be seen on the 'Context Item Schemas' tab, and can be updated at any time by right-clicking on the item schemas on the 'Context Item Schemas' tab. Now we can go back to the event definitions for `SALE_INPUT` and `SALE_AUTH` and add some parameter fields. +The item schemas can now be seen on the 'Context Item Schemas' tab, and can be updated at any time by right-clicking on the item schemas on the 'Context Item Schemas' tab. [TIP] .Field Schema types @@ -72,7 +60,19 @@ APEX natively supports schema definitions in `Java` and `Avro`. `Avro` schema definitions can be any valid https://avro.apache.org/docs/current/spec.html[Avro] 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. ================================ -Click on the 'Events' tab, then right click the `SALE_INPUT` row and select 'Edit Event `SALE_INPUT`'. To add a new event parameter use the 'Add Event Parameter' button at the bottom of the screen. For the `SALE_INPUT` event add the following event parameters: +=== Create the input event `SALE_INPUT` and the output event `SALE_AUTH` + +Using the APEX Policy Editor, click on the 'Events' tab. In the 'Events' pane, right click and select 'Create new Event': + +.Create a new Event type +image::mfp/MyFirstPolicy_P1_newEvent1.png[Right click to create a new event] + +Create a new event type called `SALE_INPUT`. Use the 'Generate UUID' button to create a new unique ID for the event type, and fill in a description for the event. Add a namespace, e.g. `com.hyperm`. We can add hard-coded strings for the `Source` and `Target`, e.g. `POS` and `APEX`. At this stage we will not add any parameter fields, we will leave this until later. Use the `Submit` button to create the event. + +.Populate the `SALE_INPUT` event +image::mfp/MyFirstPolicy_P1_newEvent2.png["Fill in the necessary information for the 'SALE_INPUT' event and click 'Submit'"] + +To add a new event parameter use the 'Add Event Parameter' button at the bottom of the screen. For the `SALE_INPUT` event add the following event parameters: .Event Parameter Fields for the `SALE_INPUT` Event [width="100%",options="header"] @@ -99,7 +99,12 @@ Parameter fields can be _optional_ in events. If a parameter is not marked as _o .Add typed parameter fields to an event image::mfp/MyFirstPolicy_P1_newEvent3.png["Add new event parameters to an event"] -Select the `SALE_AUTH` event and add the following event parameters: + +Repeat the same steps for a new event type called `SALE_AUTH`. +Just use `APEX` as source and `POS` as target, since this is the output event coming from APEX going to the sales point. + + +Add the following event parameters: .Event Parameter Fields for the `SALE_AUTH` Event [width="100%",options="header"] -- cgit 1.2.3-korg