system.mes.batch.queue.getParameterValue(batchQueueEntry, path)

Sepasoft MES Module Suite

system.mes.batch.queue.getParameterValue(batchQueueEntry, batchId, path)

Reads the current value of a batch control recipe parameter for a queue entry, identified either by a BatchQueueEntry or by batch ID. When the batch execution controller is active and the entry is loaded, the value comes from live execution state; otherwise it is read from persisted control logic on the gateway. Warning against calling this in a tight loop for performance reasons.

Note

In version 3.81.12 SP2 and later:

  • Updated to not require a Batch to be running to get the value of a parameter.
    • For parameters that have a Calculation Expression, if the Batch is not active, the last calculated value will be returned, if present, otherwise the Calculation Expression is returned.

  • Can accept either a batchQueueEntry or a BatchID.

Syntax

Python
system.mes.batch.queue.getParameterValue(batchQueueEntry, path)
system.mes.batch.queue.getParameterValue(batchID, path)

Parameters

Parameter

Type

Required

Description

batchQueueEntry

BatchQueueEntry

Required (one overload)

The queue entry whose parameter should be read. Must refer to an entry present on the gateway batch queue.

batchID

String

Required (one overload)

The batch ID string; the gateway resolves it to a BatchQueueEntry. Must not be blank.

path

String

Required

Full parameter path in batch path notation (procedure, unit procedure, operation, step, and parameter). See Location / Paths.

Return Value

Type

Description

Object

The parameter’s configured datatype (raw, not necessarily human-readable). For parameters with a calculation when the controller is not active and the entry is not loaded: returns the stored calculated value if present, otherwise the calculation expression string.

Location / Paths

Paths follow the /Procedure/Unit_Procedure/Operation:Step.Parameter pattern.

The procedure segment may be abbreviated as {}

For example:

/{}.Parameter

/{}:Step.Parameter, /{}/Unit_Procedure.Parameter

/{}/Unit_Procedure:Step.Parameter

/{}/Unit_Procedure/Operation.Parameter

/{}/Unit_Procedure/Operation:Step.Parameter)

The path must be a valid parameter path; invalid paths cause an IllegalArgumentException.

Scope / Availability

  • Registered on system.mes.batch.queue (Sepasoft Batch / MES).

  • Gateway: Executes locally against the batch execution manager.

  • Designer / Client: BatchClientQueueScript delegates to the production RPC proxy (same behavior against the connected gateway).

Excluded / Edge Cases

  • MES runtime — checkMESSystemStarted() runs first; if the MES system is not started, the call fails.

  • Missing queue entry — BatchQueueEntry is null → IllegalArgumentException. batchID blank → IllegalArgumentException. Unknown batch ID → BatchQueueEntryNotFoundException. Entry not on the gateway queue (control recipe UUID not found) → BatchQueueEntryNotFoundException.

  • Invalid parameter path — Not a valid parameter path → IllegalArgumentException with the path in the message.

  • Idle vs running — If the queue entry is not loaded or the execution controller is not active, values are read from BatchControlLogic via the control recipe (including calculated-parameter behavior above). If the controller is active and the entry is loaded, the value is resolved through friendlyPathToUUIDPath and the active batchExecutionController (live execution semantics).

  • Polling — Repeated continuous reads are discouraged for performance (see bundled script description).

Example Usage

Minimal example

Python
entry = system.mes.batch.queue.getEntry("BATCH-001")
temp = system.mes.batch.queue.getParameterValue(entry, "/{}/MyUnitProc:Heat.Phase.Temperature")

Complex example

Python
batchID = "BATCH-2026-0142"
statePath = "/{}:Mixing.State"  # friendly names must match the control recipe

try:
	rawState = system.mes.batch.queue.getParameterValue(batchID, statePath)
	displayState = system.mes.batch.queue.getParameterValueAsString(batchID, statePath)
	system.util.getLogger("BatchMonitor").info(
		"Batch %s state raw=%r display=%s" % (batchID, rawState, displayState)
	)
except Exception, ex:
	system.util.getLogger("BatchMonitor").error("Failed to read state: %s" % ex)

Related Functions

Sepasoft MES Module Suite