Skip to main content

Operation

Overview

The Operation entity represents a specific action or task that can be performed within the MES system. Each operation is defined with key attributes include duration settings, triggers for starting and stopping, and strategies for managing execution and conflicts. These fields collectively enable precise planning, execution, and tracking of operations.

Table Structure

The following table outlines the SQL columns for the operations table, providing a brief description of each, along with sample data where applicable.

ColumnTypeDescriptionExample
idString (ULID)Unique identifier for the entity.01JAP8RJBN-8ZTPXSGY-J9GSDPE1
enabledBooleanIf the entity is enabled or not.true
created_dateDateTimeDate the entity was created.2024-12-31T19:48:44Z
created_byStringPerson who created the entity.TamakiMES
modified_dateDateTimeDate the entity was modified. Value is null upon creation, and gets initially populated upon the first edit.2024-12-31T19:48:44Z
modified_byStringLast person to modify the entity. Value is null upon creation, and gets initially populated upon the first edit.TamakiMES
notesStringNotes about the entity.This entity has these extra notes
spare1StringThe first spare column that can be used for additional context on the entity.some extra context 1
spare2StringThe second spare column that can be used for additional context on the entity.some extra context 2
spare3StringThe third spare column that can be used for additional context on the entity.some extra context 3
nameStringName of the operation.Packaging
auto_add_to_scheduleBooleanAutomatically add this operation to the schedule if it doesn't exist.true
expected_duration_calculation_strategyString (Enum)Resolution strategies for the expected duration of an operation, as defined by the ExpectedDurationCalculationStrategy enum.STATIC
expected_duration_expressionStringThe Ignition expression for expected duration of an operation.See Ignition Docs
expected_duration_secondsIntegerThe expected duration of an operation in seconds.3000
flush_interval_millisIntegerThe time interval between data saves in milliseconds.1000
production_order_expressionStringThe Ignition expression to determine the production order that the operation runs.{[default]Tamaki/Brewing/Line1/ActiveOrder}
production_order_resolution_strategyString (Enum)Production order source for an operation, as defined by the ProductionOrderResolutionStrategy enum.MANUAL
production_order_update_strategyString (Enum)Strategy used if the production order expression changes while the operation is active, as defined by the ExpressionUpdateBehavior enum.KEEP_FIRST_GOOD_VALUE
running_conflict_strategyString (Enum)Conflict strategy used when a new operation is started while another is running, as defined by the OperationRunningConflictStrategy enum.STOP_PREVIOUS
start_production_order_statusString (Enum)Production order's status when the operation starts, as defined by the ProductionOrderStatus enum.RUNNING
start_trigger_expressionStringTrigger Ignition expression when starting the operation.See Ignition Docs
start_trigger_typeString (Enum)Trigger type when starting the operation, as defined by the TriggerType enum.RISING_EDGE
statusString (Enum)Status of the operation, as defined by the Status enum.IDLE
stop_production_order_statusString (Enum)Production order's status when the operation stops, as defined by the ProductionOrderStatus enum.STOPPED
stop_trigger_expressionStringTrigger Ignition expression when stopping the operation.See Ignition Docs
stop_trigger_typeString (Enum)Trigger type when stopping the operation, as defined by the TriggerType enum.FALLING_EDGE
trigger_sourceString (Enum)Ways that the various operations can trigger, as defined by the TriggerEvaluationStrategy enum.EXPRESSION
update_production_order_status_on_startBooleanUpdate the order status when the operation starts.false
update_production_order_status_on_stopBooleanUpdate the order status when the operation stops.false
current_operation_record_idString (ULID)References the current operation record. See operation_records.01JAP8R5RT-3FPXQABY-7KQZT6VF
current_production_order_idString (ULID)References the current production order. See production_orders.01JAP8RJBN-7KQZT6VF-Q5VUZYPW
location_idString (ULID)References the location where the operation is taking place. See locations.01JAP8R5RT-3FPXQABY-7KQZT6VF

Field Details

name

The name field provides a descriptive identifier for the operation.

auto_add_to_schedule

Indicates whether the operation should automatically add this operation to the schedule if it doesn't exist.

expected_duration_calculation_strategy

Represents the expected duration of an operation, based on the ExpectedDurationCalculationStrategy enum, with possible values:

  • EXPRESSION: Use an expression to calculate expected duration.
  • STATIC: Expected duration is a fixed number.
  • FROM_PRODUCTION_ORDER: Expected duration is based on the production order product material and expected run rate (performance targets).

expected_duration_expression

Defines the formula for calculating the anticipated duration of an operation, using the Ignition expression language. See Ignition Docs for more details.

expected_duration_seconds

The expected_duration_seconds field specifies the expected duration, in seconds, required to complete an operation.

flush_interval_millis

The flush_interval_millis field specifies the interval, in milliseconds, between data saves to the database.

production_order_expression

Defines the production order that the operation runs, based on the production order id or name, using the Ignition expression language. See Ignition Docs for more details.

production_order_resolution_strategy

Represents the production order source for an operation, as defined by the ProductionOrderResolutionStrategy enum, with possible values:

  • NONE: No production order for this operation.
  • MANUAL: Must be provided in the start method call.
  • EXPRESSION: Not provided in the method call, obtained by evaluating the expression.
  • SCHEDULE: Find the production order based on the schedule.

production_order_update_strategy

Represents the strategy used if the production order expression changes while the operation is active, as defined by the ExpressionUpdateBehavior enum, with possible values:

  • KEEP_FIRST_GOOD_VALUE: The system shall retain the first non-null, even if the expression changes during the operation.
  • KEEP_LAST_GOOD_VALUE: The system shall retain the last non-null, even if the expression changes during the operation.
  • THROW_ERROR: The system shall throw an error if the expression changes during the operation.
  • NEW_RECORD: The system shall create a new record if the expression changes during the operation.

running_conflict_strategy

Represents the conflict strategy used when a new operation is started while another is running, as defined by the OperationRunningConflictStrategy enum, which includes options such as THROW_EXCEPTION, and STOP_PREVIOUS.

start_production_order_status

Represents the status of the production order when the operation starts, as defined by the ProductionOrderStatus enum, with options such as IDLE, SCHEDULED, RUNNING, PAUSED, STOPPED, CLOSED, and CANCELLED.

start_trigger_expression

Defines the trigger expression when starting the operation, using the Ignition expression language. See Ignition Docs for more details.

start_trigger_type

Defines the trigger type when starting the operation as defined by the TriggerType enum, with options such as RISING_EDGE, FALLING_EDGE, and CHANGE.

status

Represents the status of the operation, as defined by the Status enum, with options such as IDLE, RUNNING, COMPLETED, FAULTED, CANCELLED, UNKNOWN, and PAUSED.

stop_production_order_status

Represents the status of the production order when the operation stops, as defined by the ProductionOrderStatus enum, with options such as IDLE, SCHEDULED, RUNNING, PAUSED, STOPPED, CLOSED, and CANCELLED.

stop_trigger_expression

Defines the trigger expression when stopping the operation, using the Ignition expression language. See Ignition Docs for more details.

stop_trigger_type

Defines the trigger type when stopping the operation as defined by the TriggerType enum, with options such as RISING_EDGE, FALLING_EDGE, and CHANGE.

trigger_source

Represents the ways that the various operations can trigger, as defined by the TriggerEvaluationStrategy enum, with possible values:

  • MANUAL: Manually triggered from a startOperation script.
  • EXPRESSION: Triggered via start/end trigger expressions.
  • PARENT: Triggered at the same time as the parent operation.

update_production_order_status_on_start

Indicates whether the production order status should be updated when the operation stats.

update_production_order_status_on_stop

Indicates whether the production order status should be updated when the operation stops.

current_operation_record_id

Indicates the currently associated OperationRecord, linking the operation to the current operation record. This allows the operation to know the current operation record in case of a shutdown/crash or gateway restart. See operation_records for details.

current_production_order_id

Indicates the currently associated ProductionOrder, linking the operation to the current production order. This allows the operation to know the current production order that the operation is running in case of a shutdown/crash or gateway restart. See production_orders for details.

location_id

References the Location entity where this operation is taking place, allowing precise tracking of where this operation is within the facility. See locations for details.