Higher priority jobs

Read the Service Priority

Using the priority export databox

How to use the priority export databox to read the service priority and display a message,

The following example demonstrates how a Startup script uses a SQL Databox to check for previous jobs raised within the past 5 minutes by the same user, on the same property and writes the details into a script Databox.

Later, a Custom Script checks the details of any previous job found.

The Startup Script

This is the Startup Script which executes Databox Read i.e. Keyfax.MultiOrderCheck where the results are written to the Databox MultipleJobs.Details:

The Startup Script

The SQL Databox

This query will looks for any orders submitted in the last 5 minutes, for the same operator and Asset ID. The query runs against the Keyfax table syOrder:

MultiOrderCheck SQL Databox

In the WHERE clause, you'll see references to other Databoxes in {curly} braces, including Keyfax.DateChecks below (subtracting 5 minutes from the current time could easily have been done using SQL in the above query but it is split out into a Databox just for demonstration purposes):

A Databox that subtracts 5 minutes from the current time

Using the results of the above Query

The Databox MultipleJobs.Details contains a number of Expressions, two of which are Conditional and are checking for values representing the Priority (you will see their use in the Result script below).

MultipleJobs.Details' Expressions

The Custom Script

If a job is found and it has an Urgent priority then the priority of the current job is checked. If the current job is an Urgent or Emergency priority then nothing is done. If the current job is a Routine, the priority needs to increase to an Urgent to match the previous job.

If there is a job found and it has an Emergency priority then the priority of the current job is checked. If the current job is an Emergency then nothing is done. If the current job is anything else, the priority needs to increase to an Emergency to match the previous job.

To add another level of checking, as notification to the Operator, a question is displayed informing the Operator that a priority change is required. If they continue, the priority will be upgraded accordingly.

The Priority checking custom script

Last updated