Skip to main content
Version: V3 (Ignition 8.3)

system.mes.oee.validateCalculationConfig

Description

Validates an OEE Calculation Configuration object against the field constraints without saving it. This is useful for checking whether a configuration is valid before attempting to save it.

Permissions

This method requires the OEE.READ.VALIDATE permission.

Syntax

system.mes.oee.validateCalculationConfig(**config)

Parameters

An unpacked dictionary of OeeCalculationConfigurationDTO fields.

ParameterTypeNullableDescriptionDefault Value
idStringTrueThe id of the OEE Calculation Configuration (ULID).null
locationIdStringFalseIdentifier for the associated location. Required.null
locationPathStringTruePath for the associated location. For display purposes only.null
periodTypeStringFalsePeriod granularity: HOUR, DAY, WEEK, MONTH, or SHIFT. Required.null
numRowsPerCycleIntegerFalseMaximum number of records to generate per job cycle. Minimum 1.1
weekStartDayStringFalseFirst day of the calendar week for WEEK bucketing. One of MONDAY to SUNDAY."MONDAY"
numDaysDelayIntegerFalseMinimum number of days a period must end before it is pre-computed. Minimum 1.1
latestCalculationTimestampInstantTrueISO-8601 timestamp of the most recently computed period.null
notesStringTrueNotes associated with the configuration.null
enabledBooleanFalseWhether this configuration is active.true
spare1StringTrueExtra field 1null
spare2StringTrueExtra field 2null
spare3StringTrueExtra field 3null

Returns

A JSON object containing validation results. If the object is empty, validation passed. If it contains entries, the keys are the field names and the values are lists of validation error messages.

Code Examples

# Create a new OEE calculation configuration object
config = system.mes.oee.newCalculationConfig()

# Leave required fields blank to trigger validation errors
validationErrors = system.mes.oee.validateCalculationConfig(**config)

if not validationErrors:
print "Validation passed. Configuration is valid."
else:
print "Validation failed. Errors:"
for field, errors in validationErrors.items():
print " - {}: {}".format(field, ", ".join(errors))