Please enable JavaScript to view this website.

Skip to main content

Milwaukee Tool State Machines API (1.0.0)

Download OpenAPI specification:Download

Milwaukee Tool States Language (MTSL) is a JSON-based language used to describe state machines declaratively. Typically, these state machines involve performing some interaction with a compatible Milwaukee Tool product. The state machines thus defined may be executed by various software clients collectively referred to as "interpreters". See the Milwaukee Tool State Machines Language Specification for full details.

The API defined here allows interpreters a standardized interface for accessing and updating MTSL State Machine objects.

state-machine

Access MTSL state-machine objects

Get the list of functional groups a State Machine may be a part of

Responses

Response samples

Content type
application/json
[
  • "Baseline"
]

Get a collection of existing state machines relevant to a product or user

query Parameters
productId
number <int>

ProductId for which to find relevant state machines

userId
string

UserId for which to find relevant state machines (email of user)

intendedUsageLocation
string

Only include results matching this UsageLocation (Service, Engineering, Rework, RGA, ManufacturingProgrammingStation, Audit, or Regulatory)

functionalGroup
string

Only include results matching this functional functionalGroup

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get a single existing state machine

query Parameters
ID
required
string <uuid>

ID of state machine to return

Responses

Response samples

Content type
application/json
{
  • "CreatedAt": "2022-05-26T14:36:21Z",
  • "UpdatedAt": "2022-05-26T14:36:21Z",
  • "ID": "5267c1fc-89e4-4204-90e3-c2c94b612f25",
  • "Name": "My really cool state machine",
  • "Description": "This state machine does a bunch of stuff",
  • "Status": "Active",
  • "OwningUserId": "string",
  • "OwningProductId": 0,
  • "OwningFunctionalGroup": "string",
  • "Tags": [
    ],
  • "IsPublic": false,
  • "IntendedUsage": {
    },
  • "ExecutionDefinition": {
    }
}

Update an existing state machine

Request Body schema: application/json
required

State machine object to be updated

CreatedAt
string
UpdatedAt
string
ID
required
string <UUID>
Name
required
string
Description
string
Status
required
string
Enum: "Draft" "ValidationRequested" "Active" "Inactive"
OwningUserId
string
OwningProductId
number
OwningFunctionalGroup
string
Tags
Array of strings
IsPublic
boolean
object (IntendedUsage)
object (ExecutionDefinition)

Responses

Request samples

Content type
application/json
{
  • "CreatedAt": "2022-05-26T14:36:21Z",
  • "UpdatedAt": "2022-05-26T14:36:21Z",
  • "ID": "5267c1fc-89e4-4204-90e3-c2c94b612f25",
  • "Name": "My really cool state machine",
  • "Description": "This state machine does a bunch of stuff",
  • "Status": "Active",
  • "OwningUserId": "string",
  • "OwningProductId": 0,
  • "OwningFunctionalGroup": "string",
  • "Tags": [
    ],
  • "IsPublic": false,
  • "IntendedUsage": {
    },
  • "ExecutionDefinition": {
    }
}

Response samples

Content type
application/json
{
  • "CreatedAt": "2022-05-26T14:36:21Z",
  • "UpdatedAt": "2022-05-26T14:36:21Z",
  • "ID": "5267c1fc-89e4-4204-90e3-c2c94b612f25",
  • "Name": "My really cool state machine",
  • "Description": "This state machine does a bunch of stuff",
  • "Status": "Active",
  • "OwningUserId": "string",
  • "OwningProductId": 0,
  • "OwningFunctionalGroup": "string",
  • "Tags": [
    ],
  • "IsPublic": false,
  • "IntendedUsage": {
    },
  • "ExecutionDefinition": {
    }
}

Create a new state machine

Request Body schema: application/json
required

State Machine object to be saved

CreatedAt
string
UpdatedAt
string
ID
required
string <UUID>
Name
required
string
Description
string
Status
required
string
Enum: "Draft" "ValidationRequested" "Active" "Inactive"
OwningUserId
string
OwningProductId
number
OwningFunctionalGroup
string
Tags
Array of strings
IsPublic
boolean
object (IntendedUsage)
object (ExecutionDefinition)

Responses

Request samples

Content type
application/json
{
  • "CreatedAt": "2022-05-26T14:36:21Z",
  • "UpdatedAt": "2022-05-26T14:36:21Z",
  • "ID": "5267c1fc-89e4-4204-90e3-c2c94b612f25",
  • "Name": "My really cool state machine",
  • "Description": "This state machine does a bunch of stuff",
  • "Status": "Active",
  • "OwningUserId": "string",
  • "OwningProductId": 0,
  • "OwningFunctionalGroup": "string",
  • "Tags": [
    ],
  • "IsPublic": false,
  • "IntendedUsage": {
    },
  • "ExecutionDefinition": {
    }
}

Response samples

Content type
application/json
[
  • {
    }
]

Determine if execution definition is valid MTSL without saving

Request Body schema: application/json
required

Execution Definition object to be validated

StartAt
string
Comment
string
MTSLLanguageVersion
string
Default: "1.0"
TimeoutSeconds
number
Default: 30
object (States)

The collection of State objects which describe the State Machine's behavior. See MTSL Specification for full details about the structure of this object.

Responses

Request samples

Content type
application/json
{
  • "StartAt": "Hello World",
  • "Comment": "In this example, the state machine contains a single state named \"Hello World\". Because \"Hello World\" is a Task State, the interpreter tries to execute it.",
  • "MTSLLanguageVersion": "1.0",
  • "TimeoutSeconds": 30,
  • "States": {
    }
}

Response samples

Content type
application/json
[
  • {
    }
]

Get all versions of an existing state machine

query Parameters
uuid
required
string <uuid>

UUID of the state machine for which to retrieve all versions

Responses

Response samples

Content type
application/json
[
  • {
    }
]

product

Manage MSTL-related metadata for products

Get the list of functional groups a product is a part of

query Parameters
productId
number <int>

ProductId for which to find relevant functional groups

Responses

Response samples

Content type
application/json
[
  • "Baseline",
  • "OneKey",
  • "Hydraulic"
]

Update the list of functional groups a product is a part of

Request Body schema: application/json
required

Product object to be updated or created

ProductId
number
FunctionalGroups
Array of strings

Responses

Request samples

Content type
application/json
{
  • "ProductId": 1,
  • "FunctionalGroups": [
    ]
}

Response samples

Content type
application/json
{
  • "result": "Success"
}

chart

Generate charts to visualize a state machine's execution definitions

Generate a chart for an existing state machine

query Parameters
uuid
required
string

UUID of the state machine for which to generate a chart

Responses

Response samples

Content type
application/json
{
  • "result": "graph TD\nNodeStart[Start] --> Node0(Task 1)\nNode0 --> Node1(Choice 1)\nNode0 --> |on error|Node7(Show Error)\nNode1 --> Node6(Succeed 1)\nNode1 --> Node2(Wait 1)\nNode2 --> Node3(Passthrough)\nNode3 --> Node4(Choice 2)\nNode4 --> Node8(Show Success)\nNode4 --> Node5(Fail 1)\nNode5 --> End[End]\nNode6 --> End[End]\nNode7 --> End[End]\nNode8 --> End[End]\n"
}

Generate a chart for an adhoc execution definition

Request Body schema: application/json
required

Execution definition for which to generate a chart

StartAt
string
Comment
string
MTSLLanguageVersion
string
Default: "1.0"
TimeoutSeconds
number
Default: 30
object (States)

The collection of State objects which describe the State Machine's behavior. See MTSL Specification for full details about the structure of this object.

Responses

Request samples

Content type
application/json
{
  • "StartAt": "Hello World",
  • "Comment": "In this example, the state machine contains a single state named \"Hello World\". Because \"Hello World\" is a Task State, the interpreter tries to execute it.",
  • "MTSLLanguageVersion": "1.0",
  • "TimeoutSeconds": 30,
  • "States": {
    }
}

Response samples

Content type
application/json
{
  • "result": "graph TD\nNodeStart[Start] --> Node0(Task 1)\nNode0 --> Node1(Choice 1)\nNode0 --> |on error|Node7(Show Error)\nNode1 --> Node6(Succeed 1)\nNode1 --> Node2(Wait 1)\nNode2 --> Node3(Passthrough)\nNode3 --> Node4(Choice 2)\nNode4 --> Node8(Show Success)\nNode4 --> Node5(Fail 1)\nNode5 --> End[End]\nNode6 --> End[End]\nNode7 --> End[End]\nNode8 --> End[End]\n"
}