You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After receiving the following message payload from the pub-sub topic, it needs to be parsed to prepare objects and store them as entities under respective datastore Kind's
{
"manifold_sn": 1,
"stations": [{
"station_num": 0,
"valve_sn": 2,
"sku": "NX-DCV-SM-BLU-2-V0-L0-S0-00",
"cc": 8,
"ccl": 406351062,
"pp": 125.0,
"p_fault": "H",
"leak": "N",
"input": "B",
"update_time": 1501615838081
}, {
"station_num": 4,
"valve_sn": 0,
"sku": "NX-DCV-SM-BLU-2-V0-L0-S0-00",
"cc": 5,
"ccl": 894379810,
"pp": 130.0,
"p_fault": "L",
"leak": "N",
"input": "B",
"update_time": 1501615839083
}]
}
FOR EACH MESSAGE THE FOLLOWING INSERT/UPDATE STEPS ARE PERFORMED:
step-1: Insert Manifold object if not found, else update the timestamp (inserts 1 object or no object)
step-2: Insert Valve object if not found else update the timestamp(inserts <= total number of valve objects in the message)
*step-3: Find station with current Valve serial Number, if different than that of message, set old station to null and update the new station with current valve
step-4: Insert Valve status (inserts == number of valves in the message)
*Note: step-3 is little tidious task relative to others