Sepasoft MES Module Suite
completeDocumentStep(...)
Completes an active Document phase step in a running batch by sending a complete-step notification to the step at the given path. The batch engine treats this like a user completing the document: the phase’s Complete parameter is set to true and the phase can finish according to its configured logic.
Syntax
Python |
system.mes.batch.queue.completeDocumentStep(batchQueueEntry, path) |
Parameters
Parameter | Type | Required | Description |
|---|---|---|---|
batchQueueEntry | BatchQueueEntry object | Required | The queue entry for the batch that owns the Document phase. Must refer to a batch currently present in the gateway queue. |
path | str | Required | Full friendly path to the Document phase step. Must follow /Procedure/Unit_Procedure/Operation:Step. Use {} as a placeholder for the procedure segment when the procedure name is not fixed. |
Example | Meaning |
|---|---|
/{}:StepName | Step StepName at the procedure root |
/{}/Unit_Procedure:StepName | Step under a unit procedure |
/{}/Unit_Procedure/Operation:StepName | Step under an operation |
Returns
Type | Description |
|---|---|
None | No return value. Errors are raised as exceptions. |
Scope
Context | Notes |
|---|---|
Gateway | Implemented on the gateway; runs against the live batch execution controller. |
Client | Exposed as system.mes.batch.queue.completeDocumentStep; calls the gateway over RPC (same behavior, subject to session and module scope). |
Batch Designer | The system.mes.batch.queue module is registered in Batch Designer for authoring; runtime completion applies to executing batches on the gateway. |
Excluded / Edge Cases
The batch queue entry must be running. If it is not loaded in the execution engine or not in a running state, the call fails with an IllegalStateException describing the reason (for example, not running, or not loaded).
If batchQueueEntry is None, an IllegalArgumentException is raised.
If the MES production system has not finished starting, an IllegalStateException is raised: Try request again once the MES system has fully started.
If the control recipe for the entry is not found in the gateway queue, BatchQueueEntryNotFoundException is raised with a message indicating the missing control recipe UUID.
The path must resolve through the batch’s execution controller (friendlyPathToUUIDPath). An invalid or non-matching path can cause resolution or notification handling errors.
This API is intended for Document phases; other step types may not react to the same notification in the same way.
Example Usage
Minimal example
Python |
system.mes.batch.queue.completeDocumentStep(entry, "/{}:SignOff") |
Complex example
Typical pattern: obtain a BatchQueueEntry (for example from queue queries or UI context), then complete a document step by its full path after related parameters or messages are handled.Python |
# entry is a BatchQueueEntry for the running batch docStepPath = "/{}/Weigh_Raw_Materials/Charge_Silo:Operator_Checklist" system.mes.batch.queue.completeDocumentStep(entry, docStepPath) |
If your workflow first collects operator input via a Value Prompt message, acknowledge and assign the value before completing the document step, using the same queue entry.
Related Functions
system.mes.batch.queue.setParameterValue() — Sets a batch parameter on a step by path (used for parameters; different from completing a Document phase).
system.mes.batch.queue.executeStep() — Manually executes a step when manual execution is required.
system.mes.batch.queue.executeStepCommand() — Sends a step command (for example start/stop) with a changed-by identifier.
system.mes.batch.queue.assignMessageValue() — Applies a user-entered value from a BatchMessage (for example Value Prompt) before acknowledging.
system.mes.batch.queue.acknowledgeMessage() — Acknowledges a batch message that requires acknowledgement.
Sepasoft MES Module Suite