system.mes.batch.queue.exitCommandLoop()

Sepasoft MES Module Suite

exitCommandLoop()

system.mes.batch.queue.exitCommandLoop() ends the wait that starts after a batch command is sent to a Procedure, Unit Procedure, or Operation. That wait holds the logic until its active child steps reach the command's final state. Calling this function lets that logic move to the expected final state immediately.

Use it when a command such as Hold, Pause, Stop, or Abort has been sent and the parent logic is still waiting. It does not complete the child steps. Use forceStepComplete() when a step itself must be finished.

The batch queue entry must already be loaded.

Syntax

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

Parameters

Parameter

Type

Required

Description

batchQueueEntry

BatchQueueEntry

Required

Queue entry that is waiting. Pass this or batchID.

batchID

String

Required

Batch ID of the queue entry that is waiting. Pass this or batchQueueEntry.

path

String

Optional

Logic path of the Procedure, Unit Procedure, or Operation that is waiting. Omit it to release every active logic in the batch.


path uses /Procedure/Unit_Procedure/Operation. {} stands for the Procedure.


Path

Logic

/{}/

The Procedure

/{}/Charge

Unit Procedure Charge

/{}/Charge/Heat

Operation Heat inside Unit Procedure Charge


A step path such as /{}/Charge:Mix is not valid here. The path identifies the logic that is waiting, not a phase step.

Return Value

Type

Description

None

The wait flag is set. The function does not return the new state.

Scope

Available in Gateway and Client scripts.

Edge Cases

  • The queue entry must be loaded. A call against an entry that is not loaded raises IllegalStateException: Unable to exit command loop because batch queue entry is not loaded.

  • A missing batch ID raises BatchQueueEntryNotFoundException.

  • A path that does not match a logic item raises NoSuchElementException: Logic info could not be found for path (...).

  • A blank or omitted path releases every active logic in the batch.

  • Child steps stay in their current state. Only the waiting parent leaves the command loop and moves to its expected final state.

  • MES must be started. Otherwise the call raises IllegalStateException: Try request again once the MES system has fully started.

Example Usage

Python
# Minimal: release every waiting logic on the batch
bqe = system.mes.batch.queue.getEntry('BATCH-001')
system.mes.batch.queue.exitCommandLoop(bqe)

Python
# Release one Unit Procedure after a Hold that never reached its final state
batchID = 'BATCH-001'
bqe = system.mes.batch.queue.getEntry(batchID)

system.mes.batch.queue.executeEntryCommand(bqe, system.mes.batch.queue.COMMAND_HOLD())
system.mes.batch.queue.exitCommandLoop(bqe, '/{}/Charge')

Python
# The same call with a batch ID
system.mes.batch.queue.exitCommandLoop('BATCH-001', '/{}/Charge/Heat')

Related Functions


Sepasoft MES Module Suite