Sepasoft MES Module Suite
queue.MODE_SEMI_AUTO()
Overview
Returns the canonical string token for Semi-Auto batch logic run mode. Pass this value to setMode (or compare against mode values from batch UI / parameters) instead of hard-coding "Semi-Auto" so scripts stay aligned with the batch runtime’s mode vocabulary. Semi-Auto is a middle mode between Auto and Manual: recipe phases and steps still execute automatically when reached, but transition steps do not auto-fire when their expressions evaluate to true—an operator or script must explicitly advance them (for example with skipTransition).
Syntax
Python |
system.mes.batch.queue.MODE_SEMI_AUTO() |
Return Value
Type | Description |
|---|---|
String | The friendly run-mode name "Semi-Auto" (from BatchModeTypes.SEMI_AUTO). The gateway resolves modes with case-insensitive friendly-name matching. |
Scope / Availability
Registered on the system.mes.batch.queue script module (Sepasoft Batch / MES).
Gateway: Available where the batch queue script module is hosted.
Designer / Client: Same API; behavior matches other system.mes.batch.queue.* calls (RPC to the gateway that owns the queue / batch, including Enterprise routing where applicable).
Excluded / Edge Cases
This function only returns the mode string; it does not change batch state. Apply the value with setMode on a Procedure, Unit Procedure, or Operation path (not an individual step path).
Prefer MODE_SEMI_AUTO() over the literal "Semi-Auto" so scripts follow the supported constant pattern documented for the mode parameter on setMode.
setMode accepts only Procedure, Unit Procedure, or Operation paths—not step or parameter paths. If path is omitted, the procedure root (/{}) is used.
The queue entry must be active (its execution controller loaded on the gateway) when calling setMode. An unrecognized mode string raises IllegalArgumentException.
In Semi-Auto mode, transition expressions are still evaluated, but the transition does not pass automatically unless it is explicitly skipped (for example via skipTransition or the Batch Recipe Monitor UI). This matches Manual transition behavior and differs from Auto mode.
Semi-Auto does not satisfy manual-only APIs. Functions such as executeStep, changeActiveStep, and getValidNextSteps require the parent logic (or step, for executeStep) to be in Manual mode (MODE_MANUAL()).
Whether Semi-Auto mode can be set, and how it propagates to child or parent logic, depends on recipe configuration (for example Propagate Mode To Children / Propagate Mode To Parent) and whether the queue entry’s control logic is active.
Example Usage
Minimal example
Python |
mode = system.mes.batch.queue.MODE_SEMI_AUTO() |
Complex example
Switch a running batch from automatic transition handling to semi-automatic control, then advance a transition when an external condition is met:
Python |
batchId = "BATCH-2026-0042" entry = system.mes.batch.queue.getEntry(batchId) # Hold transitions for operator/script approval while phases keep running system.mes.batch.queue.setMode( entry, system.mes.batch.queue.MODE_SEMI_AUTO(), path="/{}/Mix_Unit_Procedure", changedBy="batchScript" ) # Advance when QC release tag is true (expression alone will not fire in Semi-Auto) if system.tag.read("[default]QC/Release").value: system.mes.batch.queue.skipTransition( entry, "/{}/Mix_Unit_Procedure/Mix_Op:Next_Step", changedBy="batchScript" ) |
Related Functions
system.mes.batch.queue.setMode(batchQueueEntryOrBatchID, mode, path, changedBy) — Sets run mode for Procedure, Unit Procedure, or Operation logic; use MODE_SEMI_AUTO() for the mode argument.
system.mes.batch.queue.MODE_AUTO() — Returns "Auto"; transitions auto-fire when expressions evaluate to true.
system.mes.batch.queue.MODE_MANUAL() — Returns "Manual"; required for executeStep, changeActiveStep, and other manual execution workflows.
system.mes.batch.queue.skipTransition(batchQueueEntryOrBatchID, path, changedBy) — Forces a transition to pass when logic is in Semi-Auto or Manual mode.
system.mes.batch.queue.getParameterValue(batchQueueEntryOrBatchID, path) — Read the Mode parameter on logic or steps for display or conditional script logic.
Sepasoft MES Module Suite