Default-data-handler

Overview

The Default Data Handler is an orchestration service designed to streamline tenant onboarding and data setup. It offers functionality to create and manage MDMS data (schemas and corresponding data), localization data, and workflow configurations set up for the new tenants.

Pre-requisites

Before you proceed with the documentation, make sure the following prerequisites are met -

  • Prior knowledge of Java/J2EE

  • Prior knowledge of Spring Boot

  • Prior knowledge of Kafka and related concepts like Producer, Consumer, Topic, etc

  • Prior knowledge of Elasticsearch

Key Functionalities

  • Loads all MDMS data (schemas and corresponding data) for schema codes listed in the resource/mdmsData folder.

  • Loads all localization data for locales and modules listed in the resource/localisation folder to the new tenant.

  • Loads the workflow configuration JSON from the application classpath, updates the tenantId with the new tenant ID, and invokes the workflow create API.

  • Creates users for the new tenant and sends an OTP for login.

Onboarding a New Module

  1. Add Module Data: Add the module's MDMS data (schemas and corresponding data) and localization data to the resource/mdmsData and resource/schema folder. reference: mdmsData, schema

  2. Add Workflow Configurations: Update the PgrWorkflowConfig.json file (located at src/main/resources) by including the module's workflow configurations in the "BusinessServices" array. Reference: PgrWorkflowConfig.json

  3. Add the module’s localization locales and modules under the resource/localisation folder. Reference: localisation

  4. Add Users with the necessary roles. Reference: User.json

  5. Add Employees with the necessary roles. Reference: HRMS.json

  6. All these files have tenantid as a placeholder, which will be replaced by the tenantid set in the env file.

  7. Deploy the Service: Build and deploy the default-data-handler service using the modified helm file

Service Dependencies

mdms-v2
boundary-service
localisation service
user service
employee service
workflow service

How it works

  1. Initialization

    • Start by setting up the necessary components.

    • Ensure all dependencies are installed.

  2. Process Execution

    • Waits 10 seconds after startup until dependent services are running:

      mdms-v2

      boundary-service

      localisation service

    • Initializes StartupSchemaAndMasterDataInitializer after the 10-second wait.

    • Runs StartupUserAndEmployeeInitializer 4 times at 4-minute intervals.

  3. Finalization

    • Within 20 minutes of service initialization, all master data, localization data, workflow data, users, and employees are created or updated.

Last updated

Was this helpful?