Skip to main content

system.mes.oee.newOeeState

Descriptions

Generates an empty, non-persisted OEE State object. This object provides the structure required to save a new state record using system.mes.oee.saveState.

Permissions

This method does not require any permissions.

Syntax

system.mes.oee.newOeeState()

Parameters

This method does not take any parameters.

Returns

A JSON representation of an OeeStateDTO object with default values, ready to be populated and saved.

NameTypeNullableDescriptionDefault Value
idStringTrueThe id of the OEE Statenull
locationIdStringFalseIdentifier of the associated locationnull
locationPathStringTruePath of the associated locationnull
codeIntegerFalseInteger state number, which must be unique for a given locationnull
nameStringFalseName of the statenull
calculationTypeOeeStateCalculationTypeFalseSpecifies how this state contributes to OEE calculationsDOWNTIME
colorStringFalseHex color code representing the state visually"#000000"
autoAcknowledgeBooleanFalseWhether to automatically acknowledge the state record when it is createdfalse
interruptionLocationIdStringTrueImmediate interruption location that caused a blocked/starved statenull
interruptionLocationPathStringTruePath to the location that caused a blocked/starved statenull
maxRootCauseDelaySecondsIntegerTrueMaximum delay in seconds for looking back at historical state records when resolving root cause for blocked/starved states0
notesStringTrueNotes associated with the OEE Statenull
enabledbooleanTrueIndicates whether the OEE State is enabledtrue
spare1StringTrueExtra field 1null
spare2StringTrueExtra field 2null
spare3StringTrueExtra field 3null

Code Examples

# Create a new OEE state object
newState = system.mes.oee.newOeeState()

# Now you can set properties on the new_state object
newState['locationId'] = 'some-location-id'
newState['name'] = 'Running'
newState['calculationType'] = 'RUNNING'

# To persist the state, pass it to the saveState function
# savedState = system.mes.oee.saveState(**newState)