Skip to content

MID-11073 Fix threshold suspension in iterative scripting#629

Open
kay1313 wants to merge 1 commit into
masterfrom
fix/MID-11073
Open

MID-11073 Fix threshold suspension in iterative scripting#629
kay1313 wants to merge 1 commit into
masterfrom
fix/MID-11073

Conversation

@kay1313
Copy link
Copy Markdown
Contributor

@kay1313 kay1313 commented Apr 29, 2026

Summary

Fixes MID-11073, where iterative scripting tasks did not suspend correctly when a threshold policy action was triggered from inside a script.


Problem

When an iterative script called a model operation such as midpoint.modifyObject(delta), a ThresholdPolicyViolationException could be wrapped by the script evaluation layer as an ExpressionEvaluationException.

Because error categorization checked only the top-level exception, the task treated the threshold violation as a normal script/item failure. The task then continued processing remaining objects and eventually finished as Closed/Error instead of stopping as Suspended.


Fix

Detect ThresholdPolicyViolationException in the exception cause chain, so wrapped threshold violations are still categorized as POLICY_THRESHOLD.


Test

Added an integration test for an iterative scripting task with:

  • 10 test users
  • threshold count 3
  • policy action suspendTask

The test verifies that the task suspends after the threshold is reached, with 2 successful items and 1 threshold-triggering failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant