Skip to main content

Inventory Operation

Overview

The InventoryOperation entity represents a configurable action that can be performed on inventory lots and inventory. Each inventory operation defines strategies for resolving lots, locations, materials, inventory names, quantities, and start/stop triggers. These fields collectively enable precise planning, execution, and automated control of inventory operations.

Table Structure

ColumnTypeDescriptionExample
idString (ULID)Unique identifier for the entity.01JAP8RJBN-8ZTPXSGY-J9GSDPE1
enabledBooleanWhether the entity is enabled.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. Null on creation until first update.2024-12-31T19:48:44Z
modified_byStringLast person to modify the entity. Null on creation until first update.TamakiMES
notesStringFreeform notes (inherited from BaseEntity).Night shift auto config
spare1StringUser-defined spare field.context a
spare2StringUser-defined spare field.context b
spare3StringUser-defined spare field.context c
operation_idString (ULID)References an Operation that this inventory operation is associated with.01JAP8RJBN-8ZTPXSGY-J9GSDPE1
nameString(Required) Name of the inventory operation.Packaging
statusString (Enum)Current status (defaults to IDLE). See Status enum.IDLE
current_record_idString (ULID)References the current InventoryLotRecord (nullable).01JAP8R5RT-3FPXQABY-7KQZT6VF
operation_typeString (Enum)Inventory operation type (defaults to CONSUME). See InventoryOperationType (implemented values listed below).CONSUME
trigger_sourceString (Enum)Strategy for evaluating triggers (defaults to EXPRESSION). See TriggerEvaluationStrategy.EXPRESSION
start_trigger_expressionString (Expression)Expression that, with trigger logic, starts the operation (nullable).{[default]Trigger/Start}
start_trigger_typeString (Enum)Start trigger edge/type (defaults to RISING_EDGE). See TriggerType.RISING_EDGE
stop_trigger_expressionString (Expression)Expression that, with trigger logic, stops the operation (nullable).{[default]Trigger/Stop}
stop_trigger_typeString (Enum)Stop trigger edge/type (defaults to FALLING_EDGE). See TriggerType.FALLING_EDGE
source_location_idString (ULID)Source Location (nullable).01JAP8RJBN-7KQZT6VF-Q5VUZYPW
destination_location_idString (ULID)Destination Location (nullable).01JAP8RJBN-8ZTPXSGY-J9GSDPE1
material_sourceString (Enum)Strategy for resolving material (defaults to STATIC). See MaterialResolutionStrategy.STATIC
material_idString (ULID)Primary material reference (nullable; used when material_source=STATIC).01JAP8RJBN-7KQZT6VF-Q5VUZYPW
secondary_material_idString (ULID)Secondary material reference (nullable; used in dual-lot operations).01JAP8RJBN-7KQZT6VF-Q5VUZYPW
material_expressionString (Expression)Expression returning a material id/path (nullable; used when material_source=EXPRESSION).{[default]Material/Expr}
primary_lot_resolution_strategyString (Enum)Lot code strategy for primary lot (defaults to AUTO_GENERATE). See LotResolutionStrategy.AUTO_GENERATE
secondary_lot_resolution_strategyString (Enum)Lot code strategy for secondary lot (defaults to AUTO_GENERATE). See LotResolutionStrategy.AUTO_GENERATE
primary_lot_code_expressionString (Expression)Expression for primary lot code (nullable; used when primary strategy is EXPRESSION).{[default]Lot/Primary}
secondary_lot_code_expressionString (Expression)Expression for secondary lot code (nullable; used when secondary strategy is EXPRESSION).{[default]Lot/Secondary}
create_lot_if_not_foundBooleanWhether to create a lot if not found (defaults to false; only used when operation_type=CONSUME).false
inventory_name_resolution_strategyString (Enum)Strategy for inventory name (defaults to STATIC). See InventoryNameResolutionStrategy.STATIC
inventory_nameStringStatic inventory name (nullable; used when name resolution strategy is STATIC).Inventory1
inventory_name_expressionString (Expression)Expression for inventory name (nullable; used when name strategy is EXPRESSION).{[default]Inventory/Name}
quantity_sourceString (Enum)Quantity resolution strategy (defaults to EXPRESSION). See QuantitySource.EXPRESSION
quantity_expressionString (Expression)Expression returning quantity (nullable; required when quantity_source=EXPRESSION).{[default]Quantity/Expr}
quantity_calc_typeString (Enum)Calculation type (defaults to DELTA). See CountCalcType.DELTA
quantity_overflow_valueDoubleOverflow / rollover threshold (nullable; used with rising counters + DELTA).100.0
unit_of_measure_idString (ULID)UnitOfMeasure reference (nullable when resolution strategy derives from context).01JAP8RJBN-7KQZT6VF-Q5VUZYPW
unit_of_measure_resolution_strategyString (Enum)Strategy for resolving unit of measure (defaults to STATIC). See UnitOfMeasureResolutionStrategy.STATIC
reason_code_idString (ULID)MaterialReasonCode reference (nullable).01JAP8RJBN-7KQZT6VF-Q5VUZYPW
increment_production_order_countBooleanWhether to increment production order count when producing/shipping (defaults to false).false

Field Details

name

A descriptive identifier for the inventory operation.

status

Default: IDLE. Values (from Status enum): IDLE, RUNNING, COMPLETED, FAULTED, CANCELLED, UNKNOWN, PAUSED.

current_record_id

References the active InventoryLotRecord (if the operation is currently RUNNING). On gateway restart this can be used to resume state. Relationship is a one‑to‑one with InventoryLotRecord.currentRecord owning side on the inventory_operations table.

operation_type

Implemented values (current enum constants):

  • CONSUME
  • UNCONSUME
  • PRODUCE
  • SCRAP
  • SCRAP_ALL
  • RETURN
  • RECEIVE
  • RECEIVE_AND_CONSUME
  • SHIP

(Planned but NOT currently implemented in code: MOVE, SPLIT, MERGE, STATUS_CHANGE, EDIT).

trigger_source

Uses TriggerEvaluationStrategy: EXPRESSION, MANUAL, PARENT (default: EXPRESSION). Determines how start/stop expressions are evaluated.

start_trigger_expression / stop_trigger_expression

Expressions (Ignition / gateway expression language) evaluated to detect trigger edges. Nullable unless trigger_source=EXPRESSION.

start_trigger_type / stop_trigger_type

Values from TriggerType: RISING_EDGE, FALLING_EDGE, CHANGE. Defaults: start=RISING_EDGE, stop=FALLING_EDGE.

material_source

Uses MaterialResolutionStrategy enum: STATIC (default), EXPRESSION, PARENT.

material_expression

Required if material_source=EXPRESSION. Must resolve to a valid material identifier or path.

Lot Resolution Strategies

primary_lot_resolution_strategy / secondary_lot_resolution_strategy ( LotResolutionStrategy ):

  • AUTO_GENERATE (default)
  • EXPRESSION
  • MANUAL

create_lot_if_not_found

Applies only when operation_type=CONSUME. If true, creates a new lot when a referenced lot code does not exist.

Inventory Name Resolution

InventoryNameResolutionStrategy values:

  • STATIC (default)
  • EXPRESSION
  • MANUAL
  • AUTO_GENERATE

Quantity Resolution

quantity_source (QuantitySource): EXPRESSION (default), MANUAL.

quantity_calc_type (CountCalcType):

  • DELTA (default) – difference between successive readings.
  • DIRECT – direct reading used as-is.

quantity_overflow_value: Rollover threshold for rising counters when using DELTA.

Unit of Measure Resolution

unit_of_measure_resolution_strategy (UnitOfMeasureResolutionStrategy): STATIC (default), FROM_CONTEXT. If FROM_CONTEXT, the unit may be inferred from a production order, material, or existing lot.

Production Order Integration

increment_production_order_count (default false): when producing or shipping, increments the associated production order quantity.

Reason Code

reason_code_id allows associating contextual reasons (scrap, adjustments, etc.) using a MaterialReasonCode.

Defaults Summary

  • status: IDLE
  • operation_type: CONSUME
  • trigger_source: EXPRESSION
  • start_trigger_type: RISING_EDGE
  • stop_trigger_type: FALLING_EDGE
  • material_source: STATIC
  • primary_lot_resolution_strategy: AUTO_GENERATE
  • secondary_lot_resolution_strategy: AUTO_GENERATE
  • create_lot_if_not_found: false
  • inventory_name_resolution_strategy: STATIC
  • quantity_source: EXPRESSION
  • quantity_calc_type: DELTA
  • increment_production_order_count: false

This document has been updated to align with the current Java entity implementation (including implemented enum values, defaults, and strategy enum names). Previously referenced unimplemented operation types and mismatched enum names (e.g. TriggerSource vs TriggerEvaluationStrategy, QuantityCalcType vs CountCalcType) have been corrected.