Process API - Auto
Endpoint
Endpoint: /boundary-service/v1/_process
Method: POST
Request Structure
Query Parameters:
tenantId: Tenant identifier
referenceId: Reference identifier (optional)
Body Parameters:
RequestInfo: Object containing request information
ResourceDetails: Object containing the details of the boundary data to be processed
tenantId: Tenant identifier
hierarchyType: Type of hierarchy (e.g., ADMIN, MICROPLAN)
fileStoreId: File store ID of the uploaded Excel file
action: Action type (create)
referenceId: Reference identifier (optional)
Request Example
Response Structure
Success Response:
ResourceDetails: Object containing the details of the process request
id: Unique identifier for the process request (UUID)
tenantId: Tenant identifier
hierarchyType: Type of hierarchy
fileStoreId: Original uploaded file store ID
processedFileStoreId: Processed file store ID (populated when status is 'completed')
action: Action type (create)
status: Current status (accepted, started, completed, failed, invalid)
referenceId: Reference identifier
auditDetails: Audit information
createdBy: User UUID who created
createdTime: Creation timestamp
lastModifiedBy: User UUID who last modified
lastModifiedTime: Last modification timestamp
additionalDetails: Additional details including error information if failed
fileName: Original file name
error: Error details (present only if status is 'failed')
Response Example
Flow
Client Initiates Request: The client sends a process request to the Boundary Management service with Excel file already uploaded to FileStore.
Fetch Localization Maps: Service fetches localization maps for hierarchy-specific and boundary management modules.
Validation of Request: The service validates the request and performs pre-processing validations: - Validates tenantId - Validates hierarchyType - Validates fileStoreId - Validates action is "create"
Generate Unique ID: Generate a unique UUID for the process request.
Set Audit Details: Enrich ResourceDetails with audit details: - Set createdBy and lastModifiedBy from RequestInfo userInfo - Set createdTime and lastModifiedTime to current timestamp
Persist Initial Record: - Set status to 'accepted' - Persist the initial ResourceDetails record to database via Kafka (save topic)
Return Immediate Response: Return to client with status 'accepted' and HTTP 200.
Start Background Processing: - Download Excel file from FileStore - Get current flow from database (auto/manual) - Get hierarchy definition from Boundary Service - Validate Excel sheet headers and data - Segregate data (withBoundaryCode, withoutBoundaryCode, manualBoundaryCode) - Validate flow consistency
Auto-Generate Boundary Codes (Auto Flow): - Build code mappings from existing boundaries - Build child-parent relationships - Call IdGen service to generate boundary codes - Create boundaryMap
Create Boundary Entities: - Check existing entities in chunks of 20 - Create new entities in chunks of 200 - Wait 2 seconds for persistence
Create Boundary Relationships: - Build modified child-parent map using codes - Confirm parent exists (retry up to 6 times) - Create boundary relationships
Create Localization Messages: - Create French localization messages - Create Portuguese localization messages - Create default (English) localization messages
Generate Processed Excel File: - Add generated codes to data - Create Excel workbook with headers and data - Upload to FileStore
Update Status: - Success Case:
Set status to 'completed'
Set processedFileStoreId with uploaded file ID
Clear any error details from additionalDetails
Update lastModifiedTime and lastModifiedBy
Persist to database via Kafka (update topic) - Failure Case:
Set status to 'failed'
Set processedFileStoreId to null
Enrich additionalDetails with error information (errorCode, errorMessage)
Update lastModifiedTime and lastModifiedBy
Persist to database via Kafka (update topic)
Trigger Generate API: After 30 seconds, trigger
/v1/_generateAPI with determinedCurrentFlow for downloadable file creation.
Flow Diagram
Status States
The process goes through the following status states:
accepted: Initial state when the process request is received and validated. Processing is queued for background execution.
started: Processing has begun (used for non-create actions).
completed: Boundary data successfully processed. Entities created, relationships established, and processed file uploaded. The processedFileStoreId field contains the file identifier.
failed: The processing encountered an error. Error details are available in additionalDetails:
error: Stringified JSON containing status, code, description, and message
invalid: Data validation failed but processing continues with some errors.
Last updated
Was this helpful?