executeEntryCommandAsync(...)

Sepasoft MES Module Suite

executeEntryCommandAsync(batchQueueEntry, command, changedBy)

Note New function from version 3.81.12 RC2 and later.

Asynchronously execute a batch command for a batch queue entry.

Submits a batch-level command for a BatchQueueEntry (for example Start, Hold, Reset, Abort) on a non-blocking path: the script returns after the request is accepted, and controller work continues on a background executor. This is equivalent to calling executeEntryCommand with blockingCall=False and no timeoutMS on the RPC path. Use system.mes.batch.queue.COMMAND_*() .

Syntax

system.mes.batch.queue.executeEntryCommandAsync(batchQueueEntry, command, changedBy)

Python
system.mes.batch.queue.executeEntryCommandAsync(batchQueueEntry, command)
system.mes.batch.queue.executeEntryCommandAsync(
	batchQueueEntry,
	command,
	changedBy="operator"
)

Parameters

Parameter

Type

Required

Description

batchQueueEntry

BatchQueueEntry

Required

The queue entry to command. Must exist on the gateway’s batch queue.

command

str

Required

Batch command to run. Use system.mes.batch.queue.COMMAND_*() (for example COMMAND_START()).

system.mes.batch.queue.COMMAND_ABORT()

system.mes.batch.queue.COMMAND_HOLD()

system.mes.batch.queue.COMMAND_PAUSE()

system.mes.batch.queue.COMMAND_RESET()

system.mes.batch.queue.COMMAND_RESTART()

system.mes.batch.queue.COMMAND_RESUME()

changedBy

str

Optional

Optional label stored with the change (operator, screen, or script id).

There is no timeoutMS or blockingCall argument; the call is always the asynchronous contract.

Return value

Type

Description

None

Returns nothing when the call completes without throwing. State transitions and shutdown-style waits (where applicable) continue after the function returns.

Scope / Availability

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

  • Gateway: Executes on the gateway that owns the queue entry and process cell.

  • Designer / Client: Same API; calls go through the production RPC layer to the appropriate gateway (including Enterprise routing when entries are tied to equipment on a peer server).

Excluded / Edge Cases

  • Same validation and access rules as executeEntryCommand: unknown command strings raise NoSuchElementException; wrong batch state yields Exception with state-specific messages; Start / Abort remain entry-level (do not use executeStepCommand for them).

  • If electronic signatures are enabled for the command, scripting does not bypass them; the call raises IllegalAccessException with guidance to use the Batch List or Batch Controller Perspective component.

  • If the entry’s process cell is managed by another gateway server, the call raises IllegalAccessException.

  • The gateway must have a process cell and be allowed to run batch execution; otherwise IllegalStateException may apply, consistent with other queue command APIs.

  • Prefer executeEntryCommandBlocking when you need to wait until the command path finishes and to pass timeoutMS for Hold / Reset–style blocking waits. Prefer executeEntryCommand when you want to toggle blockingCall or timeoutMS from one API.

Example Usage

Minimal example

Python
entry = system.mes.batch.queue.getEntry("BATCH-2026-0042")
system.mes.batch.queue.executeEntryCommandAsync(
	entry,
	system.mes.batch.queue.COMMAND_START()
)

Complex example

Python
batch_id = "BATCH-2026-0042"
entry = system.mes.batch.queue.getEntry(batch_id)

# Fire-and-forget hold from an alarm pipeline tag event
system.mes.batch.queue.executeEntryCommandAsync(
	entry,
	system.mes.batch.queue.COMMAND_HOLD(),
	changedBy="alarmPipeline:Line1_Hold"
)

# Non-blocking abort; UI can poll getStatus or subscribe elsewhere
system.mes.batch.queue.executeEntryCommandAsync(
	entry,
	system.mes.batch.queue.COMMAND_ABORT(),
	changedBy="safetyInterlock"
)

Related Functions

Sepasoft MES Module Suite