MESChangelogFilter

Sepasoft MES Module Suite

MESChangelogFilter

A filter object with default settings: inclusive range, descending sort, no record limit.

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.

Setting

Default

Inclusive range

True

Sort order

Descending

Record limit

None (no limit)

Syntax

Python
# 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)

MESChangelogFilter methods

These run on the object from createFilter(). A new filter includes the begin and end dates (setInclusiveRange(True)), sorts newest first (setDescending(True)), has no row limit, and does not show historical names. * and ? are wildcards on the pattern methods.

Method

-see links below table

Description
setChangePaths(changePaths)
Include these exact property paths.
setChangePathsLike(changePathsLike)
Include paths that match these patterns.
setChangePathsNotLike(changePathsNotLike)
Exclude paths that match these patterns.
setChangeTypes(changeTypes)
Include these change-type names.
setBeginDate(beginDate)
Start of the date range.
setEndDate(endDate)
End of the date range.
setBeginVersion(beginVersion)
Start at this MESObjectVersion.
setEndVersion(endVersion)
Stop at this MESObjectVersion.
setInclusiveRange(includeTerminalRanges)
True includes changes on the begin and end dates or versions. Default is True.
setDescending(descending)
True sorts newest first. Default is True.
setLimit(limit)
Maximum number of records to query. None means no limit.
setGatewayLocationUUIDs(gatewayLocationUUIDs)
Include these gateway location UUIDs.
setGatewayLocationNameLike(gatewayLocationNameLike)
Include locations whose names match this pattern.
setMESObjectNameLike(nameLike)
Include objects whose current names match this pattern.
setMESObjectUUIDs(mesObjectUUIDs)
Include these object UUIDs.
setMESObjectTypeNames(mesObjectTypeNames)
Include these MES object type names.
setMESObjectTypes(mesObjectTypes)
Include these MESObjectTypes values.
setPersonNameLike(personNameLike)
Include changes by a person name in last, first form.
setChangedByNames(changedByNames)
Include these Ignition usernames. Automated changes use System.
setOldValues(oldValues)
Include changes from these old values.
setNewValues(newValues)
Include changes to these new values.
showHistoricalNames(show)

True adds Historical Name to getChangelogData() and fills getHistoricalName() on getChangeEvents(). Default is False. MES 3.81.13 SP3, MES 4.83.3 SP3 and later.

Object Methods:



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.


Python
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).


Python
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 ?.


Python
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.

Python
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.


Python
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.


Python
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.


Python
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.


Python
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.


Python
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).


Python
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.


Python
changelogFilter.setLimit(500)


showHistoricalNames

Displays the name of each MES object at the time of the change. Available in MES 3.81.13 SP3 and MES 4.83.3 SP3 and later.

ParameterTypeDefaultDescription
show
Boolean
False
True loads the name in effect when each change was saved.

False leaves the result unchanged. getChangelogData() omits the Historical Name column.

True adds Historical Name immediately after MES Object Name on getChangelogData(). MES Object Name is the object's current name. Historical Name is the name at the time of that row. getChangeEvents() fills getHistoricalName() with that same historical name.

The gateway looks up Name property changes for the objects in the result. That lookup still runs when the filter leaves name-change rows out of the result. For each row, the latest name at or before that row is used. When no earlier name change exists, Historical Name is the current name.

Python
changelogFilter.showHistoricalNames(True)


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.


Python
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 ?.


Python
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 ?.


Python
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").


Python
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.


Python
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.


Python
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 ?.


Python
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.


Python
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.


Python
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.


Python
changelogFilter.setOldValues("Idle", None)




Full Example

Python
# 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)
changelogFilter.showHistoricalNames(True)

events = system.mes.changelog.getChangeEvents(filter=changelogFilter)
data = system.mes.changelog.getChangelogData(filter=changelogFilter)
objectChanges = system.mes.changelog.getObjectChanges(filter=changelogFilter)


Sepasoft MES Module Suite