MES Lot Filter

Sepasoft MES Module Suite

MES Lot Filter

This object is used when searching for lots or sublots and is a parameter passed to certain functions. Lot or sublot search results can be limited by using the MESLotFilter object properties to narrow down the material lots returned when using the system.mes.getLotList() script function.

The MESLotFilter object doesn't have a option to set the lot sequence number. All functions using the MESLotFilter object return a list of lots and will include all lots that match the settings in the MESLotFilter object, not just the last lot.

The system.mes.loadMaterialLot() and system.mes.loadMaterialLotLink() script functions should be used to obtain a specific instance of a lot and will return the last lot if the lot sequence parameter is set to -1.

Active or Inactive Status Setting Required

When using a lot filter, you must specify if Active or Inactive lots are desired. This is accomplished through the setIncludeActiveLots() and/or setIncludeInactiveLots(). If neither are used, your lot search will always return zero results.

Code Example
Python
end = system.date.now()
begin = system.date.addHours(end, -2)
filter.setEndDate(end)
filter.setBeginDate(begin)

Object Functions


 getBeginDate()

Description

Get the beginning date and time to limit the results to return, in java.util.Date format.

Syntax

getBeginDate()


  • Parameters

 None

  • Returns

 Date beginDateTime - The beginning date and time to filter results (in java.util.Date format).

Code Examples
Code Snippet
# Example modifying the set begin time
current_begin_time = lot_filter.getBeginDate()
hour_in_future = system.date.addHour(current_begin_time, 1)
 

getCustomPropertyValueFilter()

Description

Get the list of MESPropertyValueFilter used to filter the results.

Syntax

getCustomPropertyValueFilter()

  • Parameters

None

  • Returns

List of MES Property Value Filter - The custom property value filter containing information about MESObjectTypes, propertyPath, etc .

 getEndDate()

Description

Get the ending date and time to limit the results to return, in java.util.Date format, not Calendar (see deprecated version below).

Syntax

getEndDate()

  • Parameters

  None

  • Returns

Date endDateTime - The ending date and time to filter results (in java.util.Date format).

Code Examples
Code Snippet
# Example modifying the set end time
current_end_time = lot_filter.getEndDate()
hour_in_future = system.date.addHour(current_end_time, 1)
 

getLotEquipmentClassFilter()

Description

Get the lot equipment class filter used to filter the results.

Syntax

getLotEquipmentClassFilter()

  • Parameters

None

  • Returns

String  lotEquipClassFilter -The lot equipment class filter.

 getLotEquipmentNameFilter()

Description

Get the lot equipment name filter used to filter the results.

Syntax

getLotEquipmentNameFilter()

  • Parameters

None

  • Returns

String  lotEquipNameFilter -The lot equipment name filter.


 getLotNameFilter()

Description

Get the lot name filter used to filter the results.

Syntax

getLotNameFilter()

  • Parameters

   None

  • Returns

String  lotNameFilter - The lot name filter.

 

getLotStatusFilter()

Description

Get the custom lot status of results to return.

Syntax

getLotStatusFilter()

  • Parameters

None

  • Returns

String lotStatusFilter - The custom lot status value.

 

getMaterialClassFilter()

Description

Get the material class filter used to filter the results.

Syntax

getMaterialClassFilter()

  • Parameters

None

  • Returns

String matClassFilter -The material class filter.

 

getMaterialNameFilter()

Description

Get the material name filter used to filter the results.

Syntax

getMaterialNameFilter()

  • Parameters

None

  • Returns

String matNameFilter -The material name filter.

 

getMaxResults()

Description

Get the maximum number of results to that will returned.

Syntax

getMaxResults()

  • Parameters

   None

  • Returns

Integer maxResults -The maximum number of items to return.

Code Examples
Code Snippet
1
2
3
#Example
filter = system.mes.lot.filter.createFilter()
print filter.getMaxResults()
Output
100
 

getModeName()

Description

Get the type of results to return. It can be return results for lots (batches) of material or serialized items (sublots).

Syntax

getModeName()

  • Parameters

None

  • Returns

String mode Name - The name of the type of results to return.


Code Examples
Code Snippet
1
2
3
4
#Prints the mode names.
filter = system.mes.lot.filter.createFilter()
filter.setIncludeActiveLots(True)
print filter.getModeName()
Output
LOT
 

getOperationNameFilter()

Description

Get the operation name filter used to filter the results.

Syntax

getOperationNameFilter()

  • Parameters

None

  • Returns

String operationNameFilter -The operation name filter.

 

getPersonnelClassFilter()

Description

Get the personnel class filter used to filter the results.

Syntax

getPersonnelClassFilter()

  • Parameters

None

  • Returns

String personnelClassFilter -The personnel class filter.

 getPersonnelNameFilter()

Description

Get the personnel name filter used to filter the results.

Syntax

getPersonnelNameFilter()

  • Parameters

None

  • Returns

String personnelNameFilter - The personnel name filter.

 getSegmentEquipmentClassFilter()

Description

Get the segment equipment class filter used to filter the results.

Syntax

getSegmentEquipmentClassFilter()

  • Parameters

None

  • Returns

String  segEquipClassFilter -The segment equipment class filter.

 

getSegmentEquipmentNameFilter()

Description

Get the segment equipment name filter used to filter the results.

Syntax

getSegmentEquipmentNameFilter()

  • Parameters

None

  • Returns

String  segEquipNameFilter -The lot equipment name filter.

 

getSegmentNameFilter()

Description

Get the segment name filter used to filter the results.

Syntax

getSegmentNameFilter()

  • Parameters

None

  • Returns

String segNameFilter -The segment name filter.

 getSublotNameFilter()

Description

Get the sublot name filter used to filter the results.

Syntax

getSublotNameFilter()

  • Parameters

None

  • Returns

String  sublotNameFilter -The sublot name filter.


 

hasCustomPropertyValuefilter()

Description

Checks to see if a custom property value filter exists for the given lot.

Syntax

hasCustomPropertyValuefilter()

  • Parameters

 None

  • Returns

 True, if there exist a custom property value filter .

  • Scope

All

 includeActiveLots()

Description

If True, lots or sublots currently being processed will be included in the results.

Syntax

includeActiveLots()

  • Parameters

None

  • Returns

Boolean If True, active lots will be returned in the results.

Code Examples
Code Snippet
1
2
3
#Example
filter = system.mes.lot.filter.createFilter()
filter.includeInactiveLots()
 

includeInactiveLots()

Description

If True, lots or sublots that are complete will be included in the results.

Syntax

includeInactiveLots()

  • Parameters

None

  • Returns

Boolean - If True, completed lots will be return in the results.

Code Examples
Code Snippet
1
2
3
#Example
filter = system.mes.lot.filter.createFilter()
filter.includeInactiveLots()
 

setBeginDate(beginDate)

Description

Set the beginning date and time to limit results to return, in java.util.Date format, not Calendar (see deprecated version below). This applies to lots or sublots that are completed or have a custom lot status.

Syntax

setBeginDate(beginDate)

  • Parameters

Date beginDate - Beginning date and time to filter results (in java.util.Date format).

  • Returns

Nothing

Code Examples
Code Snippet
1
2
3
4
# Example using current time as begin time
filter = system.mes.lot.filter.createFilter()
begin = system.date.now()
filter.setBeginDate(begin)
 

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.lot.filter.parseCustomPropertyValueFilter(filter) script function to create the list of MES Property Value Filter objects.

Info

Custom Property Value Filter

Description

The results can be limited to only include items that have a custom property expressions defined by this property that evaluates to true. Example Kind > 3.

Syntax

setCustomPropertyValueFilter(customPropertyValueFilter)

  • Parameters

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

  • Returns

Nothing

 

setEndDate(endDate)

Description

Set the ending date and time to limit results to return, in java.util.Date format, not Calendar (see deprecated version below). This applies to lots or sublots that are completed or have a custom lot status.

Syntax

setEndDate(endDate)

  • Parameters

  Date  endDate - Ending date and time to filter results (in java.util.Date format).

  • Returns

 Nothing

Code Examples
Code Snippet
1
2
3
4
# Example using current time as end time
filter = system.mes.lot.filter.createFilter()
endTime = system.date.now()
filter.setEndDate(endTime)
 

setForceEnclosedDateRange(forceEnclosedDateRange)

Description

Forces the MESLotFilter's date range filtering to be less restrictive. The default setting is True.

Available in Stable Releases 3.81.9 and later


setForceEnclosedDateRange(forceEnclosedDateRange)

  • Parameters
    • Boolean forceEnclosedDateRange - If True, Lots must have began and ended between the specified Begin and End Date filters (inclusive). If False, Lots must have occurred at any point during the time range.
  • Returns
    • Nothing
Code Examples
Code Snippet
1
2
3
4
5
6
7
8
9
filter = system.mes.lot.filter.createFilter()
 
end = system.date.now()
begin = system.date.addHours(end, -2)
filter.setEndDate(end)
filter.setBeginDate(begin)
 
# If this function is not called, the default setting will be True.
filter.setForceEnclosedDateRange(False)

 

  • If setForceEnclosedDateRange is True (which is the default value), Lots must have a Begin and End time range that falls in between the filter's date range (inclusive).
    • This means the only Lot that will be returned is LOT B.
      • LOT B's Begin time is strictly equal to or after the filter's begin time.
      • LOT B's End time is strictly equal to or before the filter's end time.
      • No other Lots in this example simultaneously satisfy both of the above conditions.
  • If False, Lots touching the filter time range will be returned.
    • Lots, ABC, and D will be returned.
      • Each of these Lots have a begin time that is equal to or before the filter's end time.
      • Each of these Lots have an end time that is equal to or after the filter's begin time.
      • Lots E and F do not individually satisfy both of the above conditions at the same time.
  • Lots E and F fail both conditions; neither will be returned in either case.

If the user does not call this function, the Default setting will be True. This is to protect backwards compatibility for upgrading customers that do not necessarily want/care about this new feature.


 setIncludeActiveLots(includeActiveLots)

Description

If set to True, lots or sublots that are actively being processed will be included in the results.

Syntax

setIncludeActiveLots(includeActiveLots)

  • Parameters

 Boolean includeActiveLots - If True, include active lots or sublots in results.

  • Returns

Nothing

Code Examples
Code Snippet
1
2
3
#Example
filter = system.mes.lot.filter.createFilter()
filter.setIncludeActiveLots(True)
 

setIncludeInactiveLots(includeInactiveLots)

Description

If set to True, lots or sublot that are completed will be included in the results.

Syntax

setIncludeInactiveLots(includeInactiveLots)

  • Parameters

Boolean includeActiveLots - If True, include completed lots or sublots in results.

  • Returns

Nothing

Code Examples
Code Snippet
1
2
3
#Example
filter = system.mes.lot.filter.createFilter()
filter.setIncludeInactiveLots(True)
 

setIncludeSupplementalEquipment(includeSupplementalEquipment)

Description

If set to True, the lots in  Supplemental Equipment will be included in the results. Default setting is False.

Syntax

setIncludeSupplementalEquipment(includeSupplementalEquipment)

  • Parameters

Boolean includeSupplementalEquipment - If True, the lots in Supplemental Equipment will be included in the results. Default setting is False.

  • Returns

Nothing

Code Examples
Code Snippet
1
2
3
4
#Example
filter = system.mes.lot.filter.createFilter()
#Include the lots held in Supplemental Equipment
filter.setIncludeSupplementalEquipment(True)

 setLotAvailabilityFilter(availabilityStatus)

Description

A setter for the availability criteria in the lot filter.  If "Available" is provided in the filter, available lots will be returned.  If "Used" is provided in the filter, lots that are not available, but used up, will be returned.

Syntax

setLotAvailabilityFilter(availabilityStatus)

  • Parameters

String availabilityStatus - A string, either "Available" or "Used", indicating which status lots to return in the results.

  • Returns

Nothing

Code Examples
Code Snippet
1
2
3
#Example
filter = system.mes.lot.filter.createFilter()
filter.setLotAvailabilityFilter('Available')
 

setLotEquipmentClassFilter(lotEquipmentClassFilter)

Description

Set the lot equipment class filter to include lots that were stored in the equipment that belong to the equipment class that matches this property. It can contain wildcard characters including * or ?. The * character can be any characters and the ? character represents any single character.

Syntax

setLotEquipmentClassFilter(lotEquipmentClassFilter)

  • Parameters

String lotEquipmentClassFilter - The lot equipment class filter used to filter the results.

  • Returns

Nothing

Code Examples
Code Snippet
1
2
3
#Example
filter = system.mes.lot.filter.createFilter()
filter.setLotEquipmentClassFilter('Storage Tank')

 setLotEquipmentNameFilter(lotEquipmentNameFilter)

Description

Set the lot equipment name filter to include lots that were stored in the equipment with a name that matches this property. It can contain wildcard characters including * or ?. The * character can be any characters and the ? character represents any single character.

Syntax

setLotEquipmentNameFilter(lotEquipmentNameFilter)

  • Parameters

String lotEquipmentNameFilter - The lot equipment name filter used to filter the results.

  • Returns

Nothing

Code Examples
Code Snippet
1
2
3
#Example
filter = system.mes.lot.filter.createFilter()
filter.setLotEquipmentNameFilter('Vinegar Tank?')
 

setLotNameFilter(lotNameFilter)

Description

Set the lot name to filter 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

setLotNameFilter(lotNameFilter)

  • Parameters

   String  lotNameFilter - The lot name filter used to filter the results.

  • Returns

Nothing

Code Examples
Code Snippet
#Example
filter = system.mes.lot.filter.createFilter()
filter.setLotNameFilter('V100*')
 

setLotStatusFilter(lotStatusFilter)

Description

Set the custom lot status of results to return. If the Final Lot Status property in a resource definition of a Process Segment or Operations Segment is set to a custom lot status, it can be filtered with this property.

Syntax

setLotStatusFilter(lotStatusFilter)

  • Parameters

String lotStatusFilter - Custom lot status value to filter results.

  • Returns

Nothing

Code Examples
Code Snippet
1
2
3
#Example
filter = system.mes.lot.filter.createFilter()
filter.setLotStatusFilter('Complete')

 setMaterialClassFilter(materialClassFilter)

Description

Set the material class filter to include lots that have material that belong to the material class that matches this property. It can contain wildcard characters including * or ?. The * character can be any characters and the ? character represents any single character.

Syntax

setMaterialClassFilter(materialClassFilter)

  • Parameters

String materialClassFilter - The material class filter used to filter the results.

  • Returns

Nothing


Code Examples
Code Snippet
1
2
3
#Example
filter = system.mes.lot.filter.createFilter()
filter.setMaterialClassFilter('* Vinegar')
 

setMaterialNameFilter(materialNameFilter)

Description

Set the material definition name filter to include lots that have material with a name that matches this property. It can contain wildcard characters including * or ?. The * character can be any characters and the ? character represents any single character.

Syntax

setMaterialNameFilter(materialNameFilter)

  • Parameters

String materialNameFilter - The material definition name filter used to filter the results.

  • Returns

Nothing

Code Examples
Code Snippet
1
2
3
#Example
filter = system.mes.lot.filter.createFilter()
filter.setMaterialNameFilter('* Turkey')
 

setMaxResults(maxResults)

Description

Set the maximum results to return. This prevents a large list from being returned which reduces database operations, memory usage and other resources when most of the time, the results are not used. If large results are needed, then this property can be increased.

Syntax

setMaxResults(maxResults)

  • Parameters

Integer maxResults - The maximum number of items to return.

  • Returns

Nothing


Code Examples
Code Snippet
1
2
3
4
#Here is an example of how to set the maximum result count.
filter = system.mes.lot.filter.createFilter()
filter.setMaxResults(200)
print filter.getMaxResults()
Output
200

 setModeName(modeName)

Description

Set the type of results to return. It can be return results for lots (batches) of material or serialized items (sublots). Options are Lot and Sublot.

Syntax

setModeName(modeName)

  • Parameters

 String modeName - The name of the mode for the type of results to return.

  • Returns

Nothing

Code Examples
Code Snippet
1
2
3
#This code snippet will set the mode name.
filter = system.mes.lot.filter.createFilter()
filter.setModeName('Sublot')
 

setOperationNameFilter(operationNameFilter)

Description

Set the operation name filter to include lots that were processed by the operation with a name that matches this property. It can contain wildcard characters including * or ?. The * character can be any characters and the ? character represents any single character.

Syntax

setOperationNameFilter(operationNameFilter)

  • Parameters

String operationNameFilter - The operation name filter used to filter the results.

  • Returns

Nothing

Code Examples
Code Snippet
1
2
3
#Example
filter = system.mes.lot.filter.createFilter()
filter.setOperationNameFilter('Receive*')

 setPersonnelClassFilter(personnelClassFilter)

Description

Set the personnel class filter to include lots that were processed by personnel that belong to the personnel class that matches this property. It can contain wildcard characters including * or ?. The * character can be any characters and the ? character represents any single character.

Syntax

setPersonnelClassFilter(personnelClassFilter)

  • Parameters

String personnelClassFilter - The personnel class filter used to filter the results.

  • Returns

Nothing

Code Examples
Code Snippet
1
2
3
#Example
filter = system.mes.lot.filter.createFilter()
filter.setPersonnelClassFilter('Operator?')
 

setPersonnelNameFilter(personnelNameFilter)

Description

Set the personnel name filter to include lots that were processed with a name that matches this property. It can contain wildcard characters including * or ?. The * character can be any characters and the ? character represents any single character.

Syntax

setPersonnelNameFilter(personnelNameFilter)

  • Parameters

String personnelNameFilter - The personnel name filter used to filter the results.

  • Returns

Nothing

Code Examples
Code Snippet
1
2
3
#Example
filter = system.mes.lot.filter.createFilter()
filter.setPersonnelNameFilter('Jo*')
 

setSegmentEquipmentClassFilter(segmentEquipmentClassFilter)

Description

Set the segment equipment class filter to include lots that were processed at the equipment that belong to the equipment class that matches this property. It can contain wildcard characters including * or ?. The * character can be any characters and the ? character represents any single character.

Syntax

setSegmentEquipmentClassFilter(segmentEquipmentClassFilter)

  • Parameters

String segmentEquipmentClassFilter - The segment equipment class filter used to filter the results.

  • Returns

Nothing

Code Examples
Code Snippet
1
2
3
#Example
filter = system.mes.lot.filter.createFilter()
filter.setSegmentEquipmentClassFilter('* Tank')

 setSegmentEquipmentNameFilter(segmentEquipmentNameFilter)

Description

Set the segment equipment name filter to include lots that were processed at the equipment with a name that matches this property. It can contain wildcard characters including * or ?. The * character can be any characters and the ? character represents any single character.

Syntax

setSegmentEquipmentNameFilter(segmentEquipmentNameFilter)

  • Parameters

String segmentEquipmentNameFilter - The segment equipment name filter used to filter the results.

  • Returns

Nothing

Code Examples
Code Snippet
1
2
3
#Example
filter = system.mes.lot.filter.createFilter()
filter.setSegmentEquipmentNameFilter('Vinegar*')
 

setSegmentNameFilter(segmentNameFilter)

Description

Set the segment name filter to include lots that were processed by the segment with a name that matches this property. It can contain wildcard characters including * or ?. The * character can be any characters and the ? character represents any single character.

Syntax

setSegmentNameFilter(segmentNameFilter)

  • Parameters

String segmentNameFilter - The segment name filter used to filter the results.

  • Returns

Nothing


Code Examples
Code Snippet
1
2
3
#Example
filter = system.mes.lot.filter.createFilter()
filter.setSegmentNameFilter('Receive*')
 

setSublotNameFilter(sublotNameFilter)

Description

Set the sublot name to filter 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

setSublotNameFilter(sublotNameFilter)

  • Parameters

String sublotNameFilter - The sublot name filter used to filter the results.

  • Returns

Nothing

Code Examples
Code Snippet
1
2
3
#Example
filter = system.mes.lot.filter.createFilter()
filter.setSublotNameFilter('BB 100?')

Sepasoft MES Module Suite