In this blog I have listed high level validation that I usually include in my OIC while creating activity in OFS , where source for Activity data is 3rd party ( Source system).
- Is Activity type is valid value in OFS , if not just terminate the flow.
- Is there any Technician details exists in Payload ( that is send by source system, while triggering OIC).
- Is Technician details exists in OFS or this is new Tech.(Not yet created in OFS), if this is new tech then Create New Resource as well as new User in OFS ( and if required send email notifications to stakeholders)
- If technician details exits and if flag in payload indicates that this is a preferred tech. for work, then once activity is created , call the OFS APIs and add the technician as preferred tech. for activity.
- If there is preferred tech. exists in activity payload , also validate tech. schedule and see if he/she is working between SLA time line , if yes then continue assigning tech to activity , but of Tech is not working during Time line then assign activity to Team/branch etc.
- Validate if new task has any priority associated with it , and based on data in the payload assign a Position to activity in Route
Once Activity created successfully in OFS , and there is need to send the data back to source or any down stream system ( when ever there is change of status of activity ) , then design and new OIC flow and subscribe to OFS activity events , like
- ACTIVITY CREATED
- ACTIVITY UPDATE
- ACTIVITY MOVED etc
and take action as per need .