Let me walk you through the complete fix for this situation, addressing all three key areas:
1. Shift Block Time Ranges - Verify Boundaries:
Your time ranges look correct, but check for gaps or overlaps:
<ShiftBlock id="DAY" start="06:00:00" end="14:00:00"/>
<ShiftBlock id="EVENING" start="14:00:00" end="22:00:00"/>
<ShiftBlock id="NIGHT" start="22:00:00" end="06:00:00"/>
Note: Night shift crosses midnight. Ensure your template handles the date boundary correctly with crossesMidnight="true" attribute.
2. Role-to-Shift Mapping - Fix Conflicts:
This is likely your main issue. When you have multiple active templates with different role mappings, workers get assigned based on whichever template processes first. Here’s what you need to do:
a) Deactivate the old template immediately:
- Go to Labor Management > Shift Templates
- Find your old 3-crew template
- Set Status = “Inactive” or delete it entirely
- Don’t just rely on priorities - remove the conflict source
b) Verify role mappings in your new 4-crew template:
Check that each role maps to exactly ONE shift per crew rotation:
<RoleMapping role="OPERATOR_A" crew="1" shift="DAY"/>
<RoleMapping role="OPERATOR_A" crew="2" shift="EVENING"/>
<RoleMapping role="OPERATOR_A" crew="3" shift="NIGHT"/>
<RoleMapping role="OPERATOR_A" crew="4" shift="DAY"/>
c) Check qualification requirements:
If operators are being assigned to unqualified roles, your template might be missing skill validation:
<RoleMapping role="SKILLED_OPERATOR" requiresQualification="true">
<RequiredSkill>ADVANCED_MACHINING</RequiredSkill>
</RoleMapping>
3. Assignment Cache Refresh - Complete Process:
The Labor Management console cache refresh isn’t always sufficient. You need a full cache clear:
a) Server-side cache clear:
- Stop the Labor Management service
- Clear the assignment cache directory: `[MES_Install]\Cache\LaborAssignments\
- Restart the service
b) Database-level cache clear (if server cache doesn’t work):
DELETE FROM LM_SHIFT_ASSIGNMENT_CACHE WHERE assignment_date >= '2025-01-08';
DELETE FROM LM_TEMPLATE_CACHE;
Then restart Labor Management service
c) Regenerate assignments:
- Go to Labor Management > Schedule Generation
- Select date range from when you made the template change forward
- Click “Regenerate Assignments”
- This forces recalculation using the correct (and now only active) template
Priority Configuration (for future reference):
Since you asked: Lower number = Higher priority in HM 2023.2
- Priority 1 = Highest (overrides everything)
- Priority 10 = Lower priority
- Priority 0 or null = Lowest (default)
Set your new 4-crew template to priority 1 to ensure it always wins, but honestly, just deactivate the old template instead.
Validation Steps:
- Confirm only ONE active shift template exists
- Verify role mappings don’t have duplicates or conflicts
- Check that shift time blocks don’t overlap (except at boundaries)
- Test with a single crew for one day before rolling out to all crews
- Monitor the assignment log (LaborAssignment.log) for any warnings
Why Manual Assignments Work:
Manual assignments bypass the template engine entirely - they write directly to the assignment table. That’s why they work correctly while template-based assignments fail. This confirms your issue is 100% in the template configuration, not in the core assignment logic.
Follow this process and your shift assignments should stabilize immediately. The key is removing the old template and doing a complete cache clear, not just a console refresh.