Skip to content

Commit a0f9ecb

Browse files
akoclaude
andcommitted
docs(proposal): replace IMPORT with contract browsing + MDL generation workflow
- Remove IMPORT EXTERNAL ENTITY (redundant with CREATE EXTERNAL ENTITY) - Add DESCRIBE CONTRACT ENTITY/ACTION with FORMAT mdl to generate ready-to-use CREATE statements from the cached $metadata - Show full workflow: browse → inspect → generate → customize - Actions still need NPE generation for complex type parameters/return values - Addresses #44 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b57d43d commit a0f9ecb

File tree

1 file changed

+60
-12
lines changed

1 file changed

+60
-12
lines changed

docs/11-proposals/integration-pane-proposal.md

Lines changed: 60 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -362,25 +362,73 @@ Catalog tables:
362362
- `contract_entities` — entity types from cached `$metadata` (name, properties, key, service ref)
363363
- `contract_actions` — function imports / actions from cached `$metadata` (name, parameters, return type)
364364

365-
### Auto-Import from Contract ([mendixlabs/mxcli#44](https://github.com/mendixlabs/mxcli/issues/44))
365+
### Generating CREATE EXTERNAL ENTITY from Contracts ([mendixlabs/mxcli#44](https://github.com/mendixlabs/mxcli/issues/44))
366366

367-
Once contracts are parsed, support importing assets into the project:
367+
For **entities**, there's no new command needed — `CREATE EXTERNAL ENTITY` already exists. The contract parsing enables a workflow where the user browses available entities and the tool generates the correct `CREATE EXTERNAL ENTITY` with attributes mapped from Edm types:
368368

369369
```sql
370-
-- Import a specific entity from the OData contract as an external entity
371-
IMPORT EXTERNAL ENTITY MyModule.SalesforceAPI.PurchaseOrder;
370+
-- 1. Browse what's available in the contract
371+
SHOW CONTRACT ENTITIES FROM MyModule.SalesforceAPI;
372+
373+
-- 2. Inspect a specific entity's properties
374+
DESCRIBE CONTRACT ENTITY MyModule.SalesforceAPI.PurchaseOrder;
375+
-- Output:
376+
-- PurchaseOrder (Key: ID)
377+
-- ID Edm.Int64 NOT NULL
378+
-- Number Edm.Int64
379+
-- Status Edm.String
380+
-- SupplierName Edm.String(200)
381+
-- GrossAmount Edm.Decimal
382+
-- DeliveryDate Edm.DateTimeOffset
383+
-- → PurchaseOrderItems (Navigation: PurchaseOrderItem *)
384+
-- → Customer (Navigation: Customer 0..1)
385+
386+
-- 3. Generate a CREATE EXTERNAL ENTITY from the contract (all attributes)
387+
DESCRIBE CONTRACT ENTITY MyModule.SalesforceAPI.PurchaseOrder FORMAT mdl;
388+
-- Output: ready-to-execute CREATE EXTERNAL ENTITY statement
389+
390+
-- 4. Or create with a subset of attributes
391+
CREATE EXTERNAL ENTITY MyModule.PurchaseOrder
392+
FROM ODATA CLIENT MyModule.SalesforceAPI (
393+
EntitySet: 'PurchaseOrders',
394+
RemoteName: 'PurchaseOrder',
395+
Countable: Yes
396+
)
397+
(
398+
Number: Long,
399+
Status: String(200),
400+
SupplierName: String(200),
401+
GrossAmount: Decimal
402+
);
403+
```
404+
405+
For **actions**, there IS new functionality needed — action definitions and their request/response NPEs (non-persistent entities) don't have a `CREATE` equivalent today:
406+
407+
```sql
408+
-- Browse available actions
409+
SHOW CONTRACT ACTIONS FROM MyModule.SalesforceAPI;
372410

373-
-- Import an action and its request/response NPEs (non-persistent entities)
374-
IMPORT EXTERNAL ACTION MyModule.SalesforceAPI.CreateOrder;
411+
-- Inspect an action's signature (parameters, return type)
412+
DESCRIBE CONTRACT ACTION MyModule.SalesforceAPI.CreateOrder;
413+
-- Output:
414+
-- CreateOrder
415+
-- Parameters:
416+
-- OrderData ComplexType:OrderInput (OrderId: Edm.Int64, Items: Collection(OrderItem))
417+
-- Returns:
418+
-- OrderResult ComplexType:OrderConfirmation (ConfirmationId: Edm.String, Status: Edm.String)
419+
420+
-- Generate MDL to create the NPEs and wire the action
421+
DESCRIBE CONTRACT ACTION MyModule.SalesforceAPI.CreateOrder FORMAT mdl;
422+
-- Output: CREATE ENTITY statements for NPEs + documentation for CALL EXTERNAL ACTION usage
375423
```
376424

377-
`IMPORT EXTERNAL ACTION` should:
378-
1. Parse the action's parameter and return types from the `$metadata`
379-
2. Create NPEs (non-persistent entities) for complex type parameters and return types
380-
3. Create the external action reference so `CALL EXTERNAL ACTION` can use it
381-
4. Map Edm types to Mendix attribute types (Edm.String → String, Edm.Int64 → Long, etc.)
425+
`DESCRIBE CONTRACT ACTION ... FORMAT mdl` should generate:
426+
1. `CREATE ENTITY` (non-persistent) for complex type parameters
427+
2. `CREATE ENTITY` (non-persistent) for complex type return values
428+
3. Edm → Mendix type mapping (Edm.String → String, Edm.Int64 → Long, Edm.Decimal → Decimal, etc.)
429+
4. A comment showing the `CALL EXTERNAL ACTION` syntax with the correct parameter names
382430

383-
This addresses the core request in issue #44: users want to browse available actions and auto-import them with their payload entities, rather than manually creating the domain model.
431+
This addresses the core request in issue #44: users want to browse available actions and generate the domain model entities needed to call them.
384432

385433
### AsyncAPI Document Parsing
386434

0 commit comments

Comments
 (0)