filter.parseCustomPropertyValueFilter

Sepasoft MES Module Suite

system.mes.lot.filter.parseCustomPropertyValueFilter(filter)

Returns a list of parsed custom property value filters.

Syntax

system.mes.lot.filter.parseCustomPropertyValueFilter(filter)

  • Parameters

String filter - The string value to filter the results. Note that you must start the string with "MaterialLot." and omit spaces around the equal sign e.g, customPropertyValue = 'MaterialLot.pH=4.1'

  • Returns

List<MESPropertyValueFilter> result - A list of parsed MESPropertyValueFilter objects.

Script Example

MES Lot Filter

Python
#These first two lines are simply to grab a lot that has the custom properties to search for
lotObj = system.mes.loadMESObject('BW 78', 'MaterialLot')
print "Material lot %s custom properties are %s " %(lotObj.getName(), lotObj.getCustomProperties())

#Filter the results using the lot filter
filter = system.mes.lot.filter.createFilter()
filter.setModeName('LOT')
filter.setIncludeActiveLots(True)
filter.setIncludeInactiveLots(True)
#The next line sets the string we will pass to create the custom value property filter. 
#This function requires 'MaterialLot.' to be appended to the custom property. 
#Make sure you don't have spaces between pH,= and 4.1 or whatever your custom property is.
customPropertyValue = 'MaterialLot.pH=4.1'

list = filter.parseCustomPropertyValueFilter(customPropertyValue)
filter.setCustomPropertyValueFilter(list)
from java.util import Calendar
beginCal = Calendar.getInstance()
beginCal.add(Calendar.MONTH, -1)
filter.setBeginDateTime(beginCal)
endCal = Calendar.getInstance()
filter.setEndDateTime(endCal)
results = system.mes.getLotList(filter)
for link in results:
	
	print "Found ", link.getName()

Output

Code
Material lot BW 78 custom properties are {pH=4.1, qty=70.0} 
Found  BW 78

Sepasoft MES Module Suite