ERP, MES, and APS: How they work together