system.mes.oee.getCalculationConfigByLocationAndPeriod
Description
Returns the OEE Calculation Configuration for the given location and period type.
Throws ResourceNotFoundException if no configuration exists for the given location and period type.
Permissions
This method requires the OEE.READ.GET permission.
Syntax
system.mes.oee.getCalculationConfigByLocationAndPeriod(locationIdOrPath, periodType)
Parameters
| Parameter | Type | Nullable | Description |
|---|---|---|---|
locationIdOrPath | String | False | Location ID (ULID) or path. |
periodType | String | False | Period granularity: "HOUR", "DAY", "WEEK", "MONTH", or "SHIFT". |
Returns
A JSON representation of an OeeCalculationConfigurationDTO object.
| Name | Type | Nullable | Description | Default Value |
|---|---|---|---|---|
id | String | True | The ID of the configuration (ULID). | null |
locationId | String | False | Identifier for the associated location. | null |
locationPath | String | True | Path for the associated location (display only). | null |
periodType | String | False | Period granularity: HOUR, DAY, WEEK, MONTH, or SHIFT. | null |
numRowsPerCycle | Integer | False | Maximum records to generate per job cycle. | 1 |
weekStartDay | String | False | First day of the calendar week for WEEK bucketing. | "MONDAY" |
numDaysDelay | Integer | False | Minimum number of days a period must end before it is pre-computed. The pre-processed row in the rollup table will always be at least this many days behind the current date. This is to allow for a settling period. | 1 |
latestCalculationTimestamp | Instant | True | ISO-8601 timestamp of the most recently computed period. | null |
enabled | Boolean | False | Whether this configuration is active. | true |
notes | String | True | Optional notes. | null |
Code Examples
# Retrieve the hourly calculation config for a line
config = system.mes.oee.getCalculationConfigByLocationAndPeriod("Enterprise/Site/Line1", "HOUR")
print "Rows per cycle:", config['numRowsPerCycle']
print "Latest timestamp:", config['latestCalculationTimestamp']