API
Documentation
  • Welcome!
  • REST API
    • Overview
    • Authentication
    • Swagger docs
    • Query an endpoint
    • Filter query results
    • Handling timestamps
    • Backward compatibility
    • Exporting Data using ODATA
    • Power BI Incremental refresh
    • Data Lake Transfer Gateway
    • EXAMPLES
      • Upload production schedule
      • Find all Running Orders
      • Interact with the Order Lifecycle
      • Consume and Submit an Activity
      • Raise an Event in TilliT
  • MQTT API
    • Overview
    • Connect to the TilliT Broker
    • Subscribe to a TilliT Topic
    • Setting a MQTT Integration
    • Publish Timeseries
    • Publish Order Progress
  • Activity API
    • Overview
    • JavaScript Basics
    • Using $scope and OnLoad Scripts
    • JavaScript Object Schema
  • Release Notes
    • 2024
      • April
Powered by GitBook
On this page
  1. REST API
  2. EXAMPLES

Interact with the Order Lifecycle

Overview

Changing the status of an order is an important part of tillit as it controls the execution of activities. To correctly trigger these activity, the correct endpoint need to be utilised. It is not advised that you change the status of an order via the PUT:/core/order-instance endpoint Instead the POST:/core/order-manager endpoint needs to be used. Each order lifecycle state has an endpoint that you need to query to be able to succesfully move orders between.

Ready an Order

This will move an order from the NEW state to the READY state. It will only work while the order has a status of NEW.

POST:/core/order-manager/ready
body: {
    id: 1 //ID of the order to be changed
}

Start Order Changeover

This will move an order from the READY state to CHANGEOVER. It will only work while the order has a status of READY and scheduledChangeOverDuration is more than 0.

POST:/core/order-manager/changeover
body: {
    id: 1 //ID of the order to be changed
}

Start an Order

This will move an order from the READY or CHANGEOVER state to RUNNING. It will only work while the order has a status of READY or CHANGEOVER

POST:/core/order-manager/start
body: {
    id: 1 //ID of the order to be changed
}

Complete an Order

This will move an order from the RUNNING or SUSPENDED state to COMPLETE. It will only work while the order has a status of RUNNING or SUSPENDED.

POST:/core/order-manager/complete
body: {
    id: 1 //ID of the order to be changed
}

Suspend an Order

This will move an order from the RUNNING state to SUSPENDED. It will only work while the order has a status of RUNNING.

POST:/core/order-manager/suspend
body: {
    id: 1 //ID of the order to be changed
}

Resume an Order

This will move an order from the CANCELLED, SUSPENDED or COMPLETED state to RUNNING. It will only work while the order has a status of CANCELLED, SUSPENDED or COMPLETED.

POST:/core/order-manager/resume
body: {
    id: 1 //ID of the order to be changed
}

Cancel an Order

This will move an order from the READY or NEW state to CANCELLED. It will only work while the order has a status of READY or NEW.

POST:/core/order-manager/cancel
body: {
    id: 1 //ID of the order to be changed
}
PreviousFind all Running OrdersNextConsume and Submit an Activity

Last updated 2 years ago