Sepasoft MES Module Suite
getBatchCommandSignatureTemplate(commandName)
Returns the built-in MES signature template used to authorize a specific batch queue command (for example Start or Hold). Templates are stored under fixed names such as batchStartAuthorization. The commandName argument is resolved to a batch command type using a case-insensitive match on the command’s friendly name; if no template exists for that resolution, the function returns None.
Syntax
Python |
system.mes.signature.getBatchCommandSignatureTemplate(commandName) |
Parameters
Parameter | Type | Required | Description |
|---|---|---|---|
commandName | String | Required | Batch command friendly name to resolve. Recognized values (any casing): Start, Pause, Resume, Hold, Restart, Stop, Reset, Abort, None. |
Return Value
Type | Description |
|---|---|
MESSignatureTemplate | The loaded built-in template for the resolved batch command (for example the template named batchStartAuthorization for Start). |
None | Returned when no signature template object exists for the resolved name (for example unknown text maps internally to None and there is no built-in batchNoneAuthorization template), or when the backing object is not found. |
Scope / Availability
Registered on the system.mes.signature script module.
Gateway: Executes on the runtime gateway.
Designer / Client: Same API; calls are sent to the connected gateway via RPC.
Excluded / Edge Cases
Unknown or mistyped commandName: Resolution uses valueOfByFriendlyName-style matching; strings that do not match a known friendly name are treated like None, which does not have a built-in authorization template—so the result is typically None rather than an error.
None command: The None batch command type has no created built-in signature template in normal installs; calling with "None" (or an unrecognized string) therefore usually yields None.
User-defined names: This function is not for arbitrary template names; use system.mes.signature.getSignatureTemplate(name) to load a template by its MES object name.
Exceptions: The signature declares throws Exception; failures other than “object not found” for the batch template lookup may propagate from the gateway/RPC layer.
Example Usage
Minimal Example
Python |
template = system.mes.signature.getBatchCommandSignatureTemplate("Start") if template is not None: print template.getName() |
Complex Example
Python |
command = "Hold" template = system.mes.signature.getBatchCommandSignatureTemplate(command) if template is None: system.util.getLogger("BatchAuth").warn("No built-in signature template for command: " + command) else: system.util.getLogger("BatchAuth").info( "Batch command %s uses template %s (force=%s)" % (command, template.getName(), template.isForce()) ) |
Related Functions
system.mes.signature.getSignatureTemplate(name) — Loads a signature template by MES name (user or built-in), not specifically by batch command friendly name.
system.mes.signature.saveSignatureTemplate(signatureTemplate) — Saves changes to a template (built-in batch templates are internal; avoid removing or misusing them).
system.mes.signature.createSignatureTemplate(name) — Creates a new unsaved user-owned template.
system.mes.signature.getSignatureTemplateList(pageNo, pageSize, searchPattern) — Lists templates when browsing or selecting by link.
Sepasoft MES Module Suite