Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
{
  "BusinessServices": [
    {
      "tenantId": "pb",
      "businessService": "NewSW1",
      "business": "sw-services",
      "businessServiceSla": 259200000,
      "states": [
        {
          "sla": null,
          "state": null,
          "applicationStatus": null,
          "docUploadRequired": false,
          "isStartState": true,
          "isTerminateState": false,
          "isStateUpdatable": false,
          "actions": [
            {
              "action": "INITIATE",
              "nextState": "INITIATED",
              "roles": [
                "CITIZEN",
                "SW_CEMP"
              ]
            }
          ]
        },
        {
          "sla": null,
          "state": "INITIATED",
          "applicationStatus": "INITIATED",
          "docUploadRequired": false,
          "isStartState": false,
          "isTerminateState": false,
          "isStateUpdatable": true,
          "actions": [
            {
              "action": "SUBMIT_APPLICATION",
              "nextState": "PENDING_FOR_DOCUMENT_VERIFICATION",
              "roles": [
                "CITIZEN",
                "SW_CEMP"
              ]
            }
          ]
        },
        {
          "sla": null,
          "state": "PENDING_FOR_CITIZEN_ACTION",
          "applicationStatus": "PENDING_FOR_CITIZEN_ACTION",
          "docUploadRequired": false,
          "isStartState": false,
          "isTerminateState": false,
          "isStateUpdatable": true,
          "actions": [
            {
              "action": "RESUBMIT_APPLICATION",
              "nextState": "PENDING_FOR_DOCUMENT_VERIFICATION",
              "roles": [
                "CITIZEN",
                "SW_CEMP"
              ]
            }
          ]
        },
        {
          "sla": null,
          "state": "PENDING_FOR_DOCUMENT_VERIFICATION",
          "applicationStatus": "PENDING_FOR_DOCUMENT_VERIFICATION",
          "docUploadRequired": false,
          "isStartState": false,
          "isTerminateState": false,
          "isStateUpdatable": true,
          "actions": [
            {
              "action": "VERIFY_AND_FORWARD",
              "nextState": "PENDING_FOR_FIELD_INSPECTION",
              "roles": [
                "SW_DOC_VERIFIER"
              ]
            },
            {
              "action": "REJECT",
              "nextState": "REJECTED",
              "roles": [
                "SW_DOC_VERIFIER"
              ]
            },
            {
              "action": "SEND_BACK_TO_CITIZEN",
              "nextState": "PENDING_FOR_CITIZEN_ACTION",
              "roles": [
                "SW_DOC_VERIFIER"
              ]
            }
          ]
        },
        {
          "sla": null,
          "state": "REJECTED",
          "applicationStatus": "REJECTED",
          "isStateUpdatable": false,
          "docUploadRequired": false,
          "isStartState": false,
          "isTerminateState": true
        },
        {
          "sla": 86400000,
          "state": "PENDING_FOR_FIELD_INSPECTION",
          "applicationStatus": "PENDING_FOR_FIELD_INSPECTION",
          "docUploadRequired": false,
          "isStartState": false,
          "isStateUpdatable": true,
          "isTerminateState": false,
          "actions": [
            {
              "action": "VERIFY_AND_FORWARD",
              "nextState": "PENDING_APPROVAL_FOR_CONNECTION",
              "roles": [
                "SW_FIELD_INSPECTOR"
              ]
            },
            {
              "action": "REJECT",
              "nextState": "REJECTED",
              "roles": [
                "SW_FIELD_INSPECTOR"
              ]
            },
            {
              "action": "SEND_BACK_FOR_DOCUMENT_VERIFICATION",
              "nextState": "PENDING_FOR_DOCUMENT_VERIFICATION",
              "roles": [
                "SW_FIELD_INSPECTOR"
              ]
            }
          ]
        },
        {
          "sla": 43200000,
          "state": "PENDING_APPROVAL_FOR_CONNECTION",
          "applicationStatus": "PENDING_APPROVAL_FOR_CONNECTION",
          "docUploadRequired": false,
          "isStartState": false,
          "isStateUpdatable": true,
          "isTerminateState": false,
          "actions": [
            {
              "action": "APPROVE_FOR_CONNECTION",
              "nextState": "PENDING_FOR_PAYMENT",
              "roles": [
                "SW_APPROVER"
              ]
            },
            {
              "action": "REJECT",
              "nextState": "REJECTED",
              "roles": [
                "SW_APPROVER"
              ]
            },
            {
              "action": "SEND_BACK_FOR_FIELD_INSPECTION",
              "nextState": "PENDING_FOR_FIELD_INSPECTION",
              "roles": [
                "SW_APPROVER"
              ]
            }
          ]
        },
        {
          "sla": 43200000,
          "state": "PENDING_FOR_PAYMENT",
          "applicationStatus": "PENDING_FOR_PAYMENT",
          "docUploadRequired": false,
          "isStartState": false,
          "isTerminateState": false,
          "isStateUpdatable": false,
          "actions": [
            {
              "action": "PAY",
              "nextState": "PENDING_FOR_CONNECTION_ACTIVATION",
              "roles": [
                "CITIZEN",
                "SW_CEMP"
              ]
            }
          ]
        },
        {
          "sla": null,
          "state": "PENDING_FOR_CONNECTION_ACTIVATION",
          "applicationStatus": "PENDING_FOR_CONNECTION_ACTIVATION",
          "isStateUpdatable": true,
          "docUploadRequired": false,
          "isStartState": false,
          "isTerminateState": false,
          "actions": [
            {
              "action": "ACTIVATE_CONNECTION",
              "nextState": "CONNECTION_ACTIVATED",
              "roles": [
                "SW_CLERK"
              ]
            }
          ]
        },
        {
          "sla": null,
          "state": "CONNECTION_ACTIVATED",
          "applicationStatus": "CONNECTION_ACTIVATED",
          "isStateUpdatable": false,
          "docUploadRequired": false,
          "isStartState": false,
          "isTerminateState": true
        }
      ]
    }
  ]
}

Indexer config for sewerage-service:

  • The indexer provides the facility for indexing the data to elastic search.

Setup:

  1. Write the configuration for sewerage service. The structure of the config file is explained later in the same doc.

  2. Provide the absolute path of the checked-in file to DevOps, to add it to the file-read path of egov-indexer. The file will be added to the egov-indexer's environment manifest file for it to be read at the start-up of the application.

  3. Run the egov-indexer app, Since it is a consumer, it starts listening to the configured topics and indexes the data.

config Keys:

The indexer uses a config file per module to store all the configurations pertaining to that module. Indexer reads multiple such files at start-up to support indexing for all the configured modules. The water service file contains the following keys:

a. serviceName: Name of the module to which this configuration belongs.

b. summary: Summary of the module.

c. version: The version of the configuration.

d. mappings: List of definitions within the module. Every definition corresponds to one index requirement. Which means, every object received onto the Kafka queue can be used to create multiple indexes, each of these indexes will need configuration, all such configurations belonging to one topic forms one entry in the mappings list. The keys listed henceforth together form one definition and multiple such definitions are part of this mappings key.

i. topic: Topic on which the data is to be received to activate this particular configuration.

ii. configKey: Key to identify to what type of job is this config for. values: INDEX, REINDEX, LEGACYINDEX. INDEX: LiveIndex, REINDEX: Reindex, LEGACYINDEX: LegacyIndex.

iii. indexes: Key to configure multiple index configurations for the data received on the particular topic. Multiple indexes based on different requirement can be created using the same object. This list of such configurations is a part of this key. uses the following keys:

  1. name: Index name on the elasticsearch. (Index will be created if it doesn't exist with this name.)

  2. type: Document type within that index to which the index json has to go. (Elasticsearch uses the structure of index/type/docId to locate any file within index/type with id = docId)

  3. id: Takes comma separated JsonPaths. The JSONPath is applied on the record received on the queue, the values hence obtained are appended and used as id for the record.

  4. jsonPath: Key to be used in case of indexing a part of the input JSON and in case of indexing a custom json where the values for custom json are to be fetched from this part of the input.

  5. timeStampField: JSONPath of the field in the input which can be used to obtain the timestamp of the input.

  6. i) indexMapping: A skeleton/mapping of the JSON that is to be indexed. Note that, this JSON must always contain a key called "Data" at the top-level and the custom mapping begins within this key. This is only a convention to smoothen dashboarding on Kibana when data from multiple indexes have to be fetched for a single dashboard.

     ii) fieldMapping: Contains a list of configurations. Each configuration contains keys to identify the field of the input JSON that has to be mapped to the fields of the index json which is mentioned in the key 'indexMapping' in the config. Has the following keys:

    1. inJsonPath: JSONPath of the field from the input.

    2. outJsonPath: JSONPath of the field of the index json.

            iii) externalUriMapping: Contains a list of configurations. Each configuration contains keys to identify the field of the input JSON that are to be enriched using APIs from the external services. The confiugration for those APIs also is a part of this. Uses the following keys:

  1. path: URI of the API to be used. (it should be POST/_search API.)

  2. queryParam: Configruation of the query params to be used for the API call. It is a comma seperated key-value pair, where key is the parameter name as per the API contract and value is the JSONPath of the field to be equated against this paramter.

  3. apiRequest: Request Body of the API. (Since we only use _search APIs, it should be only RequestInfo.)

  4. uriResponseMapping: Contains a list of configuration. Each configuration contains two keys: One is a JSONPath to identify the field from response, Second is also a JSONPath to map the response field to a field of the index json mentioned in the key 'indexMapping'.

i) inJsonPath: JSONPath to identify the field from response

ii) outJsonPath: JSONPath to map the response field to a field of the index json

sewerage-service indexer config:

Code Block
breakoutModewide
ServiceMaps:
 serviceName: Sewerage Service - rainmaker
 version: 1.0.0
 mappings:
  - topic: save-sw-connection
    configKey: INDEX
    indexes:
      - name: sewerage-services
        type: general
        id: $.id,$.property.tenantId
        timeStampField: $.additionalDetails.appCreatedDate
        jsonPath: $.SewerageConnection
        customJsonMapping:
          indexMapping: {"Data":{"workflow": {"state": {}, "action": "", "assignes": []},"ownersmobileNos":[],"applicationNo":"","applicationStatus":"","status":"","connectionNo":"","oldConnectionNo":"","plumberInfo":[],"roadType":"","roadCuttingArea":"","connectionExecutionDate":"","connectionCategory":"","connectionType":"","additionalDetails":{},"id":"","propertyId":"","tenantId":"","proposedWaterClosets":"","proposedToilets":"","noOfWaterClosets":"","noOfToilets":"","history":{}}}
          fieldMapping:
          - inJsonPath: $.applicationStatus.state
            outJsonPath: $.Data.workflow.state
          - inJsonPath: $.processInstance.action
            outJsonPath: $.Data.workflow.action
          - inJsonPath: $.processInstance.assignes.*.uuid
            outJsonPath: $.Data.workflow.assignes
          - inJsonPath: $.property.owners.*.mobileNumber
            outJsonPath: $.Data.ownersmobileNos
          - inJsonPath: $.applicationNo
            outJsonPath: $.Data.applicationNo
          - inJsonPath: $.applicationStatus
            outJsonPath: $.Data.applicationStatus
          - inJsonPath: $.status
            outJsonPath: $.Data.status
          - inJsonPath: $.connectionNo
            outJsonPath: $.Data.connectionNo
          - inJsonPath: $.oldConnectionNo
            outJsonPath: $.Data.oldConnectionNo
          - inJsonPath: $.plumberInfo
            outJsonPath: $.Data.plumberInfo
          - inJsonPath: $.roadType
            outJsonPath: $.Data.roadType
          - inJsonPath: $.roadCuttingArea
            outJsonPath: $.Data.roadCuttingArea
          - inJsonPath: $.connectionExecutionDate
            outJsonPath: $.Data.connectionExecutionDate
          - inJsonPath: $.connectionCategory
            outJsonPath: $.Data.connectionCategory
          - inJsonPath: $.connectionType
            outJsonPath: $.Data.connectionType
          - inJsonPath: $.additionalDetails
            outJsonPath: $.Data.additionalDetails
          - inJsonPath: $.id
            outJsonPath: $.Data.id
          - inJsonPath: $.property.propertyId
            outJsonPath: $.Data.propertyId
          - inJsonPath: $.property.tenantId
            outJsonPath: $.Data.tenantId
          - inJsonPath: $.proposedWaterClosets
            outJsonPath: $.Data.proposedWaterClosets
          - inJsonPath: $.proposedToilets
            outJsonPath: $.Data.proposedToilets
          - inJsonPath: $.noOfWaterClosets
            outJsonPath: $.Data.noOfWaterClosets
          - inJsonPath: $.noOfToilets
            outJsonPath: $.Data.noOfToilets
          externalUriMapping:
          - path: http://egov-workflow-v2.egov:8080/egov-workflow-v2/egov-wf/process/_search
            queryParam: businessIds=$.applicationNo,history=true,tenantId=$.property.tenantId
            apiRequest: {"RequestInfo":{"apiId":"org.egov.pt","ver":"1.0","ts":1502890899493,"action":"asd","did":"4354648646","key":"xyz","msgId":"654654","requesterId":"61","authToken":"d9994555-7656-4a67-ab3a-a952a0d4dfc8","userInfo":{"id":1,"uuid":"1fec8102-0e02-4d0a-b283-cd80d5dab067","type":"EMPLOYEE","tenantId":"pb.amritsar","roles":[{"name":"Employee","code":"EMPLOYEE","tenantId":"pb.amritsar"}]}}}
            uriResponseMapping:
            - inJsonPath: $.ProcessInstances
              outJsonPath: $.Data.history

  - topic: update-sw-connection
    configKey: INDEX
    indexes:
      - name: sewerage-services
        type: general
        id: $.id,$.property.tenantId
        timeStampField: $.additionalDetails.appCreatedDate
        jsonPath: $.SewerageConnection
        customJsonMapping:
          indexMapping: {"Data":{"workflow": {"state": {}, "action": "", "assignes": []},"ownersmobileNos":[],"applicationNo":"","applicationStatus":"","status":"","connectionNo":"","oldConnectionNo":"","plumberInfo":[],"roadType":"","roadCuttingArea":"","connectionExecutionDate":"","connectionCategory":"","connectionType":"","additionalDetails":{},"id":"","propertyId":"","tenantId":"","proposedWaterClosets":"","proposedToilets":"","noOfWaterClosets":"","noOfToilets":"","history":{}}}
          fieldMapping:
          - inJsonPath: $.applicationStatus.state
            outJsonPath: $.Data.workflow.state
          - inJsonPath: $.processInstance.action
            outJsonPath: $.Data.workflow.action
          - inJsonPath: $.processInstance.assignes.*.uuid
            outJsonPath: $.Data.workflow.assignes
          - inJsonPath: $.property.owners.*.mobileNumber
            outJsonPath: $.Data.ownersmobileNos
          - inJsonPath: $.applicationNo
            outJsonPath: $.Data.applicationNo
          - inJsonPath: $.applicationStatus
            outJsonPath: $.Data.applicationStatus
          - inJsonPath: $.status
            outJsonPath: $.Data.status
          - inJsonPath: $.connectionNo
            outJsonPath: $.Data.connectionNo
          - inJsonPath: $.oldConnectionNo
            outJsonPath: $.Data.oldConnectionNo
          - inJsonPath: $.plumberInfo
            outJsonPath: $.Data.plumberInfo
          - inJsonPath: $.roadType
            outJsonPath: $.Data.roadType
          - inJsonPath: $.roadCuttingArea
            outJsonPath: $.Data.roadCuttingArea
          - inJsonPath: $.connectionExecutionDate
            outJsonPath: $.Data.connectionExecutionDate
          - inJsonPath: $.connectionCategory
            outJsonPath: $.Data.connectionCategory
          - inJsonPath: $.connectionType
            outJsonPath: $.Data.connectionType
          - inJsonPath: $.additionalDetails
            outJsonPath: $.Data.additionalDetails
          - inJsonPath: $.id
            outJsonPath: $.Data.id
          - inJsonPath: $.property.propertyId
            outJsonPath: $.Data.propertyId
          - inJsonPath: $.property.tenantId
            outJsonPath: $.Data.tenantId
          - inJsonPath: $.proposedWaterClosets
            outJsonPath: $.Data.proposedWaterClosets
          - inJsonPath: $.proposedToilets
            outJsonPath: $.Data.proposedToilets
          - inJsonPath: $.noOfWaterClosets
            outJsonPath: $.Data.noOfWaterClosets
          - inJsonPath: $.noOfToilets
            outJsonPath: $.Data.noOfToilets
          externalUriMapping:
          - path: http://egov-workflow-v2.egov:8080/egov-workflow-v2/egov-wf/process/_search
            queryParam: businessIds=$.applicationNo,history=true,tenantId=$.property.tenantId
            apiRequest: {"RequestInfo":{"apiId":"org.egov.pt","ver":"1.0","ts":1502890899493,"action":"asd","did":"4354648646","key":"xyz","msgId":"654654","requesterId":"61","authToken":"d9994555-7656-4a67-ab3a-a952a0d4dfc8","userInfo":{"id":1,"uuid":"1fec8102-0e02-4d0a-b283-cd80d5dab067","type":"EMPLOYEE","tenantId":"pb.amritsar","roles":[{"name":"Employee","code":"EMPLOYEE","tenantId":"pb.amritsar"}]}}}
            uriResponseMapping:
            - inJsonPath: $.ProcessInstances
              outJsonPath: $.Data.history


  - topic: update-sw-workflow
    configKey: INDEX
    indexes:
      - name: sewerage-services
        type: general
        id: $.id,$.property.tenantId
        timeStampField: $.additionalDetails.appCreatedDate
        jsonPath: $.SewerageConnection
        customJsonMapping:
          indexMapping: {"Data":{"workflow": {"state": {}, "action": "", "assignes": []},"ownersmobileNos":[],"applicationNo":"","applicationStatus":"","status":"","connectionNo":"","oldConnectionNo":"","plumberInfo":[],"roadType":"","roadCuttingArea":"","connectionExecutionDate":"","connectionCategory":"","connectionType":"","additionalDetails":{},"id":"","propertyId":"","tenantId":"","proposedWaterClosets":"","proposedToilets":"","noOfWaterClosets":"","noOfToilets":"","history":{}}}
          fieldMapping:
          - inJsonPath: $.applicationStatus.state
            outJsonPath: $.Data.workflow.state
          - inJsonPath: $.processInstance.action
            outJsonPath: $.Data.workflow.action
          - inJsonPath: $.processInstance.assignes.*.uuid
            outJsonPath: $.Data.workflow.assignes
          - inJsonPath: $.property.owners.*.mobileNumber
            outJsonPath: $.Data.ownersmobileNos
          - inJsonPath: $.applicationNo
            outJsonPath: $.Data.applicationNo
          - inJsonPath: $.applicationStatus
            outJsonPath: $.Data.applicationStatus
          - inJsonPath: $.status
            outJsonPath: $.Data.status
          - inJsonPath: $.connectionNo
            outJsonPath: $.Data.connectionNo
          - inJsonPath: $.oldConnectionNo
            outJsonPath: $.Data.oldConnectionNo
          - inJsonPath: $.plumberInfo
            outJsonPath: $.Data.plumberInfo
          - inJsonPath: $.roadType
            outJsonPath: $.Data.roadType
          - inJsonPath: $.roadCuttingArea
            outJsonPath: $.Data.roadCuttingArea
          - inJsonPath: $.connectionExecutionDate
            outJsonPath: $.Data.connectionExecutionDate
          - inJsonPath: $.connectionCategory
            outJsonPath: $.Data.connectionCategory
          - inJsonPath: $.connectionType
            outJsonPath: $.Data.connectionType
          - inJsonPath: $.additionalDetails
            outJsonPath: $.Data.additionalDetails
          - inJsonPath: $.id
            outJsonPath: $.Data.id
          - inJsonPath: $.property.propertyId
            outJsonPath: $.Data.propertyId
          - inJsonPath: $.property.tenantId
            outJsonPath: $.Data.tenantId
          - inJsonPath: $.proposedWaterClosets
            outJsonPath: $.Data.proposedWaterClosets
          - inJsonPath: $.proposedToilets
            outJsonPath: $.Data.proposedToilets
          - inJsonPath: $.noOfWaterClosets
            outJsonPath: $.Data.noOfWaterClosets
          - inJsonPath: $.noOfToilets
            outJsonPath: $.Data.noOfToilets
          externalUriMapping:
          - path: http://egov-workflow-v2.egov:8080/egov-workflow-v2/egov-wf/process/_search
            queryParam: businessIds=$.applicationNo,history=true,tenantId=$.property.tenantId
            apiRequest: {"RequestInfo":{"apiId":"org.egov.pt","ver":"1.0","ts":1502890899493,"action":"asd","did":"4354648646","key":"xyz","msgId":"654654","requesterId":"61","authToken":"d9994555-7656-4a67-ab3a-a952a0d4dfc8","userInfo":{"id":1,"uuid":"1fec8102-0e02-4d0a-b283-cd80d5dab067","type":"EMPLOYEE","tenantId":"pb.amritsar","roles":[{"name":"Employee","code":"EMPLOYEE","tenantId":"pb.amritsar"}]}}}
            uriResponseMapping:
            - inJsonPath: $.ProcessInstances
              outJsonPath: $.Data.history         

Notifications :

To enable or disable notifcation
notification.sms.enabled=true
egov.user.event.notification.enabled=true

...