GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — FOUR-26628 | Fix Error When Opening a Task with an Imported Assignment Rule by mcraeteisha · Pull Request #9110 · ProcessMaker/processmaker

Conversation

@mcraeteisha

@mcraeteisha mcraeteisha commented Oct 21, 2026 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Issue

Ticket: FOUR-26628

After importing a Process that contains a task with a Rule Expression assignment, clicking the task in the Modeler displays an error message. In the reported case, opening the task triggered a request for a user ID from the source environment that did not exist in the target environment, resulting in a visible 404 error.

The imported pm:assignmentRules data preserved the source environment's numeric user and group IDs. Neither the current nor legacy import flow reconciled those IDs, so the task inspector attempted to load the stale assignees when the task was opened. If the numeric ID belonged to a different user or group in the target environment, the inspector could also display the wrong assignee.

Unresolved rules that still matched at runtime could also bypass a valid Default Assignment and escalate to the Process Manager. Template editing with saveModelOnly skipped reconciliation entirely, so stale IDs remained until a process was created from the template. Inactive-user labels written with a translated $t('Inactive') suffix (for example Spanish inactivo) failed to parse and were incorrectly marked unresolved.

This change affects imported Rule Expression assignments for users and groups. Regular user and group assignments continue to use the existing assignment import behavior.

Solution

processmaker

  • Added AssignmentRulesReconciliation to reconcile pm:assignmentRules during import without trusting the exported numeric assignee ID.
  • Rebinds user rules by parsing the username from the existing assignmentName value, including values with the - Inactive suffix.
  • Rebinds group rules by assignmentName only when exactly one matching group exists.
  • Clears the assignee and marks the rule as unresolved when a unique target user or group cannot be found.
  • Applied assignment-rule reconciliation to the current import flow through ProcessExporter and to legacy process imports through ImportProcess.
  • When an unresolved rule’s expression matches at runtime, throws TaskDoesNotHaveUsersException so execution does not fall through to the Process Manager; the same guard applies in Process, ProcessExecutionRawRepository, and ProcessRequestToken.
  • Added modeler Auto Validate coverage for unresolved assignment rules (validateUnresolvedAssignmentRules.js).
  • Updated SelectUserGroup so missing assignees do not produce a global 404 alert, do not leave the picker in a loading state, and are handled locally.
  • Updated AssignExpression so unresolved assignees are not passed to the user/group picker and instead display “This assignee was not found in this environment. Select a user or group.” under Default Assignment and in the edit card.
  • Added feature tests covering username-based rebinding, stale-ID collisions, unresolved users and groups, ambiguous group names, the current import flow, and the legacy import flow.

How To Test

Automated Tests

  • php vendor/bin/phpunit --filter AssignmentRulesReconciliationTest tests/Feature/ImportExport/AssignmentRulesReconciliationTest.php
  • php vendor/bin/phpunit --filter ImportProcessAssignmentRulesTest tests/Feature/Jobs/ImportProcessAssignmentRulesTest.php
  • php vendor/bin/phpunit --filter 'testGetAssigneesFromExpressionThrowsWhen' tests/Model/ProcessRequestTokenTest.php

Manual Tests

  1. Import a Process containing a Rule Expression task whose assignment rule references a user or group that exists in the target environment under a different numeric ID, then open the task in the Modeler.
  2. Confirm that the task opens without an error and that the assignment rule is rebound to the matching target user or group.
  3. Import a Process containing a Rule Expression task whose assignment rule references a user or group that does not exist in the target environment, then open the task in the Modeler.
  4. Confirm that no 404 error is displayed, the Default Assignment picker remains usable, and “This assignee was not found in this environment. Select a user or group.” is displayed.
  5. Select a valid user or group for the unresolved assignment and confirm that the assignment can be saved.
  6. With an unresolved matching expression rule and a valid Default Assignment still configured, start a request and confirm the task does not assign to the Process Manager and instead fails with an incomplete-assignment error until the rule is resolved.
  7. Open or import a template with saveModelOnly that contains Rule Expression assignees, confirm the template editor shows the rebound target user/group (not a colliding local ID), then create a process from that template and confirm assignees remain correct.
  8. Import a Process whose inactive assignee was saved under a non-English UI (for example Name (username - inactivo)), confirm the user rebinds successfully when that username exists in the target environment.

ci:deploy

Code Review Checklist

  • I have pulled this code locally and tested it on my instance, along with any associated packages.
  • This code adheres to ProcessMaker Coding Guidelines.
  • This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • This solution fixes the bug reported in the original ticket.
  • This solution does not alter the expected output of a component in a way that would break existing Processes.
  • This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • This code does not duplicate functionality that already exists in the framework or in ProcessMaker.l
  • This ticket conforms to the PRD associated with this part of ProcessMaker.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
mcraeteisha added 2 commits October 21, 2026 16:35
@mcraeteisha
Reconcile imported assignment rules and UI warnings
02adb1a
This change rebinds imported rule_expression assignee records to valid users/groups in the target environment, clearing stale unresolved assignees and marking them for re-selection. It also adds guarded user/group fetches in the picker to avoid noisy 404s when stale assignees remain, and surfaces explicit warnings in the assignment expression inspector when an imported assignee cannot be resolved.
@mcraeteisha
Add tests for reconciling assignment rules
6c4f656
@cursor

cursor Bot commented Oct 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches BPMN import/export, runtime assignment resolution, and UI error handling, so regressions could block imports or task assignment flows if edge cases are missed.

Overview
Rebounds imported pm:assignmentRules by usernames/group names instead of trusting stale IDs, flags unresolved rows, and threads that reconciliation through both modern ProcessExporter imports and legacy ImportProcess saves.

Runtime guards now treat unresolved expression matches as hard failures (TaskDoesNotHaveUsersException) across Process, ProcessExecutionRawRepository, and ProcessRequestToken, while the modeler surfaces inline warnings, skips 404 spam in SelectUserGroup, and adds validation to block publishing incomplete rules.

Adds extensive PHPUnit coverage for rebinding edge cases (inactive labels, ambiguous groups, template imports) to lock the behavior in.

Reviewed by Cursor Bugbot for commit af28016. Bugbot is set up for automated code reviews on this repo. Configure here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Oct 21, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread resources/js/processes/modeler/components/inspector/AssignExpression.vue Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mcraeteisha
Normalize group assignment IDs
6386cf3
Group assignees can be stored as either numeric IDs or strings like group-<id>. This change centralizes normalization so default and special assignments consistently use the plain ID value before string operations, comparisons, and persisted assignment data.
@mcraeteisha mcraeteisha self-assigned this Oct 22, 2026
@mcraeteisha
mcraeteisha requested a review from eiresendez October 22, 2026 15:37
eiresendez
eiresendez requested changes Oct 22, 2026
View reviewed changes
Comment thread ProcessMaker/ImportExport/AssignmentRulesReconciliation.php Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ProcessMaker/ImportExport/Exporters/ProcessExporter.php Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ProcessMaker/ImportExport/AssignmentRulesReconciliation.php Resolved

Uh oh!

There was an error while loading. Please reload this page.

mcraeteisha added 3 commits October 26, 2026 10:41
@mcraeteisha
Guard unresolved assignment rules
4ed176b
Block unresolved user/group assignment rules after import and during task evaluation so they cannot assign tasks or fall through to the Process Manager.
@mcraeteisha
Reconcile assignment rules in model-only imports
bcf3f58
Move assignment-rule reconciliation into the standard import flow so BPMN-embedded rules are re-bound during saveModelOnly template imports as well as saveAllAssets imports.
@mcraeteisha
Handle translated inactive user suffixes
653c95b
Import/export reconciliation now recognizes SelectUserGroup's inactive-user suffix across locales, not just the English "Inactive" label.
cursor[bot]
cursor Bot reviewed Oct 26, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 653c95b. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ProcessMaker/Models/ProcessRequestToken.php Resolved

Uh oh!

There was an error while loading. Please reload this page.

mcraeteisha added 3 commits October 26, 2026 16:02
@mcraeteisha
Skip unresolved assignment rules
9152e0a
The reassign assignee lookup no longer throws on unresolved expression/default assignment rules. These rules are skipped during picker resolution so the UI does not fall through to Default Assignment, while runtime assignment behavior remains unchanged and still resolves via getNextUserByRule. Updated tests cover the skip behavior for matching and default unresolved rules.
@mcraeteisha
Merge branch 'develop' into bugfix/FOUR-26628
f6b9587
@mcraeteisha
Merge branch 'develop' into bugfix/FOUR-26628
7eff62f
@eiresendez
eiresendez self-requested a review October 28, 2026 22:35
eiresendez
eiresendez approved these changes Oct 28, 2026
View reviewed changes
@eiresendez

eiresendez commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

hi @mcraeteisha this is approved! 👋 👋

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sanjacornelius sanjacornelius closed this Nov 4, 2026
@sanjacornelius sanjacornelius reopened this Nov 4, 2026
mcraeteisha added 4 commits November 5, 2026 12:23
@mcraeteisha
Merge branch 'develop' into bugfix/FOUR-26628
a7d2574
@mcraeteisha
Refactor functions for cognitive complexity
eb3880a
@mcraeteisha
Sonarqube refactors
951734e
@mcraeteisha
Merge branch 'develop' into bugfix/FOUR-26628
af28016
@nolanpro

nolanpro commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

QA server K8S was successfully deployed https://tenant-1.ci-33b6126a5d.engk8s.processmaker.net

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@decisions-sonarqube

decisions-sonarqube Bot commented Nov 10, 2026

Copy link
Copy Markdown

Quality Gate passed Quality Gate passed

Issues
0 New issues
3 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
78.7% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

@cursor cursor[bot] cursor[bot] left review comments
@eiresendez eiresendez eiresendez approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@mcraeteisha mcraeteisha

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@mcraeteisha @eiresendez @nolanpro @sanjacornelius
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.