Middleware and maintenance services
- Last UpdatedOct 23, 2024
- 4 minute read
Whenever at least one MES middleware is active, one middleware will perform background maintenance services. The MES middleware that is currently handling the maintenance services performs the scheduled tasks described below, with additional information about shift and Quality Management (QM) sample generation in following chapters. There are Operations Control Management Console Log Viewer flags that can be enabled to record when these maintenance services are executed (see Log Flags for Server-Side Diagnostics).
If the middleware that is performing the maintenance services stops running and there is no other middleware host available to take over those services, then all of the maintenance services are terminated.
Every Minute
The MES middleware performs the following tasks at the start of every minute:
-
Updates the current shifts for each entity that has a shift change scheduled at this time. This might generate new QM samples.
If any change in shift configuration is detected, the projected shifts for the next 7 days are re-calculated for all affected entities.
For more information about shift generation, see Middleware and shift generation.
-
Runs the sp_BG_Minutely_Tasks stored procedure to do the following:
-
End stale sessions.
-
Update the projected finish time for jobs.
-
Record any dataset to be collected on a periodic basis.
-
Complete steps that have a fixed time duration, after the time has elapsed.
-
-
Checks for current utilization reasons that are elapsed. If the current reason has a non-null maximum duration and a non-null new reason code configured and it elapses (that is, the duration of the current utilization event related to the reason has passed its configured maximum duration), then the current reason is changed to the configured new reason.
-
For QM, if the Frequency to call sample updates (in seconds) system parameter is set to 0, generates samples. If this system parameter is set to a value other than 0 (the default value is 30 seconds), the middleware generates samples according to that value. For more information about the middleware and sample generation, see Middleware and quality management functions.
-
Performs Supply Chain Connector (SCC) imports and exports based on time (for those that have a trigger type of daily, weekdays, weekly, or every n minutes), the existence of a file (for imports), the existence of data in a table (for imports), or a change in internal MES data (for exports).
-
Performs SCC exports based on the ending of a job or a shift. The exports are queued up and processed every minute by the MES middleware, and not by the process causing these events.
Every Hour
The MES middleware performs the following tasks at the start of every hour:
-
Runs the sp_BG_Hourly_Tasks stored procedure to ready the first jobs of a work order if its release date and time has passed. The MES middleware archives the stored procedures, when it is time to do so. For more information on archiving, see the topic "Running an Archive or Purge Job Automatically" in the MES Client User Guide or help.
The MES middleware only checks for jobs to ready (where the release date/time has elapsed) during hourly background tasks. So, if at 8:05 you create a job to be released at 8:20, the job will not go to ready right at 8:20; it will go to ready at 9:00 when the hourly tasks run.
The following conditions must be met for a job to be readied on the hour:
-
The system attribute 310, Prevent automatic readying of first jobs, is set to false
-
The state of the job is New
-
The job's release time in UTC is older than the current time in UTC
-
The first_job property of the job is set to true or the system attribute 254, Ready all new jobs of a work order together, is set to true, which will ready all the jobs in the work order if the conditions above are met
For all the jobs that are currently running on the entities that can track OEE, the MES middleware creates the hourly buckets (in the job_hour_history table) for the new hour. For all the jobs that are currently running on the entities, the MES middleware updates the statistics (runtime, downtime, idletime, qty_good, qty_reject) in the job_hour_history table for the hour that is 2 hours in the past from the current UTC time.
-
-
Asks the License Manager for the current licensing and updates the internal licensing structures. If any licenses are activated, deactivated, or expired, this allows any operational actions that are covered by those licenses to be correctly carried out or denied.
-
If the custom stored procedure sp_BG_Hourly_Tasks_Custom exists, the middleware executes it on an hourly basis to perform any custom transactions. The sp_BG_Hourly_Tasks and sp_BG_Hourly_Tasks_Custom stored procedures are executed under separate transactions.
Every Day
The MES middleware performs the following tasks at the start of every day:
-
Projects the entities' shift schedules for the next 7 days.
-
Cleans up the QM context data that is older than the value specified in the How long to keep old context information (in days) general parameter.
-
If the custom stored procedure sp_BG_Daily_Tasks_Custom exists, the middleware executes it on a daily basis to perform any custom transactions. The sp_BG_Daily_Tasks and sp_BG_Daily_Tasks_Custom stored procedures are executed under separate transactions.