system.mes.getSignatureTemplate(name)

Sepasoft MES Module Suite

getSignatureTemplate(...)

Loads and returns an existing MESSignatureTemplate by its MES object name. The lookup uses an exact name match, ignoring case, and works for both user-defined templates and built-in batch command templates (for example batchStartAuthorization). If no template with the given name exists, an MESObjectNotFoundException is raised.

Syntax

Python
system.mes.signature.getSignatureTemplate(name)

Parameters

Parameter

Type

Required

Description

name

String

Required

The name of the signature template to load. Matching is case-insensitive.

Returns

Type

Description

MESSignatureTemplate

The fully loaded signature template object identified by the supplied name. Use the returned object to read or modify properties (for example getExpression(), getTimeout(), getForce(), isForceUniqueUser()) and pass to system.mes.signature.saveSignatureTemplate if you need to persist changes.

Scope

  • 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

  • Not found: If no signature template matches the supplied name, an MESObjectNotFoundException is raised with a message such as "A signature template with the name (<name>) was not found". Wrap the call in a try / except block when the existence of the template is not guaranteed, or check first with system.mes.signature.isSignatureNameExists(name).

  • No wildcard matching: name is not a search pattern. Use system.mes.signature.getSignatureTemplateLinkList(pageNo, pageSize, searchPattern) or getSignatureTemplateList(pageNo, pageSize, searchPattern) when you need * / ? wildcard filtering.

  • Feature support: If authentication challenge / signature features are not supported on the connected Ignition version, an UnsupportedOperationException is raised.

  • Built-in batch command templates: This function can return built-in templates (for example batchStartAuthorization) by their stored name, but the preferred way to fetch a template tied to a batch queue command is system.mes.signature.getBatchCommandSignatureTemplate(commandName), which resolves by command friendly name.

  • Distributed / Task Routing: The underlying RPC call is routed to the runtime server. In task-routed setups, the call resolves against the runtime gateway's signature templates.

Example Usage

Minimal Example

Python
template = system.mes.signature.getSignatureTemplate("Operator Approval")
print template.getName()

Complex Example

Python
templateName = "Line Clearance Sign-off"

if not system.mes.signature.isSignatureNameExists(templateName):
	system.util.getLogger("SignatureLookup").warn(
		"Signature template not configured: " + templateName
	)
else:
	try:
		template = system.mes.signature.getSignatureTemplate(templateName)

		template.setTimeout(5)
		template.setForce(True)
		template.setExpression("{role:Operator} OR {role:Supervisor}")

		saved = system.mes.signature.saveSignatureTemplate(template)

		system.util.getLogger("SignatureLookup").info(
			"Updated template %s (timeout=%d, force=%s)"
			% (saved.getName(), saved.getTimeout(), saved.getForce())
		)
	except Exception, e:
		system.util.getLogger("SignatureLookup").error(
			"Failed to load or update template %s: %s" % (templateName, str(e))
		)

Related Functions

  • system.mes.signature.getBatchCommandSignatureTemplate(commandName) — Returns the built-in signature template for a specific batch queue command (for example Start, Hold).

  • system.mes.signature.isSignatureNameExists(name) — Returns whether a template with the given name exists; useful for guarding against MESObjectNotFoundException.

  • system.mes.signature.createSignatureTemplate(name) — Creates a new unsaved signature template.

  • system.mes.signature.copySignatureTemplate(mesObjectLink) — Creates a new unsaved template by copying an existing one.

  • system.mes.signature.saveSignatureTemplate(signatureTemplate) — Validates and saves changes to a signature template.

  • system.mes.signature.removeSignatureTemplate(mesObjectLink) — Disables and removes a user-created signature template.

  • system.mes.signature.getSignatureTemplateLinkList(pageNo, pageSize, searchPattern) — Returns paginated, optionally filtered links to signature templates for browsing or selection.

  • system.mes.signature.getSignatureTemplateList(pageNo, pageSize, searchPattern) — Returns paginated, optionally filtered signature template objects.

Sepasoft MES Module Suite