Production scheduling workflow hangs when material shortage detected

When the system detects a material shortage during production scheduling, the workflow hangs instead of escalating to the procurement team. We have escalation rules configured that should trigger notifications when material availability falls below required quantities, but the workflow just stops processing. The material shortage condition is being detected correctly - I can see it in the scheduling logs - but the notification template doesn’t get triggered and the workflow doesn’t advance. This is causing us to miss critical deadlines because we’re not finding out about shortages until it’s too late. The escalation rule mapping looks correct in the configuration, but something is preventing the workflow from executing the escalation step. Has anyone else seen scheduling workflows hang on material shortage conditions in HM 2023.1?

I’ve encountered and resolved this exact workflow hang issue multiple times. Let me walk you through the complete solution addressing all three critical areas.

Escalation Rule Mapping Configuration: The escalation rule mapping in HM 2023.1 requires very specific configuration to work with material shortage conditions. Navigate to Production Scheduling > Escalation Rules > Material Shortage Escalation. Your rule should be configured with these exact parameters:

Rule Name: MaterialShortageEscalation

Trigger Condition: scheduler.materialStatus == ‘INSUFFICIENT’ AND scheduler.shortageQuantity > 0

Evaluation Timing: IMMEDIATE (not DEFERRED)

Priority: HIGH (numeric value 1-10, recommend 8)

Target: ProcurementTeam

Action: SEND_NOTIFICATION_AND_HOLD

The key issue in most cases is the Trigger Condition syntax. In HM 2023.1, you must reference the scheduler context variables correctly. The old syntax ‘materialAvailable < materialRequired’ no longer works. You must use ‘scheduler.materialStatus == INSUFFICIENT’ because the scheduler now pre-evaluates material status and sets this flag.

Also critical is the Evaluation Timing setting. If set to DEFERRED, the escalation rule evaluation is queued and might not execute if the workflow is already in a waiting state. Set it to IMMEDIATE so the rule evaluates synchronously when the material shortage is detected.

Verify your rule doesn’t have conflicting conditions. Run this check: Go to Escalation Rules list and filter by ‘Active = true’ and ‘Trigger Type = Material’. If you see multiple rules with overlapping conditions (like one checking materialStatus and another checking availability percentage), you need to consolidate or set very distinct priority values. Rules with the same priority can cause evaluation deadlock.

Material Shortage Condition Evaluation: The material shortage condition evaluation happens in the scheduler workflow, but it needs to be properly configured to set the context variables that your escalation rule checks. Open the scheduler workflow definition (config/workflows/production_scheduler.xml) and locate the material validation step:

<workflow-step id="validate_materials" name="Validate Material Availability">
  <execution-handler>MaterialAvailabilityValidator</execution-handler>
  <context-variables>
    <variable name="materialStatus" source="validator.status"/>
    <variable name="shortageQuantity" source="validator.shortageQty"/>
    <variable name="shortageItems" source="validator.shortageList"/>
  </context-variables>
  <on-completion>
    <evaluate-escalation-rules category="Material"/>
  </on-completion>
</workflow-step>

The critical element is the on-completion section with evaluate-escalation-rules. This must be present and must specify the correct category (‘Material’). If this element is missing or has the wrong category, escalation rules won’t be evaluated even if the material shortage is detected.

Also verify the context-variables section includes all three variables. Your escalation rule condition references these, so they must be populated by the validation handler. If shortageQuantity isn’t set, your condition ‘scheduler.shortageQuantity > 0’ will fail even when there is a shortage.

Notification Template Setup: The notification template configuration is often overlooked but critical for workflow continuation. Navigate to Administration > Notification Templates > Material Shortage Notification. Verify these settings:

Template Name: MaterialShortageNotification (must match what’s referenced in your escalation rule)

Template Type: EMAIL

Recipients: procurement@yourcompany.com (or procurement team distribution list)

Subject: Material Shortage Alert - Urgent Action Required

Body: Must include these variables: ${scheduler.shortageItems}, ${scheduler.shortageQuantity}, ${scheduler.scheduledDate}

The workflow will hang if:

  1. The template name in the escalation rule doesn’t match an existing template (case-sensitive)
  2. The Recipients field is empty or contains invalid email addresses
  3. The template references context variables that aren’t populated

For the third issue, test your template by going to the template editor and clicking ‘Preview’. Enter sample values for the variables. If preview fails, the template has errors and needs to be fixed.

One common issue: if your template references ${scheduler.shortageItems} but the workflow context only populates ${shortageItems} (without the scheduler prefix), the template will fail to render and the notification won’t send. Ensure variable names in the template exactly match the context variable names from the workflow definition.

Also check the notification service configuration. Go to Administration > Services > Notification Service and verify:

  • Service Status: RUNNING
  • SMTP Configuration: Valid mail server settings
  • Retry Policy: At least 3 retries with 30 second intervals
  • Timeout: 60 seconds minimum

If the notification service isn’t running or SMTP isn’t configured, notifications will fail silently and the workflow will hang waiting for confirmation.

After configuring all three areas:

  1. Save all configuration changes
  2. Reload the scheduler workflow (Admin Console > Workflows > Reload Production Scheduler)
  3. Restart the notification service to pick up template changes
  4. Test with a scheduling run that you know will have material shortage
  5. Monitor the workflow execution log to verify:
    • Material shortage detected and context variables set
    • Escalation rule evaluated and triggered
    • Notification sent successfully
    • Workflow either holds or advances based on your escalation action setting

Check the escalation audit log (Production Scheduling > Audit > Escalation Events) after your test. You should see an entry showing the escalation rule fired, the notification was sent, and the recipients. If the audit log is empty, the escalation rule isn’t being evaluated, which means the workflow definition on-completion section is misconfigured.

With all three areas properly configured and aligned, material shortage detection will trigger escalation rules, send notifications to procurement, and the workflow will continue processing according to your escalation action setting (hold or advance with warning). Your team will be notified immediately when shortages are detected instead of discovering them too late.

Check if your escalation rules have the correct priority and conditions set. If the material shortage condition doesn’t exactly match what’s defined in the escalation rule, the rule won’t trigger. Also verify that the notification template is properly configured with valid recipient addresses. If the template has errors, the workflow might hang trying to send notifications.

Also check if there are multiple escalation rules defined that might be conflicting. If you have overlapping conditions or priorities, the workflow engine might not know which rule to execute and just hang. Review all your escalation rules and make sure they have distinct conditions and clear priority ordering. Sometimes during upgrades, old escalation rules don’t get cleaned up and can cause conflicts with new rules.

I checked the escalation timeout and it’s set to 300 seconds which should be plenty. The notification service logs show that no notifications are even being attempted. It’s like the workflow isn’t reaching the escalation step at all. Could there be a problem with how the material shortage condition is mapped to the escalation rule?

We had a similar issue where the workflow was hanging because the escalation timeout was set too low. The workflow was waiting for the notification to be sent, but the notification service was taking longer than the timeout period. This caused the workflow to hang in a waiting state. Check your escalation timeout settings and increase them if necessary. Also look at the notification service logs to see if there are any delivery failures.

That sounds like the material shortage condition isn’t triggering the escalation rule properly. In HM 2023.1, the condition evaluation changed. You need to verify that your escalation rule condition uses the correct syntax for material availability checks. The condition should reference the material availability status from the scheduler context, not just check if availability is below required. There’s a specific context variable you need to use.