Apps and Auto Completion of Jobs
In GpsGate you can create jobs for drivers. With Apps you can write a script to complete dispatched jobs automatically when the driver has reached the place.
Read this first!
Make sure you’re familiar with these concepts:
Sample App with Click Script
In this example, we want to auto complete dispatched jobs when the worker gets to the job destination.
This is accomplished with the combination of an App with a Click Script that completes a job and an Event Rule called “AutomaticCompletionEventRule” that is triggered when the worker reaches the destination for an active job ( A sample Event Rule is included below).
- Create an App called “AutomaticCompletionApp” and assign it the _Administrator role.
- Add a Click Script named “AutomaticCompletionScript”. Choose Notifier kind, and specify the Event Rule that triggers this script, e.g. “AutomaticCompletionEventRule”.
- Click Edit and add this script:
- Save the script. Whenever your Event Rule is triggered, the script will complete the closest active job.
Sample Event Rule
Here’s a sample of the Event Rule “AutomaticCompletionEventRule”, that will trigger when the worker is within 100 m from the job destination:
- In the Event Rule editor, if this piece of code ends up like this:
workersActiveJobs.positionReplace it for square brackets instead:
- To be able the Job to autocomplete, it needs to be in active status first. This means that either the dispatcher or the Administrator should mark the job/s as active first.
How to activate a job in Desktop mode
How to activate a job in Mobile version
Discuss this blog post on the forum please