-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Background
When CAP applications consume external Data Products via cds import, the ORD plugin should be able to automatically generate integrationDependencies in the ORD document.
Implementation
- Detect external Data Products by checking
@cds.external,@data.product, and@cds.dp.ordIdannotations - Parse
@cds.dp.ordIdto extract namespace, resourceType, and version - Group resources by namespace to create one IntegrationDependency per external Data Product
Open Questions
- Event handling: Currently no DP example with events. Proposal: DP provider should annotate event services with
@cds.dp.ordId(e.g.,sap.sai:eventResource:SupplierEvents:v1), and we parse resourceType from ordId to place it in the correct aspect. - Customization: How to allow users to customize IntegrationDependency fields (e.g.,
mandatory)? Proposal: Create a new annotation key (e.g.,@ORD.IntegrationDependency) that users can apply to the external DP service. - localId: How to derive localId from namespace? Current approach:
sap.sai→sapsai - ordId format: Proposal: Use DP namespace as resourceName, e.g.,
<appNamespace>:integrationDependency:<dpNamespace>:v1→customer.sample:integrationDependency:sap.sai:v1 - Aspects handling: Per ORD spec, aspects support (1) alternative APIs, (2) event subscriptions, (3) callback APIs. Proposal:
- Simple case: Group by resourceType - APIs in one aspect, Events in another
- Complex case (callback/alternatives): Require manual configuration via annotations or custom.ord.json
- DP provider can prepare aspect metadata, consumer can override via annotations
Example
1. DP Provider (sap-sai-supplier-v1/services.cds):
@cds.dp.ordId : 'sap.sai:apiResource:Supplier:v1'
@cds.external : true
@data.product : true
service sap.sai.Supplier.v1 {
entity Supplier { key ID : String; name : String; }
}
@cds.dp.ordId : 'sap.sai:eventResource:SupplierEvents:v1'
@cds.external : true
@data.product : true
service sap.sai.SupplierEvents.v1 {
event SupplierChanged { ID : String; }
}2. Consumer (srv/services.cds):
using { sap.sai.Supplier.v1 as Supplier } from 'sap-sai-supplier-v1';
using { sap.sai.SupplierEvents.v1 as SupplierEvents } from 'sap-sai-supplier-v1';
service SupplierService {
entity Suppliers as projection on Supplier.Supplier;
}
// Callback API for sap.sai to push data back
service SupplierCallbackService {
action receiveSupplierUpdate(data: String);
}
annotate Supplier with @ORD.IntegrationDependency: {
mandatory: false,
aspects: [{
title: 'Supplier Callback',
apiResources: [{ ordId: 'customer.sample:apiResource:SupplierCallbackService:v1' }]
}]
};3. Generated ORD:
{
"integrationDependencies": [{
"ordId": "customer.sample:integrationDependency:sap.sai:v1",
"title": "Integration with sap.sai",
"mandatory": false,
"aspects": [
{
"title": "sap.sai APIs",
"apiResources": [{ "ordId": "sap.sai:apiResource:Supplier:v1", "minVersion": "1.0.0" }]
},
{
"title": "sap.sai Events",
"eventResources": [{ "ordId": "sap.sai:eventResource:SupplierEvents:v1", "minVersion": "1.0.0" }]
},
{
"title": "Supplier Callback",
"apiResources": [{ "ordId": "customer.sample:apiResource:SupplierCallbackService:v1" }]
}
]
}]
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels