Schedule Optimization > Resources > Real-Time Optimization Execution Overview
Real-Time Optimization Execution Overview
Real-Time Optimization works with the following objects for scheduling activities:
Work Order
Technician
Event
RTO monitors the records of the objects if the records qualify for the configured dispatch process. It also updates the records with scheduling information. The records are updated at trigger points.
The following diagram depicts the execution flow of scheduling in RTO.
The following sections describe the flow of events in Real-Time Optimization.
Auto-update Process for Work Order Records
The creation or updation of a work order acts as the trigger point for initiating the process to update the related records. Following is the sequence flow of the records update:
1. Work Order is created or updated.
2. Work Order trigger is invoked. The following steps are performed:
a. Business rules are applied.
b. SLA, Preferred Technician, and Business Hours are set for the work order.
c. Primary territory for the work order is applied.
d. The dispatch process for the work order is matched. A check is performed to decide if it is an RTO dispatch process or not.
If is it not an RTO dispatch process, the workflow stops.
If is it an RTO dispatch process, the workflow continues.
3. The work order is pushed to MaxQ.
* 
MaxQ is enabled when SET004 is set to True.
When MaxQ is enabled: The following actions occur:
Work order create or update requests are queued.
Requests are processed.
Requests are sent to Real-Time Optimization Engine in batches.
* 
Batching of the requests is useful when the volume of create and update request is high, as it reduces the number of calls made from Salesforce to the Real-Time Optimization engine. The batch size is determined by the value of SET005, and the interval at which the queued requests are processed is determined by the value of SET006.
When MaxQ is not enabled: The requests are sent to the Real-Time Optimization engine one at a time, in real-time.
* 
Ensure that the MaxQ Scheduler is running. To start the MaxQ Scheduler, run the following script in the Developer Console:
SVMXC.WSCH_Provider_ECO_MaxQScheduler maxQ = new SVMXC.WSCH_Provider_ECO_MaxQScheduler(); maxQ.startMaxQScheduler();
4. ManageJob and InitJob methods are invoked depending on whether the RTO dispatch process is in running or idle state. The methods update the received data or the work orders in the format readable by the optimization engine.
5. Connection is made to AWS where the optimization engine is available.
6. Work Order is scheduled by the optimization engine.
7. Tentative schedules and finalized schedules are pushed to SFDC periodically, at time intervals specified in the Dispatch Threshold and the Sync Interval fields in the dispatch process.
8. The work order is updated with the scheduling information.
Auto-Update Process for Events and Technicians Records
Whenever a technician or event record is created or updated, it acts as a trigger point for initiating the process to update the related records. Following is the sequence flow of the record update:
1. Technician or Event record is created or updated.
2. The event trigger is invoked. Match if the event belongs to RTO.
If no, then stop.
If yes, then create or update a record in the Optimizer Transactions object with the information.
3. The technician trigger is invoked. Match if the technician belongs to the territory.
If no, then stop.
If yes, then create or update a record in the Optimizer Transactions object with the information.
4. Event or Technician details are pushed to MaxQ.
When MaxQ is enabled: The following actions occur:
Technician and event create or update requests are queued.
Requests are processed.
Requests are sent to Real-Time Optimization Engine in batches.
When MaxQ is not enabled: The requests are sent to the Real-Time Optimization engine one at a time, in real-time.
5. manageTechnicians and manageTechnicianEvents methods are invoked. These methods read the data and prepare them in a format that is readable by the optimization engine.
* 
When the RTO job is suspended, requests are sent to the Optimization engine but schedules are updated when the RTO job starts running.
When the RTO job is IDLE, any technician or event creation or update does not make a call to the optimization engine.
6. Connection is made to AWS where the optimization engine is available.
7. manageTechnician or manageEvent REST API is invoked. The APIs update the technician or the event data.
8. Updated information is synchronized with SFDC.
Was this helpful?