Avatar

Clarity on WorkHour edit and notify method

0

Hi,

I needed to make some custom rules using work hours in geotab.

Via APIs, I added workHours and created a rule based on these work hours.

My question is If I update the work hours again using the Set method, whether the notify method called automatically which will notify my rules or do I have to call that method explicitly.

Thanks

Deepanshu Pathak

Please sign in to leave a comment.

8 comments

0
Avatar

Changing the workHours referenced by a rule should not effect the notifications for that rule.

Steve Hansen 0 votes
0
Avatar

Hi Steve, thanks for clarification but I needed to know once I update the work hours, my rule which is based on these work hours get updated as well according to the new work hours or do I have to do something else as well.

 

I am talking about whether to call this api or not after I modify my work hours.

{
"method": "Notify",
"params": {
"topicId": "dataupdate|XYZ",
"data": {
"type": "Rule",
"verb": "Set",
"senderId": "",
"data": [
""
]
},
"credentials": {
"database": "",
"sessionId": "",
"userName": ""
}
}
}
Deepanshu Pathak 0 votes
1
Avatar

Deepanshu,

You do not need to use the Notify method.

The rule references the Id of a WorkHour object which means any changes to the WorkHour object will be reflected within the rule without any additional steps.

Mauricio Muniz 1 vote
0
Avatar

Hi Mauricio,

I have two queries:

  1. I tried creating the rule with reference to a work hour object and got exception events. But when I modified my work hour object, I am not able to see new exceptions according to the modified time.
  2. Also the notification on the rule is to put the vehicle in private or non private mode based on the work hour which I added using the Add distribution list api and the same appears on the rule notification tab in the UI, but I cannot get any TripType changes in the GET TripTypeChange api for that device.

 

 

Deepanshu Pathak 0 votes
0
Avatar

To put the car in private and non private mode as part of notification of a rule I am using add distribution list api. Is this the correct api to do so because I can see the changes in the ui in rules notification tab but I am unable to see the exceptions when I search for them.

Deepanshu Pathak 0 votes
0
Avatar

Hey Deepanshu,

Apologies for the delay here.

To answer your questions:

1. As mentioned, a rule references work hours by ID so if the definition of the work hours changes then it should be reflected on any subsequent exceptions created. If that is not the case then I would need examples which would be best provided in ticket form. I would advise that you work with the Geotab Reseller to submit a ticket into the support queue.

2. Have you gone through the Privacy Mode User Guide?  Please give it a read and then let me know if you have any further questions.

Mauricio Muniz 0 votes
0
Avatar

Hi Mauricio,

The privacy mode user guide tells how to add vehicle in private and non private mode for a rule notification via UI, but how to add the same via APIs. Is the add distribution list the correct api to do so?

Deepanshu Pathak 0 votes
0
Avatar

Yes, it would be an Add<DistributionList> call.

You only need 1 distribution list object for Privacy mode and one for Out of Privacy Mode as the DistributionList object will accept an array of rule id's.
Something like the below:

{
name:"UniqueDistributionName",
recipients:[{"recipientType":"TripTypeChange","tripType":"Private"}],
rules:[{"id":"GUID1"}, {"id":"GUID2"},...]
}

Mauricio Muniz 0 votes