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.
| Parameter | Type | Nullable | Description | Default Value |
|---|---|---|---|---|
id | String | True | The id of the OEE Calculation Configuration (ULID). | null |
locationId | String | False | Identifier for the associated location. Required. | null |
locationPath | String | True | Path for the associated location. For display purposes only. | null |
periodType | String | False | Period granularity: HOUR, DAY, WEEK, MONTH, or SHIFT. Required. | null |
numRowsPerCycle | Integer | False | Maximum number of records to generate per job cycle. Minimum 1. | 1 |
weekStartDay | String | False | First day of the calendar week for WEEK bucketing. One of MONDAY to SUNDAY. | "MONDAY" |
numDaysDelay | Integer | False | Minimum number of days a period must end before it is pre-computed. Minimum 1. | 1 |
latestCalculationTimestamp | Instant | True | ISO-8601 timestamp of the most recently computed period. | null |
notes | String | True | Notes associated with the configuration. | null |
enabled | Boolean | False | Whether this configuration is active. | true |
spare1 | String | True | Extra field 1 | null |
spare2 | String | True | Extra field 2 | null |
spare3 | String | True | Extra field 3 | null |
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))