system.mes.changelog.MESChangelogFilter

Sepasoft MES Module Suite

MESChangelogFilter Script Object

Overview

MESChangelogFilter is a filter object used to define search constraints for MES changelog queries. Create an instance with system.mes.changelog.createFilter(), configure it using the setter methods below, then pass it to any system.mes.changelog query function. All setter methods can be combined freely; constraints are applied as AND conditions.


Defaults (applied at construction):


Setting

Default

Inclusive range

True

Sort order

Descending

Record limit

None (no limit)

Syntax

# Create a filter

changelogFilter = system.mes.changelog.createFilter()


# Configure it using any combination of setters

changelogFilter.setLimit(100)

changelogFilter.setBeginDate(someDate)


# Pass to a query function

results = system.mes.changelog.getChangeEvents(filter=changelogFilter)





Change Path Methods

setChangePaths

Sets exact change path strings that must match for records to be included.


Parameter

Type

Description

changePaths

String...

One or more exact change path strings to match against.


changelogFilter.setChangePaths("Equipment/Line1/Speed", "Equipment/Line1/Temperature")





setChangePathsLike

Sets change path wildcard patterns that must match for records to be included.


Parameter

Type

Description

changePathsLike

String...

One or more path patterns. Accepts wildcards: * (any sequence) and ? (single character).


changelogFilter.setChangePathsLike("Equipment/Line1/*", "Equipment/Line2/*")





setChangePathsNotLike

Sets change path wildcard patterns that must not match for records to be included.


Parameter

Type

Description

changePathsNotLike

String...

One or more path patterns to exclude. Accepts wildcards: * and ?.


changelogFilter.setChangePathsNotLike("Equipment/*/Debug*")





Change Type Methods

setChangeTypes

Sets the change event type names that will be included when loading change history.


Parameter

Type

Description

changeTypes

String...

One or more change type name strings to match against.


changelogFilter.setChangeTypes("PROPERTY_CHANGED", "OBJECT_CREATED")





Date Range Methods

setBeginDate

Sets the start timestamp cutoff. Only records on or after this date are included (when setInclusiveRange is True).


Parameter

Type

Description

beginDate

Date

The date to start loading history from.


changelogFilter.setBeginDate(system.date.addDays(system.date.now(), -7))





setBeginVersion

Sets the start version cutoff. Only records at or after this version are included (when setInclusiveRange is True).


Parameter

Type

Description

beginVersion

MESObjectVersion

The MESObjectVersion to start loading history from.


changelogFilter.setBeginVersion(someVersion)





setEndDate

Sets the end timestamp cutoff. Only records on or before this date are included (when setInclusiveRange is True).


Parameter

Type

Description

endDate

Date

The date to stop loading history at.


changelogFilter.setEndDate(system.date.now())





setEndVersion

Sets the end version cutoff. Only records at or before this version are included (when setInclusiveRange is True).


Parameter

Type

Description

endVersion

MESObjectVersion

The MESObjectVersion to stop loading history at.


changelogFilter.setEndVersion(someVersion)





setInclusiveRange

Controls whether records that fall exactly on a date or version boundary are included.


Parameter

Type

Default

Description

includeTerminalRanges

Boolean

True

True to include records on the boundary; False to exclude them.


changelogFilter.setInclusiveRange(False)





Format Methods

setDescending

Controls the sort order of returned records.


Parameter

Type

Default

Description

descending

Boolean

True

True to sort newest-first (descending); False to sort oldest-first (ascending).


changelogFilter.setDescending(False)





setLimit

Limits the number of database records queried. Use this to cap large result sets.


Parameter

Type

Default

Description

limit

Integer or None

None

Maximum number of records to return. Pass None for no limit.


changelogFilter.setLimit(500)





Gateway Location Methods

setGatewayLocationUUIDs

Filters records to only those from specific gateway network locations identified by UUID.


Parameter

Type

Description

gatewayLocationUUIDs

String...

One or more gateway network location UUID strings to match against.


changelogFilter.setGatewayLocationUUIDs("uuid-1234", "uuid-5678")





setGatewayLocationNameLike

Filters records to only those from gateway locations whose name matches a pattern.


Parameter

Type

Description

gatewayLocationNameLike

String

A gateway location name pattern. Accepts wildcards: * and ?.


changelogFilter.setGatewayLocationNameLike("Plant1*")





MES Object Methods

setMESObjectNameLike

Filters records to only those associated with MES objects whose name matches a pattern.


Parameter

Type

Description

nameLike

String

An MES object name pattern. Accepts wildcards: * and ?.


changelogFilter.setMESObjectNameLike("Line*")





setMESObjectTypeNames

Filters records to only those associated with the specified MES object type names.


Parameter

Type

Description

mesObjectTypeNames

String...

One or more MESObjectTypes name strings to match against (e.g., "Equipment", "ProductionOrder").


changelogFilter.setMESObjectTypeNames("Equipment", "WorkCenter")





setMESObjectTypes

Filters records to only those associated with the specified MESObjectTypes enum values.


Parameter

Type

Description

mesObjectTypes

MESObjectTypes...

One or more MESObjectTypes enum values to match against.


changelogFilter.setMESObjectTypes(MESObjectTypes.Equipment, MESObjectTypes.WorkCenter)





setMESObjectUUIDs

Filters records to only those associated with the specified MES object UUIDs.


Parameter

Type

Description

mesObjectUUIDs

String...

One or more MES object UUID strings to match against.


changelogFilter.setMESObjectUUIDs("a1b2c3d4-e5f6-7890-abcd-ef1234567890")





User Methods

setPersonNameLike

Filters records to only those where the associated Ignition user's display name (last, first) matches a pattern.


Parameter

Type

Description

personNameLike

String

A user display name pattern in last, first format. Accepts wildcards: * and ?.


changelogFilter.setPersonNameLike("Smith*")





setChangedByNames

Filters records to only those made by the specified Ignition usernames. Use "System" to include automated changes.


Parameter

Type

Description

changedByNames

String...

One or more Ignition username strings to match against.


changelogFilter.setChangedByNames("jsmith", "System")





Value Methods

setNewValues

Filters records to only those where the changed-to value matches one of the specified values.


Parameter

Type

Description

newValues

Object...

One or more values to match against. Pass None to match null new values.


changelogFilter.setNewValues("Active", "Running")





setOldValues

Filters records to only those where the changed-from value matches one of the specified values.


Parameter

Type

Description

oldValues

Object...

One or more values to match against. Pass None to match null old values.


changelogFilter.setOldValues("Idle", None)





Full Example

# Build a filter combining multiple constraints

changelogFilter = system.mes.changelog.createFilter()

changelogFilter.setMESObjectTypeNames("Equipment")

changelogFilter.setChangePathsLike("Equipment/Line1/*")

changelogFilter.setBeginDate(system.date.addDays(system.date.now(), -30))

changelogFilter.setEndDate(system.date.now())

changelogFilter.setChangedByNames("jsmith")

changelogFilter.setDescending(True)

changelogFilter.setLimit(500)


events = system.mes.changelog.getChangeEvents(filter=changelogFilter)

data = system.mes.changelog.getChangelogData(filter=changelogFilter)

objectChanges = system.mes.changelog.getObjectChanges(filter=changelogFilter)

Related Functions

  • createFilter() — Creates a new MESChangelogFilter instance.

  • getChangeEvents() — Queries changelog history using this filter; returns a list of ChangeEventInfoMeta.

  • getChangelogData() — Queries changelog history using this filter; returns an Ignition Dataset.

  • getObjectChanges() — Queries changelog history using this filter; returns a map of object UUIDs to ChangeLog.


Sepasoft MES Module Suite