Lab 7.4 – Data connection between service and client

The PumpRepairRequest client is able to receive information from the Repair service by calling an object called Pump. Later on, I see that a data stream called Pump is defined in the PumpRepairDetails client, but there is no data object or stream defined in PumpRepairRequest.

Is the Pump in PumpRepairRequest the same as the one in PumpRepairDetails? I’m confused how the PumpRepairRequest client is able to receive information from the Repair service.

Posted: May 2, 2024 at 1:12 am
Replies: 7
May 2, 2024
Posted by Lisa Ackerman

Hi Bryant!

Are you talking about the text values in PumpRepairRequest?  No, you’re setting that up from the Notify task in Lab 7.3, when you create the “PlaceHolder Client” called PumpRepairRequest in the first place.  At that point, the Pump and PumpId are in the Client title and therefore available to the text body through ${} variable substitution.

Does that answer your question?  You can also watch the videos for Labs 7.3 and 7.4 to see these exact steps done.  If that still doesn’t help, send me another message!

–lisa

 

May 3, 2024
Posted by Bryant Vu

Yes I’m referring to the text values in PumpRepairRequest.

Does that mean the objects we place in the title and body for the notify component can be seen in the client?

In Lab 7.3, I do see that event.PumpId is placed inside the client body, but I don’t see any Pump object going into the client. This is the part that confuses me, I can’t find where the Pump object is defined that the PumpRepairRequest client is accessing through variable substition.

May 3, 2024
Posted by Bryant Vu

Alternatively, is there a way to check what kind of data the client can access?

I’m using this lab as a model for a test system where I send data over to the client in a similar way to the lab.

May 3, 2024
Posted by Lisa Ackerman

Hi again, Bryant:

It does seem a bit odd that the Client “knows” pump information we didn’t explicitly send,  but the Notify task is sending a payload to the mobile client, and that payload is including the current event, which has all the things.

–lisa

May 3, 2024
Posted by Lisa Ackerman

Hi Bryant:

Yes, actually; take a look at the code snippet in Lab 7.4:

`

client.data.CurrentPump = client.getCollaborationContext().Pump;

client.getWidget(“PumpString”).text = “Pump : ” + client.data.CurrentPump.PumpId;

var ds = client.getDataStreamByName(“Pump”);

var p = new TimedQueryParameters();

p.whereClause = {

PumpId: client.data.CurrentPump.PumpId

};

client.modifyTimedQuery(ds,p);

client.getWidget(“PumpLocationMap”).map.setZoom(14);

`

I bolded the first line, which is collecting all the Collaboration data, including current event data, to the Client.  You can “print” that to see what-all there is.

–lisa

May 3, 2024
Posted by Bryant Vu

This looks like the onStart code for PumpRepairDetails.

Is PumpRepairRequest able to see the data going into PumpRepairDetails?

May 3, 2024
Posted by Lisa Ackerman

The first notification was “broadcast” to all the techs that the Recommend procedure returned.  (In our case, that was all of one person, but it could have been a list!) But until that person clicked the Submit button in the PumpRepairRequest client, he wasn’t Assigned as the tech for the Collaboration.  Hence, we couldn’t get Collaboration context yet.  Once we could assign the tech, the next Client associated with the new Notify pattern could get the whole Collaboration.

I hope this is clearing things up!

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
© Vantiq 2024 All rights reserved  •  Vantiq Corporation’s Privacy Policy and Cookie Policy