Skip to main content

system.mes.oee.createOeeWasteRecord

Description

Creates a new OEE Waste Record for a specific location.

Permissions

This method requires the OEE.WRITE.SAVE permission.

Syntax

system.mes.oee.createOeeWasteRecord(locationIdOrPath, startDate, endDate, wasteCount, wasteCountUnitOfMeasureIdOrName, qualityReasonId=None)

Parameters

ParameterTypeNullableDescription
locationIdOrPathStringFalseThe location ID (ULID) or path to create the OEE waste record for.
startDateDateFalseThe start date/time of the waste record.
endDateDateFalseThe end date/time of the waste record.
wasteCountDoubleFalseThe number of waste units recorded.
wasteCountUnitOfMeasureIdOrNameStringFalseThe ID (ULID) or name of the unit of measure for the waste count.
qualityReasonIdStringTrueThe ID of the quality reason to assign to the waste record. Defaults to None.

Returns

Returns a JSON representation of the newly created OeeWasteRecordDTO object.

NameTypeNullableDescriptionDefault Value
idStringTrueThe id of the OEE Waste Recordnull
locationIdStringFalseIdentifier of the associated location where this OEE waste record was capturednull
locationPathStringTruePath of the location where this OEE waste record was capturednull
locationNameStringTrueName of the associated locationnull
startDateInstantFalseStart date and time of the OEE waste recordInstant.now()
endDateInstantTrueEnd date and time of the OEE waste recordnull
totalDurationSecDoubleFalseTotal duration of the OEE waste record in seconds0.0
qualityReasonIdStringTrueIdentifier of the associated quality reason, if applicablenull
qualityReasonNameStringTrueName of the associated quality reason. (Name - Code) For display purposes onlynull
qualityReasonPathStringTruePath to the current quality reasonnull
qualityReasonCodeStringTrueCode of the associated quality reasonnull
wasteCountDoubleFalseTotal number of waste units recorded during this period0.0
wasteCountUnitOfMeasureIdStringTrueIdentifier of the unit of measure for the waste countnull
wasteCountUnitOfMeasureNameStringTrueName of the unit of measure for the waste countnull
wasteCountUnitOfMeasureSymbolStringTrueSymbol of the unit of measure for the waste countnull
notesStringTrueNotes associated with the OEE Waste Recordnull
enabledbooleanTrueIndicates whether the OEE Waste Record is enabledtrue
spare1StringTrueExtra field 1null
spare2StringTrueExtra field 2null
spare3StringTrueExtra field 3null

Code Examples

from java.util import Date

# Create a new OEE waste record
locationPath = "Enterprise/Site/Production/Line1"
endTime = Date()
startTime = Date(endTime.getTime() - TimeUnit.HOURS.toMillis(24))

wasteRecord = system.mes.oee.createOeeWasteRecord(
locationIdOrPath=locationPath,
startDate=startTime,
endDate=endTime,
wasteCount=15.0,
wasteCountUnitOfMeasureIdOrName='Units',
qualityReasonId='01JAP8RJBN-8ZTPXSGY-J9GSDPE1'
)

print "Created waste record:", wasteRecord['id']
print "Waste Count:", wasteRecord['wasteCount']