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.
| 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 |
[- {
- "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": [
- "ReallyCool"
], - "IsPublic": false,
- "IntendedUsage": {
- "Location": "Service",
- "TriggerType": "Manual",
- "Priority": 500
}, - "ExecutionDefinition": {
- "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": {
- "SomeStateName1": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}, - "SomeStateName2": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}, - "SomeStateNameX": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}
}
}
}
]| ID required | string <uuid> ID of state machine to return |
{- "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": [
- "ReallyCool"
], - "IsPublic": false,
- "IntendedUsage": {
- "Location": "Service",
- "TriggerType": "Manual",
- "Priority": 500
}, - "ExecutionDefinition": {
- "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": {
- "SomeStateName1": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}, - "SomeStateName2": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}, - "SomeStateNameX": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}
}
}
}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) |
{- "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": [
- "ReallyCool"
], - "IsPublic": false,
- "IntendedUsage": {
- "Location": "Service",
- "TriggerType": "Manual",
- "Priority": 500
}, - "ExecutionDefinition": {
- "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": {
- "SomeStateName1": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}, - "SomeStateName2": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}, - "SomeStateNameX": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}
}
}
}{- "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": [
- "ReallyCool"
], - "IsPublic": false,
- "IntendedUsage": {
- "Location": "Service",
- "TriggerType": "Manual",
- "Priority": 500
}, - "ExecutionDefinition": {
- "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": {
- "SomeStateName1": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}, - "SomeStateName2": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}, - "SomeStateNameX": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}
}
}
}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) |
{- "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": [
- "ReallyCool"
], - "IsPublic": false,
- "IntendedUsage": {
- "Location": "Service",
- "TriggerType": "Manual",
- "Priority": 500
}, - "ExecutionDefinition": {
- "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": {
- "SomeStateName1": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}, - "SomeStateName2": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}, - "SomeStateNameX": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}
}
}
}[- {
- "code": 0,
- "message": "A message describing what went wrong",
- "data": { }
}
]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. |
{- "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": {
- "SomeStateName1": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}, - "SomeStateName2": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}, - "SomeStateNameX": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}
}
}[- {
- "isValid": false,
- "errors": [
- "MISSING_TRANSITION_TARGET: Missing 'StartAt'|'Next'|'Default' target: Test"
]
}
]| uuid required | string <uuid> UUID of the state machine for which to retrieve all versions |
[- {
- "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": [
- "ReallyCool"
], - "IsPublic": false,
- "IntendedUsage": {
- "Location": "Service",
- "TriggerType": "Manual",
- "Priority": 500
}, - "ExecutionDefinition": {
- "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": {
- "SomeStateName1": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}, - "SomeStateName2": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}, - "SomeStateNameX": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}
}
}
}
]Product object to be updated or created
| ProductId | number |
| FunctionalGroups | Array of strings |
{- "ProductId": 1,
- "FunctionalGroups": [
- "Baseline",
- "OneKey"
]
}{- "result": "Success"
}| uuid required | string UUID of the state machine for which to generate a chart |
{- "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"
}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. |
{- "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": {
- "SomeStateName1": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}, - "SomeStateName2": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}, - "SomeStateNameX": {
- "Name": "State A",
- "StateType": "Task",
- "Resource": "Product::SendCommand::OpenLinkCommand",
- "InputPath": "string",
- "Parameters": { },
- "ResultSelector": { },
- "ResultPath": "string",
- "OutputPath": "string",
- "TimeoutSeconds": 30,
- "Next": "string",
- "End": true
}
}
}{- "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"
}