Thales Adaptive Connect Documentation Portal

Thales eSim Orchestrator(Order Scheduler)

The Thales Order Scheduler (TOS) (also called as eSim Orchestrator) is the core orchestration module within the TAC system to support advance features such as Business Rules for dynamic order generation decision making, Order posting in TAC system in advance via API, external Server Event Processing.

Background: In the normal flow, upon receiving the polling from the eUICC, the TAC server calls the fleet via getOrder to receive orders. The fleet manager checks the received polling events and based on business rules configured on fleet side against the received events for the given card, it responds the TAC server with the orders to be executed on the target device. The TAC server processes the received orders and returns the result of executed orders to fleet via getOrder calls. The fleet manager processes the results and events and may return the new orders based on business rules on it’s side. This process is done for every new polling from the eUICC.

Based on business choice, customers may choose not to have getOrder look up call on fleet manager for every polling request in order to reduce traffic on the fleet manager. Instead, customer can ask TAC system to manage the receive eUICC polling and events by it’s own and report only the device state change details and unmanaged events to fleet. This introduces the need of Business Rules in TAC system.

1. Business Rules

A business rule is a set of conditions defining when and what actions to take on the target group of eUICCs when those defined constraints are met. Here action can be any Order which is to be executed on the target eUICC. It can contain one or more actions. This enables TOS with dynamic decision making on which order to execute on the target eUICC based on preconfigured rule.

The following diagram illustrates the concept of business Rule at broad level:

tos business rule overview
Figure 1. Business Rule
  • Chaining of Orders:

    The Rule gives flexibility to TAC server to generate order based on response of previously precessed order’s response.

    Each state represents a specific action or order that can be executed. Once the Scheduler receives a response, it finds the next action corresponding to the response code and executes creates and issues the order. Configurability is granular at the level of error code in response to order.

    Following is the sample Rule :

{
  "rule_name": "thales-rule-download-on-init",
  "rule_state": "ACTIVE",
  "rule_priority": "MEDIUM",
  "criteria": [
    {
      "constraint_name": "EVENT_TYPE",
      "constraint_value": "EUICC_INITIALIZATION_EVENT"
    }
  ],
  "action": {
    "action_type": "DOWNLOAD_PROFILE",
    "action_metadata": {
      "order_template": {
        "pm_id": "9f1b3c2e-0011-4abc-b123-000000400201",
        "pool_name": "samplePoolName1",
        "pool_metadata": "samplePoolMetadata1"
      }
    }
  },
  "order_state_transitions": {
    "success_action_flow": {
      "action": {
        "action_type": "ENABLE_LAST_DOWNLOADED_PROFILE"
      },
      "success_action_flow": {
        "action": {
          "action_type": "DELETE_ANY_INACTIVE_PROFILE"
        }
      }
    },
    "failure_action_flow": [
      {
        "on_error_code": "9,10",
        "action": {
          "action_type": "DELETE_ANY_INACTIVE_PROFILE"
        },
        "success_action_flow": {
          "action": {
            "action_type": "DOWNLOAD_PROFILE",
            "action_metadata": {
              "order_template": {
                "pool_name": "samplePoolName1",
                "pool_metadata": "samplePoolMetadata1"
              }
            }
          },
          "success_action_flow": {
            "action": {
              "action_type": "ENABLE_LAST_DOWNLOADED_PROFILE"
            }
          }
        }
      }
    ]
  },
  "replay_freeze_minutes": "1440",
  "order_validity_in_days": 40,
  "validFor": {
    "startTime": "2024-12-17T09:30:47Z",
    "endTime": "2099-12-30T10:30:47Z"
  }
}

2. Rule Engine

The Order Processing Rule Engine is the framework designed to process Events received to Order Scheduler as per the configured rules. These rules are evaluated dynamically, and actions are executed when the conditions are met. The Order Scheduler can receive the events either from the eUICC via the TAC eIM or from the external server. This rule engine is configurable and powerful at the same time. The engine facilitates efficient order processing by evaluating conditions, executing corresponding actions, and handling responses using a set of defined state transitions.

The engine operates using several key parameters:

  1. Conditions: Event types (e.g., EUICC_INITIALIZATION_EVENT) and other condition types that must be met.

  2. Actions: Actions to be executed when the conditions are satisfied.

  3. ValidFor: Time duration during which a rule is considered valid.

  4. State Transition Actions: A decision tree that determines the next action based on responses received of previous orders issued to the eIM.

  5. Preferred Communication Mode: A configurable mode that indicates the preferred communication protocol with connection parameters with Card by eIM.

Rules are dynamically applied on eligible cards fulfilling criteria defined in the rule, ensuring that they are applied only to relevant cards or groups.

Once conditions are evaluated, actions are triggered, leading to the creation of orders. The engine will handle responses from the eIM and follow the appropriate state transitions until the rule processing is complete.

2.1. Rule Engine Workflow

The following diagram illustrates the high level workflow of Rule Engine:

tos rule engine workflow
Figure 2. Rule Engine Workflow
  1. Polling Request

    • Upon receiving a polling, the Order Processing Rule Engine evaluates the relevant rule(s) based on the event type, associated metadata, and card groups.

    • If the event or request is within the ValidFor time window of a rule, and the request matches the card group association, the conditions for that rule are evaluated.

  2. Condition Evaluation

    • Each rule contains a list of conditions that must be evaluated to true before executing the action.

    • Example Condition: For an EUICC_INITIALIZATION_EVENT, the system checks if the eUICC is in the initialization state.

    • All conditions must evaluate to true for the action to be executed.

  3. Action Execution

    • Once all conditions are met, the corresponding action is triggered.

    • Actions and Order Generation: The engine generates an order (as specified in order types) and sends it to the eIM system for further processing. Time to send it to eIM is based on the preferred mode of transport.

  4. State Transition Actions and eIM Response Handling

    • After sending the order to the eIM system, the engine waits for a response (success or error code). Based on the response, the system follows the configured state transition actions.

    • State Transition Actions form a decision tree where the engine evaluates the eIM response and determines the next steps:

    • Success Response: Based on the response provided by eIM it looks for configured action in rule corresponding to this response(success of failure error code) and creates corresponding order.

    • This process continues until the engine either: Receives no further eIM packages, indicating the rule’s processing is complete. Completes all the required actions for the current rule.

  5. End of Process

    • The Scheduler continues processing rules until all events are processed, and there is no more event to be evaluated agains any other rule. If there are multiple eligible rules, the engine will proceed with evaluating the next rule once the current rule is fully processed.

3. eUICC state synchronization and getOrders with the Fleet Manager

When business rules are provisioned in TOS, the TAC Server evaluates the eligible rules against the received unprocessed events. Rules are evaluated according to their configured priority: HIGH, MEDIUM, or LOW.

If an eligible rule is found, the TAC Server processes the rule and generates the corresponding orders or actions. After the rule is processed, the TAC Server notifies the Fleet Manager with the updated eUICC delta state information. This allows the Fleet Manager to remain synchronized with the current state of the eUICC.

The Fleet Manager must implement and expose the Notification API in order to receive eUICC state updates from the TAC Server.

After sending the notification, the TAC Server continues evaluating the remaining unprocessed events and searches for the next eligible matching rule. If another matching rule is found, it is processed in the same way. This loop continues until no further matching rule is available.

When no more matching rules are available for processing, the TAC Server invokes the getOrders API exposed by the Fleet Manager. The getOrders request contains the current eUICC delta state and any remaining unprocessed events, if applicable. Depending on the configured integration flow, the request may also include order results.

The Fleet Manager may respond with new orders based on the received eUICC state information and unprocessed events. If orders are returned, the TAC Server processes them through the TAC eIM using the standard order execution flow.

If no orders are returned by the Fleet Manager, the flow ends.

The TAC Server invokes the getOrders API only when the Fleet Manager integration using the getOrders flow is enabled.

The following diagram describes the TAC server interaction with the Fleet Manager when Business Rules are configured in TAC system:

tac order scheduler and fleet manager
Figure 3. eUICC state synchronization and getOrders with the Fleet when business rules are configured

4. Business Rules in Campaign Mode

The TAC Server supports the execution of Business Rules in Campaign Mode.

A Business Rule can be configured with the campaign_mode flag to define whether the rule behaves as a standard Business Rule or as a Campaign Rule.

When campaign_mode is set to true, the Business Rule operates in Campaign Mode. In this mode, the rule is executed only once for each eligible device. After the rule has been successfully evaluated and processed for a given device, the TAC Server does not execute the same rule again for that device, even if subsequent events continue to match the rule conditions.

When campaign_mode is set to false, or when the flag is not enabled, the rule behaves as a standard Business Rule. In this mode, the rule may be evaluated and executed each time a qualifying event is received, according to the rule conditions and priority.

Campaign Mode is intended for use cases where an action must be applied only once to each eligible device.

A Campaign Rule is based on the same Business Rule definition and eligibility criteria as a standard Business Rule. The campaign_mode flag only changes the execution behavior by preventing repeated execution of the same rule for a device after it has already been processed.

5. External Server Events

This section describes how externally generated events (for example, geolocation-based events) can trigger Remote SIM Provisioning (RSP) operations in the TAC system when regular IPA polling is disabled.

The following diagram illustrates the end-to-end flow for an External Server–triggered event, from event generation to execution of the corresponding operation on the eUICC.

tac external server events
Figure 4. TAC Server External Server Event Management
  1. Device Context Collection : A device-side management component (for example, a Geolocation Agent) running on the IoT device collects contextual information such as the device’s geographic location.

  2. Event Generation by External Server : The IoT device sends its context data to an External Server. Based on this information, the External Server evaluates its own logic and generates an Event (e.g., Geolocation Event), optionally including custom metadata. The Event is sent to the TAC Server through the exposed external event API.

  3. Event Processing and Order Determination : Upon receiving the Event, the TAC Server processes it using the configured Business Rules in the Order Scheduler. Based on these rules, the TAC Server determines the appropriate Remote SIM Provisioning action and prepares the corresponding Orders (for example, Profile Download, Enable Profile, or Delete Profile) in retrieval mode.

  4. Device Wake-Up via Shoulder-Tap : In this scenario, regular polling from the IPA to the TAC eIM is disabled. To initiate communication with the device, the TAC Server first sends a PingDevice command to the IPAe Companion using an MQTT-based shouldertap mechanism via the MQTT Broker.

  5. Polling Initiation by IPAe : After receiving the shoulder-tap notification, the IPAe Companion triggers the IPAe to initiate a polling session. The IPAe establishes a secure connection and sends an ESipa.GetEimPackage request to the TAC eIM to retrieve pending commands.

  6. Command Delivery from TAC server to IPAe : The TAC Server responds to the polling request by delivering the prepared eIM Package containing the RSP command (for example, Profile Download or Profile State Management operation) to the IPAe over HTTPS.

  7. Execution on eUICC The IPAe executes the received command on the eUICC in accordance with GSMA SGP.32 procedures.

This event-driven model enables policy-based control of eSIM lifecycle operations, even in deployments where continuous polling from the device is intentionally disabled and the device event is being monitored by some external server.

6. Order Provisioning in TAC system

The getOrder flow from TAC server to Fleet is the Event driven which is mainly based on polling triggered by the eUICC. This allows Fleet to take decision based on received events and respond TAC server with Orders to be executed on the eUICC.

The POST Orders API exposed by the TAC server allows Fleet Manager/Connectivity Providers to provision orders in advance directly to the TAC ecosystem.

The connectivity Providers can submit the Orders with preferred_mode specified such as RETRIEVAL, INJECTION or SHOULDER_TAP.

  1. RETRIEVAL Mode: TAC server waits for getEimPackage polling request from the IPA to process the next available order. See Retrieval Mode

  2. INJECTION Mode: TAC server transfers eIM Package command to the IPA without waiting for getEimPackage polling request from the IPA. See Injection Mode

  3. SHOULDER_TAP Mode: TAC server sends PUSH trig message called as Shouldertap to trigger the IPA to initiate polling with eIM. See Shouldertap mode

The TAC server executes each received order sequentially as per preferred_mode and returns a result for each operation to the Connectivity Provider via Notification endpoint configured in the TAC.

tac tos post orders
Figure 5. POST Orders to TAC Server via REST API

The following diagram illustrates the orders provisioning workflow in TAC system:

post order execution overview sequence
Figure 6. POST Order workflow
For INJECTION mode support, integration to LWM2M Server or MQTT Broker is required.

The following diagram shows the detailed execution workflow of provisioned orders inside the TAC system:

post order execution simplified sequence
Figure 7. POST Order execution workflow
  1. Connectivity Provider submits the order to the TAC server Order Scheduler over HTTP POST Order Provisioning API.

  2. Order Scheduler Persists the Order locally and processes them as per preferred_mode — RETRIEVAL, INJECTION or SHOULDER_TAP

  3. In RETRIEVAL mode,

    1. TAC server waits for the IPA to poll.

    2. Once the IPA polls the TAC eIM, the TAC eIM processes the IPA polling requests, evaluates events if any and sends the getOrder request along with detected events to TAC Order Scheduler. Here it also posts results of previously executed orders to the Order Scheduler.

    3. Order Scheduler processes the results of previously sent orders, synchronizes the eUICC states and based on Event and criterias picks the next eligible Orders stored locally and sends them to TAC eIM.

    4. The TAC eIM after processing the orders sends the execution results to the Order Scheduler.

    5. Order Scheduler processes the results, synchronizes the eUICC states and picks next submitted order to process if available locally.

    6. After processing the provisioned orders for the given eUICC, Order scheduler sends Results of executed orders via async notification to the Connectivity Provider as per configuration.

  4. In INJECTION mode,

    1. After persisting the provisioned orders locally, Order Scheduler sends the Orders immediately to the TAC eIM which further processes the Order in Injection mode - by immediately sending eIM Package command to the IPA via configured Injection Server.

    2. The TAC eIM after processing the orders in Injection mode sends the execution results to the Order Scheduler.

    3. After processing the provisioned orders for the given eUICC, Order scheduler sends Results of executed orders via async notification to the Connectivity Provider as per configuration.

  5. If getOrder flow is enabled, then after sending the notification for processed provisioned Orders, Order scheduler calls getOrder method of the Fleet (along with unprocessed Events if available).