|
| 1 | +# Browse Integration Services and Contracts |
| 2 | + |
| 3 | +This skill covers discovering external services, browsing cached contracts, and querying integration assets via the catalog. |
| 4 | + |
| 5 | +## When to Use This Skill |
| 6 | + |
| 7 | +- User asks what external services are configured in the project |
| 8 | +- User wants to see available entities or actions from an OData service |
| 9 | +- User wants to browse a business event contract (AsyncAPI) |
| 10 | +- User asks about integration catalog tables |
| 11 | +- User wants to find entities available in a contract but not yet imported |
| 12 | + |
| 13 | +## Discovery: List All Services |
| 14 | + |
| 15 | +```sql |
| 16 | +-- All OData clients (consumed services) |
| 17 | +SHOW ODATA CLIENTS; |
| 18 | + |
| 19 | +-- All published OData services |
| 20 | +SHOW ODATA SERVICES; |
| 21 | + |
| 22 | +-- All consumed REST services |
| 23 | +SHOW REST CLIENTS; |
| 24 | + |
| 25 | +-- All published REST services |
| 26 | +SHOW PUBLISHED REST SERVICES; |
| 27 | + |
| 28 | +-- All business event services |
| 29 | +SHOW BUSINESS EVENT SERVICES; |
| 30 | + |
| 31 | +-- All database connections |
| 32 | +SHOW DATABASE CONNECTIONS; |
| 33 | + |
| 34 | +-- All external entities (imported from OData) |
| 35 | +SHOW EXTERNAL ENTITIES; |
| 36 | + |
| 37 | +-- All external actions used in microflows |
| 38 | +SHOW EXTERNAL ACTIONS; |
| 39 | +``` |
| 40 | + |
| 41 | +## Contract Browsing: OData $metadata |
| 42 | + |
| 43 | +`CREATE ODATA CLIENT` auto-fetches and caches the `$metadata` XML. Browse it without network access: |
| 44 | + |
| 45 | +```sql |
| 46 | +-- List all entity types from the contract |
| 47 | +SHOW CONTRACT ENTITIES FROM MyModule.SalesforceAPI; |
| 48 | + |
| 49 | +-- List actions/functions |
| 50 | +SHOW CONTRACT ACTIONS FROM MyModule.SalesforceAPI; |
| 51 | + |
| 52 | +-- Inspect a specific entity (properties, keys, navigation) |
| 53 | +DESCRIBE CONTRACT ENTITY MyModule.SalesforceAPI.PurchaseOrder; |
| 54 | + |
| 55 | +-- Generate a CREATE EXTERNAL ENTITY statement from the contract |
| 56 | +DESCRIBE CONTRACT ENTITY MyModule.SalesforceAPI.PurchaseOrder FORMAT mdl; |
| 57 | + |
| 58 | +-- Inspect an action's signature |
| 59 | +DESCRIBE CONTRACT ACTION MyModule.SalesforceAPI.CreateOrder; |
| 60 | +``` |
| 61 | + |
| 62 | +## Contract Browsing: AsyncAPI (Business Events) |
| 63 | + |
| 64 | +Business event client services cache the AsyncAPI YAML: |
| 65 | + |
| 66 | +```sql |
| 67 | +-- List channels |
| 68 | +SHOW CONTRACT CHANNELS FROM MyModule.ShopEventsClient; |
| 69 | + |
| 70 | +-- List messages with payload info |
| 71 | +SHOW CONTRACT MESSAGES FROM MyModule.ShopEventsClient; |
| 72 | + |
| 73 | +-- Inspect a message's payload properties |
| 74 | +DESCRIBE CONTRACT MESSAGE MyModule.ShopEventsClient.OrderChangedEvent; |
| 75 | +``` |
| 76 | + |
| 77 | +## Catalog Queries (requires REFRESH CATALOG) |
| 78 | + |
| 79 | +```sql |
| 80 | +REFRESH CATALOG; |
| 81 | + |
| 82 | +-- All contract entities across all OData clients |
| 83 | +SELECT ServiceQualifiedName, EntityName, EntitySetName, PropertyCount, Summary |
| 84 | +FROM CATALOG.CONTRACT_ENTITIES; |
| 85 | + |
| 86 | +-- All contract actions |
| 87 | +SELECT ServiceQualifiedName, ActionName, ParameterCount, ReturnType |
| 88 | +FROM CATALOG.CONTRACT_ACTIONS; |
| 89 | + |
| 90 | +-- All contract messages |
| 91 | +SELECT ServiceQualifiedName, MessageName, ChannelName, OperationType, PropertyCount |
| 92 | +FROM CATALOG.CONTRACT_MESSAGES; |
| 93 | + |
| 94 | +-- Find available entities NOT YET imported |
| 95 | +SELECT ce.EntityName, ce.ServiceQualifiedName, ce.PropertyCount |
| 96 | +FROM CATALOG.CONTRACT_ENTITIES ce |
| 97 | +LEFT JOIN CATALOG.EXTERNAL_ENTITIES ee |
| 98 | + ON ce.ServiceQualifiedName = ee.ServiceName AND ce.EntityName = ee.RemoteName |
| 99 | +WHERE ee.Id IS NULL; |
| 100 | + |
| 101 | +-- All REST operations across all consumed services |
| 102 | +SELECT ServiceQualifiedName, HttpMethod, Path, Name |
| 103 | +FROM CATALOG.REST_OPERATIONS |
| 104 | +ORDER BY ServiceQualifiedName, Path; |
| 105 | + |
| 106 | +-- Cross-cutting: all integration services in a module |
| 107 | +SELECT ObjectType, QualifiedName |
| 108 | +FROM CATALOG.OBJECTS |
| 109 | +WHERE ObjectType IN ('ODATA_CLIENT', 'REST_CLIENT', 'ODATA_SERVICE', |
| 110 | + 'PUBLISHED_REST_SERVICE', 'BUSINESS_EVENT_SERVICE', 'DATABASE_CONNECTION') |
| 111 | +AND ModuleName = 'Integration'; |
| 112 | +``` |
| 113 | + |
| 114 | +## Workflow: Import an Entity from a Contract |
| 115 | + |
| 116 | +1. Browse available entities: |
| 117 | + ```sql |
| 118 | + SHOW CONTRACT ENTITIES FROM MyModule.SalesforceAPI; |
| 119 | + ``` |
| 120 | + |
| 121 | +2. Inspect the entity you want: |
| 122 | + ```sql |
| 123 | + DESCRIBE CONTRACT ENTITY MyModule.SalesforceAPI.PurchaseOrder; |
| 124 | + ``` |
| 125 | + |
| 126 | +3. Generate the CREATE statement: |
| 127 | + ```sql |
| 128 | + DESCRIBE CONTRACT ENTITY MyModule.SalesforceAPI.PurchaseOrder FORMAT mdl; |
| 129 | + ``` |
| 130 | + |
| 131 | +4. Copy, customize (remove unwanted attributes), and execute: |
| 132 | + ```sql |
| 133 | + CREATE EXTERNAL ENTITY MyModule.PurchaseOrder |
| 134 | + FROM ODATA CLIENT MyModule.SalesforceAPI ( |
| 135 | + EntitySet: 'PurchaseOrders', |
| 136 | + RemoteName: 'PurchaseOrder', |
| 137 | + Countable: Yes |
| 138 | + ) |
| 139 | + ( |
| 140 | + Number: Long, |
| 141 | + Status: String(200), |
| 142 | + SupplierName: String(200), |
| 143 | + GrossAmount: Decimal |
| 144 | + ); |
| 145 | + ``` |
0 commit comments