system.mes.oee.newCalculationConfig
Description
Generates an empty, non-persisted OEE Calculation Configuration object populated with default values. This object provides the structure required to save a new calculation configuration record using system.mes.oee.saveCalculationConfig.
Permissions
This method does not require any permissions.
Syntax
system.mes.oee.newCalculationConfig()
Parameters
This method does not take any parameters.
Returns
A JSON representation of an OeeCalculationConfigurationDTO object with default values, ready to be populated and saved.
| Name | 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. | 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. | null |
numRowsPerCycle | Integer | False | Maximum number of records to generate per job cycle. | 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. | 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 |
Code Examples
# Create a new OEE calculation configuration object
config = system.mes.oee.newCalculationConfig()
# Populate the required fields
config['locationId'] = 'some-location-id'
config['periodType'] = 'DAY'
# To persist the configuration, pass it to the saveCalculationConfig function
# savedConfig = system.mes.oee.saveCalculationConfig(**config)