Executing Scheduled Orders

On this page, you can find the analysis of how the scheduled orders are executed automatically and manually as well as how the automatic re-execution functionality operates.

 

Automatic Execution of Scheduled Orders


After the successful completion of the checkout process for a Scheduled Order, the following actions take place.

  1. The Scheduled Order is admitted to the system automatically.

  2. The systemic notification email, called “Storefront Order Confirmation”, is dispatched automatically to the predefined Primary Contact, to inform them that the Scheduled Order was received by the system.

  3. The Scheduled Order receives the status ‘Scheduled’, and is pending execution on the defined Execution Date.

  4. Once the Execution Date of the Scheduled Order is reached, on the first hours of the Execution Date, the billing service of the platform runs and retrieves this order to execute it automatically.

  5. The prices of the ordered items are recalculated based on the latest prices provided by the system.

  6. Before the actual execution, the system checks if the customer has sufficient available credit for the order (for customers you have set a credit limit). If the scheduled order fails to be executed due to exceeding the available credit limit, then a systemic email notification, called Storefront Order Submission with No Available Credit, is dispatched to the predefined Primary Contact, while the Scheduled Order does not get executed and its status remains as 'Scheduled'.

  7. When all the checks of the mechanism are completed successfully, the actual execution of the Scheduled Order begins, and its status is updated to 'Executing'.

  8. After the Scheduled Order has been successfully executed, in its entirety by the billing service, its status is updated to ‘Executed’.

  9. The subscriptions and/or assets are created in our system, automatically.

  10. The provisioning of the automatically-provisioned services and/or add-ons begins.

  11. The debit invoices are either immediately created or scheduled for creation, depending on the billing method.

  12. A systemic notification email, called Scheduled Order Execution Successfully Completed, is dispatched to the predefined Primary Contact.

 

Manual Execution of Scheduled Orders


There are two main cases where a user would wish to manually execute a scheduled order.

  1. The scheduled Order has failed its automatic execution, and the user wants to re-execute it manually: In this scenario, the BSS users can check the History Records for entries related to the scheduled order to find the cause of failure.
    For example:

    • If an API call has failed during the automatic retrieval of the prices from an external system, then an entry is added in the History Records, informing the user of the reason the process failed with the message “The scheduled order has failed to be processed“.

    • If the Available Credit limit has been reached or exceeded, then an entry is added to the History Records, informing the user of the reason the process failed with the message “The execution of the scheduled οrder has failed“.

    After the issue that caused the failure is rectified. This manual execution is the only available option to try and execute such Scheduled Orders.

     

  2. The Scheduled Order needs to be manually executed prior to its defined Execution Date, for various reasons: In this scenario, the BSS users can manually execute the Scheduled Order by clicking on the Execute Order button, located in the Order’s view page, under the Shortcuts menu.

 

Automatic Re-Execution of Failed Scheduled Orders


All scheduled orders that failed to be executed due to an issue with external pricing in their order item(s), enter a list that makes them available for automatic re-execution within the same execution date of the scheduled order to retry to retrieve the external pricing information. Thus, a new scheduled job runs every day and, at specified intervals within that day, it gathers all the failed scheduled orders before trying to re-execute them automatically, provided that they have not been executed successfully manually before and that the current date of the re-execution is the same day as the execution date (converted to the running machine’s date and time).

How a Scheduled Order Enters the Re-Execution List

If a scheduled order that is executed fails due to an external pricing error, then this means that at least one of its order items did not successfully retrieve its pricing from the external system. As a result, this scheduled order is forwarded to the re-execution list.

The Scheduled Order Re-Execution List is also available to Tenant resellers.

Retry Scheduled Order Job

The retry scheduled order job is a continuous, autonomous service that is set up to run at 06:00 am (in the timezone of the hosted server), and every 6 hours until a default time threshold (of 19:00 in the timezone of the organization) is reached that is set for each organization, thereafter.

Retry Scheduled Order Job - Example (with different timezones between the hosted server and the organization):

The Server timezone is (+02) while the Organization timezone is (+06), and the Default Organization Threshold is set at 19:00 (+06).

1st retry run: Starts at 06:00 (+02) on the server (meaning 04:00 UTC), while the time of the organization is 10:00 (+06).

2nd retry run (after 6 hours of the 1st run): Starts at 12:00 (+02) on the server (meaning 10:00 UTC), while the time of the organization is 16:00 (+06).

3rd retry run (after 6 hours of the 2nd run): Tries to start at 18:00 (+02) on the server (meaning 16:00 UTC), but since the time of the organization is 20:00 (+06), meaning one hour after the default organization threshold of 19:00, the 3rd retry run will not commence since the threshold is exceeded.

This service is responsible for detecting and executing failed orders due to external pricing, multiple times per day, even if, for example, the billing service takes too long to run and misses the timeframe of the first retry attempt. The service will initially check the retry list for any inserted scheduled orders that fulfill the aforementioned checks, and lastly, it will create a historical record for every retry attempt, and then proceed with the automatic re-execution of the scheduled order continuously within a specific time threshold.

Retry Scheduled Order Job Flow

  1. Check retry list/table: The job will search through the re-execution list for scheduled orders that had at least one order item with an external pricing error and will also check the following:

  • Is the record of the order in OrderExecutionRetries with Status = “In Progress”?

    • If No, then the order will not be scheduled for re-execution (the record changed status to “Completed” or “Elapsed” as mentioned in the next controls).

    • If Yes, it moves to the next control.

  • Is the order currently still with Order Status “Scheduled”?

    • If No, then the order changed status (ex., manual execution of an order, cancel of an order, etc.) and will not be scheduled for re-execution.

    • If Yes, it moves to the next control.

  • Does the order still have at least one order item with an external pricing error?

    • If No, then the OrderExecutionRetries.Status is set to “Completed“ and the order will not be scheduled for re-execution

    • If Yes, it moves to the next control.

  • Is the current date later than the scheduled order’s execution date?

    • If Yes, then the OrderExecutionRetries.Status is set to “Elapsed“ and the order will not be scheduled for re-execution

    • If No, it moves to the next step.

  1. Create history record: Create a new retry history record for historical purposes.

  2. Credit control check & Execute Order: This step will try to re-execute the scheduled order in order to surpass the external pricing error.

  3. Dispatching of Notification Email: If the retried execution was successful, the predefined Primary Contact will receive the Scheduled Order Execution Successfully Completed notification email on the effective date; otherwise, it will receive one Scheduled Order Execution Failed notification email at the last execution retry (and not on each execution retry) if the retried execution has failed on the effective date.

Errors & Handling

If there is both a credit limit error and an external pricing error during the first execution of the scheduled order (not a retry), the order will not be inserted in the re-execution list.

If there is a credit limit error during the first execution of the scheduled order, the order will not be inserted in the re-execution list, nor it will be retried. A notification email will be dispatched to the customer stating that the available credit limit was exceeded for that order and thus it was not executed.

If there is a credit limit error after the first execution of the scheduled order, the order will not be retried. A notification email will be dispatched to the customer stating that the available credit limit was exceeded for that order and thus it was not executed.

Rare Case: If the Retry Scheduled Order Job service fails to run for a day and is restarted successfully on the following days, the customers will not be notified with the Scheduled Order Execution Failed notification email if their order was to be retried on the day the Retry Scheduled Order Job service was down.

 

 

Navigation to Scheduled Orders Pages