From 4e032bb33b47fc2ce6ea1dc28abbd2c9639e684c Mon Sep 17 00:00:00 2001 From: Robin de Silva Jayasinghe Date: Mon, 3 Jun 2024 10:24:09 +0200 Subject: [PATCH 1/3] add final remarks to the readme.md --- readme.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 67b545e..5d8c3c9 100644 --- a/readme.md +++ b/readme.md @@ -135,6 +135,12 @@ annotate my.Urgency with { }; ``` +In order to have Criticality properly displayed in the Fiori Elements UI you also need to add the following CDS line to the `app/incidents/annotations.cds` below line 35: + +``` + Criticality : urgency.criticality, +``` + Add the dependency of the just created plugin to your `srv/pom.xml`: ```xml @@ -159,4 +165,6 @@ Get the Incidents entities with expanded `urgency` association. ```http GET http://localhost:8080/odata/v4/ProcessorService/Incidents?$expand=urgency Authorization: basic YWxpY2U6 -``` \ No newline at end of file +``` + +The results should now include an integer value for some Urgency elements (according to the annotations you made). You can also see the Incidents coloured and annotated with little symbols on the UI now: http://localhost:8080/incidents/webapp/index.html \ No newline at end of file From c6f291baf3f9e77a5aa966069dd4cc38ae0d8a1b Mon Sep 17 00:00:00 2001 From: Robin de Silva Jayasinghe Date: Mon, 3 Jun 2024 10:28:13 +0200 Subject: [PATCH 2/3] add criticality modeling and plugin --- .../app/incidents/annotations.cds | 3 ++- incidents-app-java/db/criticality.cds | 23 +++++++++++++++++++ incidents-app-java/srv/pom.xml | 6 +++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 incidents-app-java/db/criticality.cds diff --git a/incidents-app-java/app/incidents/annotations.cds b/incidents-app-java/app/incidents/annotations.cds index 84de5c9..3b1e57f 100644 --- a/incidents-app-java/app/incidents/annotations.cds +++ b/incidents-app-java/app/incidents/annotations.cds @@ -33,6 +33,7 @@ annotate service.Incidents with @( $Type : 'UI.DataField', Value : urgency.descr, Label : '{i18n>Urgency}', + Criticality : urgency.criticality, }, { $Type : 'UI.DataField', @@ -86,7 +87,7 @@ annotate service.Incidents with @( Label : 'Conversations', ID : 'Conversations', Target : 'conversation/@UI.LineItem#Conversations', - }, + } ] ); annotate service.Incidents with @( diff --git a/incidents-app-java/db/criticality.cds b/incidents-app-java/db/criticality.cds new file mode 100644 index 0000000..6c7862c --- /dev/null +++ b/incidents-app-java/db/criticality.cds @@ -0,0 +1,23 @@ +using {sap.capire.incidents as my} from './schema'; + +annotate my.Status with { + code @criticality { + new @criticality.Neutral; + assigned @criticality.Critical; + in_process @criticality.Critical; + on_hold @criticality.Negative; + resolved @criticality.Positive; + closed @criticality.Positive; + }; +}; + +extend my.Urgency { + criticality : Integer; +}; + +annotate my.Urgency with { + code @criticality { + high @criticality.Negative; + medium @criticality.Critical; + }; +}; \ No newline at end of file diff --git a/incidents-app-java/srv/pom.xml b/incidents-app-java/srv/pom.xml index 21f4ecc..526f526 100644 --- a/incidents-app-java/srv/pom.xml +++ b/incidents-app-java/srv/pom.xml @@ -35,6 +35,12 @@ runtime + + com.sap.capire + criticality + 1.0-SNAPSHOT + + org.springframework.boot spring-boot-devtools From 6c5923420a63e777d13e9ac98b6787d6e9c7d904 Mon Sep 17 00:00:00 2001 From: Robin de Silva Jayasinghe Date: Tue, 4 Jun 2024 09:21:47 +0200 Subject: [PATCH 3/3] source level config for BAS --- criticality-prebuilt/pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/criticality-prebuilt/pom.xml b/criticality-prebuilt/pom.xml index 04cb80a..9b1b4b7 100644 --- a/criticality-prebuilt/pom.xml +++ b/criticality-prebuilt/pom.xml @@ -10,6 +10,8 @@ 17 2.10.0 + 17 + 17