Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions criticality-prebuilt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<properties>
<maven.compiler.release>17</maven.compiler.release>
<cds.services.version>2.10.0</cds.services.version>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
</properties>
<dependencyManagement>
<dependencies>
Expand Down
3 changes: 2 additions & 1 deletion incidents-app-java/app/incidents/annotations.cds
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ annotate service.Incidents with @(
$Type : 'UI.DataField',
Value : urgency.descr,
Label : '{i18n>Urgency}',
Criticality : urgency.criticality,
},
{
$Type : 'UI.DataField',
Expand Down Expand Up @@ -86,7 +87,7 @@ annotate service.Incidents with @(
Label : 'Conversations',
ID : 'Conversations',
Target : 'conversation/@UI.LineItem#Conversations',
},
}
]
);
annotate service.Incidents with @(
Expand Down
23 changes: 23 additions & 0 deletions incidents-app-java/db/criticality.cds
Original file line number Diff line number Diff line change
@@ -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;
};
};
6 changes: 6 additions & 0 deletions incidents-app-java/srv/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>com.sap.capire</groupId>
<artifactId>criticality</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
Expand Down
10 changes: 9 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
```
```

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