getExecutedBatchIDs

Sepasoft MES Module Suite

getExecutedBatchIDs(searchString, equipmentFilter, beginDateTime, endDateTime, maxResults)

Returns a list of batch ID strings for batches whose control recipes are in the executed state (finished and no longer on the active queue). Results can be narrowed by partial batch ID text, process cell equipment path (with wildcards), time range on the control recipe timestamp, and a maximum row limit.

Syntax

All arguments are optional and are typically passed as keyword arguments.

Python
system.mes.batch.queue.getExecutedBatchIDs()

system.mes.batch.queue.getExecutedBatchIDs(maxResults=500)

system.mes.batch.queue.getExecutedBatchIDs(
	searchString="LOT-42",
	equipmentFilter="ABC Co\\North Site\\Bld A\\Processing *",
	beginDateTime=system.date.now(),
	endDateTime=system.date.now(),
	maxResults=100
)

Parameters

Parameter

Type

Required

Default

Description

searchString

String

Optional



When non-blank, only batch IDs containing this substring are returned (SQL LIKE with % around the term). Omit or pass blank to apply no text filter.

equipmentFilter

String

Optional

When non-blank, restricts results to batches whose process cell matches this equipment path. Use the usual hierarchy: Enterprise\Site\Area\Process Cell. Wildcards: * → SQL %, ? → SQL _. Example: ABC Co\North Site\Bld A\Processing *.

beginDateTime

Date

Optional

When set, only batches whose control recipe timestamp is greater than or equal to this value are included.

endDateTime

Date

Optional

When set, only batches whose control recipe timestamp is less than or equal to this value are included.

maxResults

Integer

Optional

100

Maximum number of batch IDs returned. If zero or negative, the implementation still applies an effective cap of 100.

Return Value

Type

Description

List of String

Batch ID strings for matching executed control recipes, ordered by batch ID. Returns an empty list if the query yields no rows or the dataset is unavailable.

Scope / Availability

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

  • Gateway — BatchGatewayQueueScript: runs against the gateway’s batch execution / analysis data path.

  • Designer and Vision client — BatchClientQueueScript: same API; calls are forwarded to the gateway via the production RPC layer (behavior follows your Enterprise / task-routing configuration for runtime vs. analysis).

Excluded / Edge Cases

  • Only batches in the executed execution state appear; active or queued batches are not listed here (use getEntries / getEntry for the queue).

  • searchString and equipmentFilter conditions are skipped when blank or whitespace-only.

  • beginDateTime / endDateTime filters are skipped when None.

  • Historical data is read from the analysis database context on the gateway; ensure analysis routing and datasources are configured for your deployment if results are empty unexpectedly.

Example Usage

Minimal example

Python
ids = system.mes.batch.queue.getExecutedBatchIDs()

Complex example

Fetch a capped list with path and ID filters, then narrow in Jython if you need extra rules the SQL layer does not express.

Python
ids = system.mes.batch.queue.getExecutedBatchIDs(
	searchString="MIX",
	equipmentFilter="MyEnterprise\\MySite\\Area1\\Reactor *",
	maxResults=250
)

prefix_only = [bid for bid in ids if bid.startswith("P-")]

for batch_id in prefix_only:
	system.util.getLogger("BatchAudit").info("Executed batch: %s" % batch_id)

To bound by time, pass beginDateTime and endDateTime as Date values produced by your Perspective or Vision date components, tag reads, or other system.mes.batch.queue / platform date helpers your project already uses.

Related Functions

  • getEntries() — Paged list of active batch queue entries (not historical executed IDs).

  • getEntryLinks() — Paged MESObjectLink list for queue entries.

  • getEntry() — Returns a BatchQueueEntry for a batch ID still on the queue.

  • getStatus() — Status string for a batch (queue or executed path depending on context).

  • addEntry() — Creates a new queue entry from a master recipe or formula link.

Sepasoft MES Module Suite