-
Notifications
You must be signed in to change notification settings - Fork 242
Process Manager - Number of Users to Assign #8549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
4f5db81
allow more than 1 manager per process
marcoAntonioNina ac2b6a0
change to manage multiple managers
marcoAntonioNina 228e248
fix styles
marcoAntonioNina 72318fd
set nullable
marcoAntonioNina 103f212
Fix test
marcoAntonioNina f800432
Return int in fucntion
marcoAntonioNina e9fda96
preview managers export
marcoAntonioNina a41e840
add validation max managers
marcoAntonioNina a568aba
Change array_rand
marcoAntonioNina 9d5adef
Change manager name and ids
marcoAntonioNina 7750207
Validate values of managers
marcoAntonioNina 951bb1f
Merge branch 'develop' of github.com:ProcessMaker/processmaker into t…
marcoAntonioNina 7baa570
validate value is string or array
marcoAntonioNina 50458bc
Fix value managerId
marcoAntonioNina 5712645
Fix test
marcoAntonioNina be56304
Merge branch 'develop' into task/FOUR-26777
nolanpro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -239,8 +239,23 @@ function ($__data, $user_id, $assigned_groups) { | |
| // If no manager is found, then assign the task to the Process Manager. | ||
| $request = ProcessRequest::find($__data['_request']['id']); | ||
| $process = $request->processVersion; | ||
| $managers = $process->manager_id ?? []; | ||
|
|
||
| return $process->manager_id; | ||
| if (empty($managers)) { | ||
| return null; | ||
| } | ||
|
|
||
| // Sort managers to ensure consistent round robin distribution | ||
| sort($managers); | ||
|
|
||
| // Use a combination of process ID and request ID for better distribution | ||
| // This ensures different processes don't interfere with each other's round robin | ||
| $processId = $process->id ?? 0; | ||
| $requestId = $__data['_request']['id'] ?? 0; | ||
| $seed = $processId + $requestId; | ||
| $managerIndex = $seed % count($managers); | ||
|
|
||
| return $managers[$managerIndex]; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
|
|
||
| return $user->manager_id; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.