Skip to content

Latest commit

Β 

History

History
115 lines (93 loc) Β· 4.11 KB

File metadata and controls

115 lines (93 loc) Β· 4.11 KB

Dynamic Entity Diagnostics Flow

This document describes how the Dynamic Entity Diagnostics page processes data.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  DYNAMIC ENTITY DIAGNOSTICS FLOW                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

STEP 1: Fetch Entity Definitions
─────────────────────────────────
  API ENDPOINT:
  GET /obp/v5.1.0/management/system-dynamic-entities
  
  Response:
  {
    "dynamic_entities": [
      {
        "dynamicEntityId": "abc-123",
        "userId": "user-1",
        "OGCR2Parcel": {
          "description": "...",
          "type": "object",
          "properties": {...}
        }
      },
      { ... more entities ... }
    ]
  }
  
  Extract:
  β†’ Entity Name: "OGCR2Parcel"
  β†’ Entity ID: "abc-123"
  β†’ Schema: {...properties...}


STEP 2: For EACH Entity, Fetch Data Records
────────────────────────────────────────────
  API ENDPOINT:
  GET /obp/dynamic-entity/{entityName}
  
  Example:
  GET /obp/dynamic-entity/OGCR2Parcel
  
  Response (Raw):
  {
    "ogcr2_parcel_list": [
      { "ogcr2_parcel_id": "1", ... },
      { "ogcr2_parcel_id": "2", ... }
    ]
  }
  
  Process:
  1. Store rawResponse = { "ogcr2_parcel_list": [...] }
  2. Get responseKeys = ["ogcr2_parcel_list"]
  3. Find keys ending with "_list" β†’ ["ogcr2_parcel_list"]
  4. Check if it's an array β†’ YES
  5. Count records β†’ 2


STEP 3: Create Diagnostic Object
─────────────────────────────────
  (No API call - just processing)
  
  {
    "dynamicEntityId": "abc-123",
    "entityName": "OGCR2Parcel",
    "recordCount": 2,              ← Successfully counted!
    "error": undefined,            ← No error
    "schema": {...},
    "responseKeys": ["ogcr2_parcel_list"],
    "triedKeys": ["ogcr2_parcel_list"],
    "rawResponse": {...}           ← Full API response saved
  }


STEP 4: Display in UI
─────────────────────
  (No API call - just rendering)
  
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚ OGCR2Parcel              [Has Data]     β”‚
  β”‚ ID: abc-123                             β”‚
  β”‚                                         β”‚
  β”‚ Record Count: 2                         β”‚
  β”‚ Schema Properties: 4                    β”‚
  β”‚                                         β”‚
  β”‚ [View CRUD] [View Definition]           β”‚
  β”‚                                         β”‚
  β”‚ β–Ά Show Raw API Response                 β”‚
  β”‚   (Click to expand full JSON)           β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

SUMMARY OF API ENDPOINTS USED:
───────────────────────────────
1. GET /obp/v5.1.0/management/system-dynamic-entities
   β†’ Fetches list of all entity definitions (called ONCE)

2. GET /obp/dynamic-entity/{entityName}
   β†’ Fetches data records for specific entity (called ONCE per entity)
   β†’ Examples:
     - GET /obp/dynamic-entity/OGCR2Parcel
     - GET /obp/dynamic-entity/OGCR2Project
     - GET /obp/dynamic-entity/Person

Total API Calls

If you have 10 entities, the diagnostics page makes:

  • 1 API call to get all entity definitions
  • 10 API calls to get data for each entity
  • Total: 11 API calls