var a4 = "measuredate="+msg.timestamp; var a5 = "newreading="+data.temp; msg.url=urlbase+"&"+a1+"&"+a2+"&"+a3+"&"+a4+"&"+a5; return msg; Commented Code: Comments Line 1 Change the IPADDRESS to the instructor provided IPADDRESS – var urlbase =""; var data=msg.payload.d; msg.timestamp= new Date().toISOString(); msg.payload=null; Comments Line 5 Make the following changes, the ASSETNUM to your asset – var a1 = "assetnum=1234567890"; Comments Line 6 Make the following changes, METERNAME to your meter – var a2 = "METERNAME=TEMP-C"; var a3 = "siteid=bedford"; var a4 = "measuredate="+msg.timestamp; var a5 = "newreading="+data.temp; msg.url=urlbase+"&"+a1+"&"+a2+"&"+a3+"&"+a4+"&"+a5; return msg; In the Name field enter: Build RESTAPI URL Click OK. Double click the http request node and make the following changes. Change the Method to POST In the Name enter: POST Meter Reading to Maximo Click OK. Double click the debug node and make the following changes. Change the Output to msg object’ ‘Complete In the name field enter Output’. ‘JSON Click OK Your flow should look like this. Now connect the nodes by left-clicking (keep the mouse key depressed) a gray rounded square on one node and moving the mouse to the gray square on the node you wish the flow the data. Your screen should look like this.
var a4 = "measuredate="+msg.timestamp; var a5 = "newreading="+data.temp; msg.url=urlbase+"&"+a1+"&"+a2+"&"+a3+"&"+a4+"&"+a5; return msg; Commented Code: Comments Line 1 – Change the IPADDRESS to the instructor provided IPADDRESS var urlbase =""; var data=msg.payload.d; msg.timestamp= new Date().toISOString(); msg.payload=null; Comments Line 5 – Make the following changes, the ASSETNUM to your asset var a1 = "assetnum=1234567890"; Comments Line 6 – Make the following changes, METERNAME to your meter var a2 = "METERNAME=TEMP-C"; var a3 = "siteid=bedford"; var a4 = "measuredate="+msg.timestamp; var a5 = "newreading="+data.temp; msg.url=urlbase+"&"+a1+"&"+a2+"&"+a3+"&"+a4+"&"+a5; return msg; In the Name field enter: Build RESTAPI URL Click OK. Double click the http request node and make the following changes. Change the Method to POST In the Name enter: POST Meter Reading to Maximo Click OK. Double click the debug node and make the following changes. Change the Output to ‘Complete msg object’ In the name field enter ‘JSON Output’. Click OK Your flow should look like this. Now connect the nodes by left-clicking (keep the mouse key depressed) a gray rounded square on one node and moving the mouse to the gray square on the node you wish the flow the data. Your screen should look like this.
An_Approach_to_Integrating_IoT_Platform_with_Maximo_Meters.docx