FSM Vehicle Registry v1.0
Configuration and setup details on registering vehicles in FSM module

Overview

Vehicle Registry is a system that enables ULB Employees to create and search Vehicle Entities and schedule Vehicle Trip for FSM Application and track the VehicleTrip. This document contains the details about how to set up the Vehicle and describe the functionalities provided.

Pre-requisites

Before you proceed with the configuration, make sure the following pre-requisites are met -
    Java 8
    Kafka server is up and running
    egov-persister service is running and has fsm-calculator-persister config path added in it
    PSQL server is running and a database is created to store FSM Application data
    Following services should be up and running:
      egov-perister
      egov-mdms
      egov-workflow-v2
      egov-idgen

Key Functionalities

Deployment Details

    1.
    Deploy the latest version of the vehicle
    2.
    Add vehicle-persister.yml file in config folder in git and add that path in persister. (The file path is to be added in environment yaml file in param called persist-yml-path )

Configuration Details

MDMS Configuration

Add master data in MDMS service with the module name as Vehicle.
Following is some sample master data for
SuctionType
1
{
2
"tenantId": "pb",
3
"moduleName": "Vehicle",
4
"SuctionType": [
5
{
6
"code": "SEWER_SUCTION_MACHINE",
7
"name": "Sewer suction machine",
8
"active": true
9
},
10
{
11
"code": "SEWER_SUCTION_CUM_JETTING_MACHINE",
12
"name": "Sewer suction cum jetting machine",
13
"active": true
14
}
15
]
16
}
Copied!
VehicleMakeModel
1
{
2
"tenantId": "pb",
3
"moduleName": "Vehicle",
4
"VehicleMakeModel": [
5
{
6
"code": "MAHINDRA",
7
"name": "Mahindra",
8
"active": true
9
},
10
{
11
"code": "MAHINDRA.BOLERO_PICKUP",
12
"name": "Bolero Pickup",
13
"active": true,
14
"make": "MAHINDRA",
15
"capacity": "5000",
16
"amount": "500"
17
},
18
{
19
"code": "TATA",
20
"name": "TATA",
21
"active": true
22
},
23
{
24
"code": "TATA.LPT709/34",
25
"name": "TATA LPT709/34",
26
"active": true,
27
"make": "TATA",
28
"capacity": "2000",
29
"amount": "200"
30
},
31
{
32
"code": "TATA.407",
33
"name": "TATA 407",
34
"active": true,
35
"make": "TATA",
36
"capacity": "1000",
37
"amount": "100"
38
},
39
{
40
"code": "TAFE",
41
"name": "TAFE",
42
"active": true
43
},
44
{
45
"code": "TAFE.TRACTOR_45DI",
46
"name": "TAFE Tractor 45DI",
47
"active": true,
48
"make": "TAFE",
49
"capacity": "10000",
50
"amount": "1000"
51
},
52
{
53
"code": "SONALIKA",
54
"name": "Sonalika",
55
"active": true
56
},
57
{
58
"code": "SONALIKA.TRACTOR_35DI",
59
"name": "Sonalika Tractor 35DI",
60
"active": true,
61
"make": "SONALIKA",
62
"capacity": "8000",
63
"amount": "1000"
64
}
65
]
66
}
Copied!

Business Service / Workflow Configuration

Workflow configuration for VehicleTrip of FSM
1
{
2
"tenantId": "pb",
3
"businessService": "FSM_VEHICLE_TRIP",
4
"business": "vehicle",
5
"businessServiceSla": 172800000,
6
"states": [
7
{
8
"sla": null,
9
"state": null,
10
"applicationStatus": null,
11
"docUploadRequired": false,
12
"isStartState": true,
13
"isTerminateState": false,
14
"isStateUpdatable": true,
15
"actions": [
16
{
17
"action": "SCHEDULE",
18
"nextState": "SCHEDULED",
19
"roles": [
20
"FSM_DSO"
21
]
22
}
23
]
24
},
25
{
26
"sla": null,
27
"state": "SCHEDULED",
28
"applicationStatus": "SCHEDULED",
29
"docUploadRequired": false,
30
"isStartState": true,
31
"isTerminateState": false,
32
"actions": [
33
{
34
"action": "READY_FOR_DISPOSAL",
35
"nextState": "WAITING_FOR_DISPOSAL",
36
"roles": [
37
"FSM_DSO",
38
"FSM_EDITOR_EMP"
39
]
40
}
41
]
42
},
43
{
44
"sla": null,
45
"state": "WAITING_FOR_DISPOSAL",
46
"applicationStatus": "WAITING_FOR_DISPOSAL",
47
"docUploadRequired": false,
48
"isStartState": true,
49
"isTerminateState": false,
50
"actions": [
51
{
52
"action": "DISPOSE",
53
"nextState": "DISPOSED",
54
"roles": [
55
"FSM_EMP_FSTPO"
56
]
57
}
58
]
59
},
60
{
61
"sla": null,
62
"state": "DISPOSED",
63
"applicationStatus": "DISPOSED",
64
"docUploadRequired": false,
65
"isStartState": false,
66
"isTerminateState": true,
67
"isStateUpdatable": true
68
}
69
]
70
}
Copied!

Actions & Role Action Mapping

Actions
1
{
2
"id": {{PLACEHOLDER1}},
3
"name": "Create Vehicle Application",
4
"url": "/vehicle/v1/_create",
5
"displayName": "Create Vehicle",
6
"orderNumber": 0,
7
"enabled": false,
8
"serviceCode": "vehicle",
9
"code": "null",
10
"path": ""
11
},
12
{
13
"id": {{PLACEHOLDER2}},
14
"name": "Search Vehicle Application",
15
"url": "/vehicle/v1/_search",
16
"displayName": "Search Vehicle",
17
"orderNumber": 1,
18
"enabled": false,
19
"serviceCode": "vehicle",
20
"code": "null",
21
"path": ""
22
},
23
{
24
"id": {{PLACEHOLDER3}},
25
"name": "Vehicle Trip Search",
26
"url": "/vehicle/trip/v1/_search",
27
"displayName": "Vehicle Trip Search",
28
"orderNumber": 1,
29
"parentModule": "",
30
"enabled": false,
31
"serviceCode": "",
32
"code": "null",
33
"path": ""
34
},
35
{
36
"id": {{PLACEHOLDER4}},
37
"name": "Vehicle Trip Update",
38
"url": "/vehicle/trip/v1/_update",
39
"displayName": "Vehicle Trip Update",
40
"orderNumber": 1,
41
"parentModule": "",
42
"enabled": false,
43
"serviceCode": "",
44
"code": "null",
45
"path": ""
46
}
Copied!
Role Action Mapping
1
[
2
{
3
"rolecode": "FSM_ADMIN",
4
"actionid": {{PLACEHOLDER1}},
5
"actioncode": "",
6
"tenantId": "pb"
7
},
8
{
9
"rolecode": "FSM_ADMIN",
10
"actionid": {{PLACEHOLDER2}},
11
"actioncode": "",
12
"tenantId": "pb"
13
},
14
{
15
"rolecode": "FSM_DSO",
16
"actionid": {{PLACEHOLDER2}},
17
"actioncode": "",
18
"tenantId": "pb"
19
},
20
{
21
"rolecode": "FSM_EDITOR_EMP",
22
"actionid": {{PLACEHOLDER2}},
23
"actioncode": "",
24
"tenantId": "pb"
25
},
26
{
27
"rolecode": "FSM_VIEW_EMP",
28
"actionid": {{PLACEHOLDER2}},
29
"actioncode": "",
30
"tenantId": "pb"
31
},
32
{
33
"rolecode": "FSM_EMP_FSTPO",
34
"actionid": {{PLACEHOLDER2}},
35
"actioncode": "",
36
"tenantId": "pb"
37
},
38
{
39
"rolecode": "FSM_EMP_FSTPO",
40
"actionid": {{PLACEHOLDER3}},
41
"actioncode": "",
42
"tenantId": "pb"
43
},
44
{
45
"rolecode": "FSM_EMP_FSTPO",
46
"actionid":{{PLACEHOLDER4}},
47
"actioncode": "",
48
"tenantId": "pb"
49
}
50
]
Copied!
Infra Ops Configuration
Configurations that we can manage through values.yml vehicle in infraops repo as follows values.yml for the vehicle can be found.
Description
name in values.yml
Current Value
id-gen host, to generate the application number
EGOV_IDGEN_HOST
egov-idgen from egov-service-host
mdms service host
EGOV_MDMS_HOST
egov-mdms-service from egov-service-host
workflow v2 service host
WORKFLOW_CONTEXT_PATH
egov-workflow-v2 from egov-service-host
user service host, to get the locale data
EGOV_USER_HOST
egov-user from egov-service-host
Kafka Consumer Group
SPRING_KAFKA_CONSUMER_GROUP_ID
egov-vehicle-services
kafka topic to which service push data to save new vehicle application
PERSISTER_SAVE_VEHICLE_TOPIC
save-vehicle-application
kafka topic to which service push data of the vehicleTrip to save
PERSISTER_SAVE_VEHICLE_TRIP_TOPIC
save-vehicle-trip
kafka topic to which service push data of the vehicleTrip to update
PERSISTER_UPDATE_VEHICLE_TRIP_TOPIC
update-vehicle-trip
kafka topic to which service push data of the vehicleTrip to update the status
PERSISTER_UPDATE_VEHICLE_TRIP_WORKFLOW_TOPIC
update-workflow-vehicle-trip
VehicleTrip Appilcatiion Number format`
egov.idgen.vehicle.trip.applicationNum.format
"[CITY.CODE]-VT-[cy:yyyy-MM-dd]-[SEQ_EGOV_VEHICLETRIP]"
Configurations sample in Values.yml
1
egov.idgen.vehicle.trip.applicationNum.format: "[CITY.CODE]-VT-[cy:yyyy-MM-dd]-[SEQ_EGOV_VEHICLETRIP]"
2
3
# Additional Container Envs
4
env: |
5
- name: EGOV_IDGEN_HOST
6
valueFrom:
7
configMapKeyRef:
8
name: egov-service-host
9
key: egov-idgen
10
- name: EGOV_HRMS_HOST
11
valueFrom:
12
configMapKeyRef:
13
name: egov-service-host
14
key: egov-hrms
15
- name: EGOV_MDMS_HOST
16
valueFrom:
17
configMapKeyRef:
18
name: egov-service-host
19
key: egov-mdms-service
20
- name: EGOV_USER_HOST
21
valueFrom:
22
configMapKeyRef:
23
name: egov-service-host
24
key: egov-user
25
- name: WORKFLOW_CONTEXT_PATH
26
valueFrom:
27
configMapKeyRef:
28
name: egov-service-host
29
key: egov-workflow-v2
30
- name: WORKFLOW_TRANSITION_PATH
31
value: "egov-workflow-v2/egov-wf/process/_transition"
32
- name: EGOV_IDEN_VEHICLE_TRIP_APPLICATIONNUM_FORMAT
33
value: "[CITY.CODE]-VT-[cy:yyyy-MM-dd]-[SEQ_EGOV_VEHICLETRIP]"
34
- name: SPRING_KAFKA_CONSUMER_GROUP_ID
35
value: egov-vehicle-services
36
- name: PERSISTER_SAVE_VEHICLE_TOPIC
37
value: save-vehicle-application
38
- name: PERSISTER_UPDATE_VEHICLE_TOPIC
39
value: update-vehicle-application
40
- name: PERSISTER_SAVE_VEHICLE_TRIP_TOPIC
41
value: save-vehicle-trip
42
- name: PERSISTER_UPDATE_VEHICLE_TRIP_TOPIC
43
value: update-vehicle-trip
44
- name: PERSISTER_UPDATE_VEHICLE_TRIP_WORKFLOW_TOPIC
45
value: update-workflow-vehicle-trip
46
- name: SPRING_KAFKA_PRODUCER_KEY_SERIALIZER
47
value: org.apache.kafka.common.serialization.StringSerializer
48
- name: SPRING_KAFKA_PRODUCER_VALUE_SERIALIZER
49
value: org.springframework.kafka.support.serializer.JsonSerializer
50
- name: JAVA_OPTS
51
value: {{ index .Values "heap" | quote }}
52
- name: JAVA_ARGS
53
value: {{ index .Values "java-args" | quote }}
54
- name: SERVER_PORT
55
value: "8080"
56
- name: SECURITY_BASIC_ENABLED
57
value: "false"
58
- name: MANAGEMENT_SECURITY_ENABLED
59
value: "false"
60
{{- if index .Values "tracing-enabled" }}
61
- name: TRACER_OPENTRACING_ENABLED
62
value: "true"
63
{{- end }}
Copied!

Data Setup

Create Vehicle

Create Vehicle with one of the vehicle **types available in the VehicleMakeModel MDMS
Sample Curl
1
curl --location --request POST 'https://dev.digit.org/vehicle/v1/_create' \
2
--header 'Content-Type: application/json' \
3
--data-raw '{
4
"RequestInfo": {
5
"apiInfo": {
6
"id": "string",
7
"version": "string",
8
"path": "string"
9
},
10
"deviceDetail": {
11
"id": "string",
12
"signature": "string"
13
},
14
"ts": 0,
15
"action": "string",
16
"key": "string",
17
"msgId": "string",
18
"requesterId": "string",
19
"authToken": "a35b5ba7-2d5f-4272-8a67-0303cfab2c9f"
20
},
21
"vehicle": {
22
"tenantId": "pb.amritsar",
23
"registrationNumber": "TS 09 PA 2466",
24
"model":"1998",
25
"type":"TRUCK",
26
"tankCapacity":"2000",
27
"suctionType":"SEWER_SUCTION_MACHINE",
28
"pollutionCertiValidTill":1611584416772,
29
"InsuranceCertValidTill":1611584416772,
30
"fitnessValidTill":1611584416772,
31
"roadTaxPaidTill":1611584416772,
32
"gpsEnabled":true,
33
"source":"Municipal records",
34
"owner": {
35
36
"tenantId": "pb.amritsar",
37
"name": "DSO1",
38
"fatherOrHusbandName": "Phani",
39
"relationship": "FATHER",
40
"gender": "MALE",
41
"dob": 550261800000,
42
"emailId": "[email protected]",
43
"correspondenceAddress": "KPHB",
44
"mobileNumber": 8919146630
45
}
46
}
47
}'
Copied!

Integration

Integration Scope

Integrated with Application through REST API to create, and search vehicles.
For any module where vehicle Trip is required, can integrate REST API trip/v1/create, update, search

Integration Benefits

    Vehicle Managed would become easy
    Trip Management would become easy

Steps to Integration

    FSM Application can vehicle/v1/_search to validate the FSM vehicle assignment
    FSM Application call vehicle/trip/v1/_create on assigning vehicle to the Application
    FSTP operator can mark the vehicleTrip as DISPOSED.

Interaction Diagram

Reference Docs

Title
Link
Workflow Technical Document
User Technical Document
MDMS Technical Document
NEEDS TO BE UPDATED
IDGen Technical Document
NEEDS TO BE UPDATED
Localization Technical Document
NEEDS TO BE UPDATED
Persister Technical Document
NEEDS TO BE UPDATED
SMS Notification Technical Document
NEEDS TO BE UPDATED
API Contract
Postman Scripts

API List

All content on this page by eGov Foundation is licensed under a Creative Commons Attribution 4.0 International License.
Last modified 5mo ago