Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ORD and integration dependencies (consumed events) #81

Open
RamIndia opened this issue Oct 24, 2024 · 0 comments · May be fixed by #94
Open

ORD and integration dependencies (consumed events) #81

RamIndia opened this issue Oct 24, 2024 · 0 comments · May be fixed by #94
Assignees
Labels
enhancement New feature or request

Comments

@RamIndia
Copy link
Contributor

cds import

  • Typically, one imports events using cds import <asyncAPI-file> [--as cds].
  • This creates a model in srv/external/<someModel>.cds, which contains all the Events, not just those of interest.
  • Additionally, an entry is created in cds.requires.<externalSrv> that references this model.

Example:
Business Partner Events from S/4HANA: https://api.sap.com/event/CE_BUSINESSPARTNEREVENTS/overview

cds import ~/Downloads/CE_BUSINESSPARTNEREVENTS.json --as cds

Will create

├── srv
│   ├── external
│   │   ├── CE_BUSINESSPARTNEREVENTS.cds
│   │   └── CE_BUSINESSPARTNEREVENTS.json

and

  "cds": {
    "requires": {
      "sap.s4.beh.businesspartner.v1.BusinessPartner": {
        "kind": "odata",
        "model": "srv/external/CE_BUSINESSPARTNEREVENTS"
      }
    }
  }

Problem: All events are imported, not just the ones you're interested in.

Solution

Create an own external service where you only include the events you're interested in.
Reference this model in your external service. For the example above:

using { sap.s4.beh.businesspartner.v1.BusinessPartner.Created.v1 as Created } from './CE_BUSINESSPARTNEREVENTS';
service OwnExtSrv {
  event BPCreated : projection on Created;
}
  "cds": {
    "requires": {
      "sap.s4.beh.businesspartner.v1.BusinessPartner": {
        "kind": "odata",
        "model": "srv/external/OwnExtSrv"
      }
    }
  }

By checking the service definition of all external services (i.e. remote services in cds.requires), ORD can statically scan for all consumed events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants