system.mes.operation.startOperation
Description
Starts an Operations object.
Optionally associates a production order with the operation, and optionally sets the start time. Provide either startDate (a Date) or startDateMillis (epoch milliseconds); if both are given, the millis value takes precedence. If neither is provided, the operation starts now.
Permissions
This method requires the OPERATION.EXECUTE permission.
Syntax
The only required argument is operationId. All arguments may be passed positionally or as keyword arguments.
# Start now
system.mes.operation.startOperation(operationId)
# Start now, associating a production order
system.mes.operation.startOperation(operationId, productionOrderIdOrName)
# Start at a specific time (as a Date)
system.mes.operation.startOperation(operationId, startDate=startDate)
# Start at a specific time (as epoch milliseconds)
system.mes.operation.startOperation(operationId, startDateMillis=startDateMillis)
Parameters
| Parameter | Type | Nullable | Description |
|---|---|---|---|
operationId | String (ULID) | False | The ID of the operation to start. |
productionOrderIdOrName | String | True | The ID or name of the production order to associate with the operation. |
startDate | Date | True | The start date of the operation. Provide either this or startDateMillis. |
startDateMillis | Long | True | The start date of the operation in epoch milliseconds. Takes precedence over startDate if both are provided. |
Returns
Returns a JSON object of the operation execution result for the start of the operation.
Example Usage
# Start the operation
startedOperationResult = system.mes.operation.startOperation('01JPBCPKSR-972W3V0Y-H00NNSKQ')
# Output the operation execution result of the started operation
print(startedOperationResult)