MES Object Filter

Sepasoft MES Module Suite

MESObjectFilter

The MESObjectFilter object defines what types of MES objects to return by using scripting and object functions.

Inherits properties, events and functions from:

Create MESObjectFilter

The system.mes.object.filter.createFilter function can be used to create this type of object.

Return MESObjectFilter

The following scripting functions use this object.

Object Functions

This object provides the following functions:


 

getCustomPropertyNamePattern()

Description

Get the custom property name pattern used to filter the results. 

Syntax

getCustomPropertyNamePattern()

  • Parameters

None

  • Returns

String The custom property name pattern.

 

getCustomPropertyValueFilter()

Description

Get the list of MESPropertyValueFilter used to filter the results.

Syntax

getCustomPropertyValueFilter()

  • Parameters

None

  • Returns

List of MESPropertyValueFilter - The custom property value list.

 getEnabledStateName()

Description

Get the enable state to filter the results.

Syntax

getEnabledStateName()

  • Parameters

 None

  • Returns

String name - The name of the enable state.

 getExcludedEquipmentPathList()

Description

Gets the list of equipment paths that are excluded.

Syntax

getExcludedEquipmentPathList()

  • Parameters

 None

  • Returns

List<String> pathList - The list of equipment paths that are excluded.

 getMESObjectNamePattern()

Description

Get the MES object name pattern used to filter the results.

Syntax

getMESObjectNamePattern()

  • Parameters

None

  • Returns

StringThe MES object name pattern.

 

getMESObjectTypeName()

Description

Return the list of names of the MES object types the filter is set for.

Syntax

getMESObjectTypeName()

  • Parameters

 None

  • Returns

List The list of names of MES object types the filter is set for.

 

getMesObjectTypes()

Description

Gets the list of MES object types associated with this object filter.

Syntax

getMesObjectTypes()

  • Parameters

None

  • Returns

MESObjectTypes - A list of mes object types associated with this filter.

  • Scope

All

 

getMESObjectUUIDList()

Description

Returns a list of MES object UUIDs to return in the results.

Syntax

getMESObjectUUIDList()

  • Parameters

 None

  • Returns

List of String - A list of MES object UUIDs.

Code Snippet
filter=system.mes.object.filter.createFilter()
 
#Gets the list of uuid.
list=filter.getMESObjectUUIDList()
 
Addind another item to the list.
list.add('5253ccae-47b4-4dc2-954f-900ffa8636eb')

 getPrimaryClassFilter()

Description

Gets the primary class (parent class) filter that has been set.

Syntax

getPrimaryClassFilter()

  • Parameters

None

  • Returns

The primary class filter which was previously defined to filter the results.

 

getPrimaryMESObjectPath()

Description

Gets the primary (parent) MES object path that was set to filter the results.

Syntax

getPrimaryMESObjectPath()

  • Parameters

None

  • Returns

The primary MES object path to filter the results.

 

getPrimaryMESObjectUUID()

Description

Get the UUID of the primary (parent) MES object to include in the results.

Syntax

getPrimaryMESObjectUUID()

  • Parameters

None

  • Returns

String The primary MES object UUID.

 

hasCustomPropertyNamePattern()

Description

Checks for the existence of a custom property name pattern.

Syntax

hasCustomPropertyNamePattern()

  • Parameters

None

  • Returns

boolean - True, if there exist a custom property name pattern and False otherwise.

  • Scope

All

 

hasCustomPropertyValueFilter()

Description

Checks if there is a custom property value to filter the results.

Syntax

hasCustomPropertyValueFilter()

  • Parameters

None

  • Returns

boolean - True, if there exist a custom property value filter and False otherwise.

  • Scope

All

 

hasMESObjectNamePattern()

Description

Checks if there is an MES object name pattern to filter the results.

Syntax

hasMESObjectNamePattern()

  • Parameters

None

  • Returns

boolean - True, if there exist an MES object name pattern and False otherwise.

  • Scope

All

 

hasMESObjectTypes()

Description

Checks whether there is any MES object type name to filter the results.

Syntax

hasMESObjectTypes()

  • Parameters

None

  • Returns

boolean - True, if there exist any MES object type defined to filter the results and False otherwise.

  • Scope

All

 

hasMESObjectUUIDs()

Description

Checks if there is MES object uuids to filter the results.

Syntax

hasMESObjectUUIDs()

  • Parameters

None

  • Returns

boolean - True, if there exist some uuids to filter the results.

 

hasPrimaryClassFilter()

Description

Checks if there is any primary class (parent class) filter associated with this MES object filter.

Syntax

hasPrimaryClassFilter()

  • Parameters

None

  • Returns

boolean - True, if there exist a primary class filter and False otherwise.

 

hasPrimaryMESObjectPath()

Description

Checks whether there is a primary (parent) MES object path to filter the results.

Syntax

hasPrimaryMESObjectPath()

  • Parameters

None

  • Returns

boolean - True, if there exist a primary MES object path and False otherwise.

 

hasPrimaryMESObjectUUID()

Description

Checks for the existence of primary (parent) MES object uuid to filter the results.

Syntax

hasPrimaryMESObjectUUID()

  • Parameters

None

  • Returns

boolean - True, if there exist a primary (parent) MES object uuid and False otherwise.

 

isExcludeInactiveEquipment()

Description

Use this function to verify if inactive equipment is set to be excluded when filtering.

Included in Sepasoft Versions:

MES 3.81.1 SP6 and later
MES 3.79.0 SP6 and later

Syntax

isExcludeInactiveEquipment()

  • Parameters 

No Parameters

  • Returns

Boolean: Returns True if inactive equipment is set to be excluded when filter is used

 isIncludeRelated()

Description

The results can be limited to only include the related items that is defined by this property that evaluates to true.

Syntax

isIncludeRelated()

  • Parameters

None

  • Returns

boolean - True if the MES object include related items and False otherwise.

 

isShowEquipmentPath()

Description

Checks whether the ShowEquipmentPath property is set to True.

Syntax

isShowEquipmentPath()

  • Parameters

None

  • Returns

boolean - True if the ShowEquipmentPath property is set to True and False otherwise.

 

setCustomPropertyNamePattern(customPropertyNamePattern)

Description

Set the custom property name pattern to filter the results. If a MES object contains a custom property that matches the custom property name pattern, then it will be included in the results.

Syntax

setCustomPropertyNamePattern(customPropertyNamePattern)

  • Parameters

String customPropertyNamePattern - The custom property name pattern used to filter the results.

  • Returns

Nothing

Code Examples
Code Snippet
1
2
filter=system.mes.object.filter.createFilter()
filter.setCustomPropertyNamePattern('Type')
 

setCustomPropertyValueFilter(customPropertyValueFilter)

Description

Set the custom property filter expressions to filter the results. Multiple expressions can be included by separating them with commas. When this is done, all sub expressions must match for the overall expression to evaluate to true. Use system.mes.object.filter.parseCustomPropertyValueFilter() script function to create the list of MESPropertyValueFilter objects.

Syntax

setCustomPropertyValueFilter(customPropertyValueFilter)

  • Parameters

List of MES Property Value Filter customPropertyValueFilter - The custom property value list to filter the results.

  • Returns

Nothing

Code Examples
Code Snippet
1
2
3
4
5
6
#Create a filter.
filter=system.mes.object.filter.createFilter()
  
#Parses the expression and returns a list of MESPropertyValueFilter objects that are used in filters.
list=system.mes.object.filter.parseCustomPropertyValueFilter('pH > 5.0,Width = 2.5')
filter.setCustomPropertyValueFilter(list)
Code Example
Code Snippet
1
2
3
4
5
6
7
filter=system.mes.object.filter.createFilter()
list=system.mes.object.filter.parseCustomPropertyValueFilter('Item Number=A12SIK')
filter.setCustomPropertyValueFilter(list)
list=system.mes.searchMESObjects(filter)
forndx inrange(list.size()):
    mesObject =list.get(ndx)
    printmesObject.getName()
Output
84001

 setEnableStateName(name)

Description

Set the enable state to filter the results. 

Options:
Disabled
Enabled
Both


Default Behavior

Defaults to 'Enabled' state if this method is not set.

Syntax

setEnableStateName(name)

  • Parameters

String name - The name of the enable state.

  • Returns

Nothing

Code Examples
Code Snippet
1
2
3
#Here's how to set the enable state.
filter=system.mes.object.filter.createFilter()
filter.setEnableStateName('Disabled')

 setExcludedEquipmentPathList(excludeString)

Description

Sets the list of equipment paths to exclude from the result string.  This is NOT a filter on equipment, rather a string which is trimmed from any equipment paths in the results.

Syntax

setExcludedEquipmentPathList(excludeString)

  • Parameters

String excludeString - A string with equipment paths to be excluded, separated by commas.separated by commas.

  • Returns

Nothing

 

setExcludedEquipmentPathList(excludeList)

Description

Sets the list of equipment paths to exclude from path strings.  NOT a filter of equipment.  Method allows for trimming Equipment Path strings in the results.

Syntax

setExcludedEquipmentPathList(excludeList)

  • Parameters

 List<String> pathList - The list of equipment paths to be excluded.

  • Returns

Nothing

 

setExcludeInactiveEquipment()

Description

Use this function to exclude any inactive equipment defined in the Equipment Model when filtering.

Included in Sepasoft Versions:

MES 3.81.1 SP6 and later
MES 3.79.0 SP6 and later

Syntax

setExcludeInactiveEquipment(Boolean)

  • Parameters 

Boolean: Set to True to exclude the inactive equipment in the Equipment Model when filtering.

  • Returns

Nothing

Code Example
1
2
3
4
5
6
7
filter = system.mes.object.filter.createFilter()
filter.setMESObjectTypeName('Line')
filter.setExcludeInactiveEquipment(True)
list = system.mes.searchMESObjects(filter)
forndx in range(list.size()):
    mesObjectLink = list.get(ndx)
    print mesObjectLink.getName()

setIncludeRelated(includeRelated)

Description

Sets the include related property to filter the results.

Include Related Definition

All Objects:

  • All Parent MES Objects
  • All Children MES Objects

When the filtered object is either an Operations Definition or an Operations Segment more objects will be added.

Operations Definition:

  • All linked Operation Segments.
  • Other Operations that are referenced by the Operations Definition's Begin Triggers.

Operations Segment:

  • The object from which the Operations Segment was derived from i.e. (Process Segment or another Operations Segment).
  • Other Operations or Segments that are referenced by the Operations Segment's Begin Triggers.
  • Other Operations that are referenced by the Operations Segment's End Triggers.
Syntax

setIncludeRelated(includeRelated)

  • Parameters

boolean includeRelated - Set this to True, if results should also include related MES objects.

  • Returns

Nothing

 

setMESObjectNamePattern(mesObjectNamePattern)

Description

Set the MES object name pattern to include in the results. It can contain wildcard characters including * or ?. The * character can be any characters and the ? character represents any single character.

Syntax

setMESObjectNamePattern(mesObjectNamePattern)

  • Parameters

String mesObjectNamePattern - The MES object name pattern used to filter the results.

  • Returns

Nothing

Code Examples
Code Snippet
1
2
3
4
5
6
7
8
9
10
#Create a filter.
filter=system.mes.object.filter.createFilter()
 
#Here is an example for setting the name pattern.
# Will return all objects with 'Turkey' at the end their name.
filter.setMESObjectNamePattern('*Turkey')
list=system.mes.searchMESObjects(filter)
forndx inrange(list.size()):
    mesObject =list.get(ndx).getMESObject()
    printmesObject.getMESObjectType().getDisplayName()
Output
Response Material Definition
Material Definition
Response Material Class
Response Material Class
Material Class
 

setMESObjectTypeName(mesObjectTypeNames)

Description

Set the MES object type name(s) to filter the results.

  • If you want the MES Object Filter to return all production items in the production model, you can simply not call the 'setMESObjectTypeName() or leave it blank i.e. 'setMESObjectTypeName(''). Although there is an MESObjectTypeName of 'All Equipment', this will return an empty list.
1
2
3
4
5
6
7
filter=system.mes.object.filter.createFilter()
filter.setMESObjectTypeName('')
filter.setPrimaryMESObjectPath(sitePath)
list=system.mes.searchMESObjects(filter)
printlist
foritem inlist:
    printitem
Syntax

setMESObjectTypeName(mesObjectTypeNames)

  • Parameters

String names - Object names separated by commas. See MES Object Type Name

  • Returns

Nothing

  • Scope

All

Code Examples
Code Snippet
1
2
3
4
filter=system.mes.object.filter.createFilter()
 
#Name of MESObjectType is set to EquipmentClass and Equipment.
filter.setMESObjectTypeName('EquipmentClass, Equipment')
 

setMESObjectUUIDList(mesObjectUUIDList)

Description

Set the UUIDs of the MES objects to return in the results.

Note that this is somewhat less efficient than the other methods of filtering objects, because each UUID must be individually looked up. Using other filters may improve this somewhat, such as setMESObjectTypeName().

Syntax

setMESObjectUUIDList(mesObjectUUIDList)

  • Parameters

 List of String mesObjectUUIDList - The list of UUIDs to include in the results.

  • Returns

Nothing

Code Snippet
#create filter
filter=system.mes.object.filter.createFilter()
mesObjectUUIDList  =['fce508d3-23b2-4edb-a520-b78c3d043cba''d9c140d8-8a29-40eb-b71b-20af45307f01''e90552b2-5eb8-447e-8ad4-4f9b8aeeddfe']
#set the object list
filter.setMESObjectUUIDList(mesObjectUUIDList)
 

setPrimaryClassFilter(primaryClassFilter)

Description

Limits the results to only include items that have the passed name as a parent object.

Syntax

setPrimaryClassFilter(parentMESObjectName)

  • Parameters

String parentMESObjectName - The name of the parent MES Object

  • Returns

Nothing

Code Snippet
#create filter
filter=system.mes.object.filter.createFilter()
 
class_name ='MES Class'
 
#set the primary class
# Will return any objects that are children of the 'MES Class' MES Object.
filter.setPrimaryClassFilter(class_name)
 

setPrimaryMESObjectPath(primaryMESObjectPath)

Description

Limits results to contain only objects that are children of the object referenced by passed primaryMESObjectPath

Syntax

setPrimaryMESObjectPath(primaryMESObjectPath)

  • Parameters

String primaryMESObjectPath - The path of the primary (parent) MES object to filter results by.

  • Returns

Nothing

 

setPrimaryMESObjectUUID(primaryMESObjectUUID)

Description

Limits results to contain only objects that are children of the object referenced by passed primaryMESObjectUUID

Syntax

setPrimaryMESObjectUUID(primaryMESObjectUUID)

  • Parameters

String primaryMESObjectUUID - The UUID of the primary (parent) MES object to filter results by.

  • Returns

Nothing

Code Examples
Code Snippet
1
2
3
4
5
filter=system.mes.object.filter.createFilter()
 
 
# Will return any objects that are children of the referenced object.
filter.setPrimaryMESObjectUUID('73facb39-806c-4bfc-8881-cc06707a9909')
 

setShowEquipmentPath(showPath)

Description

Usage Infomation

This parameter is only useful when used with system.mes.searchMESObjects()

If set to True, the object link for each object returned is a fully qualified equipment path instead of just the object name.

Syntax

setShowEquipmentPath(showPath)

  • Parameters

Boolean showPath - Set to True to modify object links to be equipment paths.

  • Returns

Nothing



Sepasoft MES Module Suite