Skip to content

Commit

Permalink
Merge pull request #7673 from ProcessMaker/bugfix/FOUR-19863
Browse files Browse the repository at this point in the history
FOUR-19863 Use the right context of data to evaluate parallel task self service assignment
  • Loading branch information
ryancooley authored Nov 5, 2024
2 parents 0016462 + e5e4335 commit 6e5d287
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ProcessMaker/Repositories/TokenRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
use Mustache_Engine;
use ProcessMaker\Jobs\CaseUpdate;
use ProcessMaker\Mail\TaskActionByEmail;
use ProcessMaker\Managers\DataManager;
use ProcessMaker\Models\FeelExpressionEvaluator;
use ProcessMaker\Models\ProcessAbeRequestToken;
use ProcessMaker\Models\ProcessCollaboration;
use ProcessMaker\Models\ProcessRequest as Instance;
Expand Down Expand Up @@ -129,8 +131,11 @@ public function persistActivityActivated(ActivityInterface $activity, TokenInter
$token->self_service_groups = ['users' => $evaluatedUsers, 'groups' => $evaluatedGroups];
break;
case 'process_variable':
$evaluatedUsers = $selfServiceUsers ? $token->getInstance()->getDataStore()->getData($selfServiceUsers) : [];
$evaluatedGroups = $selfServiceGroups ? $token->getInstance()->getDataStore()->getData($selfServiceGroups) : [];
$dataManager = new DataManager();
$tokenData = $dataManager->getData($token);
$feel = new FeelExpressionEvaluator();
$evaluatedUsers = $selfServiceUsers ? $feel->render($selfServiceUsers, $tokenData) ?? null: [];
$evaluatedGroups = $selfServiceGroups ? $feel->render($selfServiceGroups, $tokenData) ?? null : [];

// If we have single values we put it inside an array
$evaluatedUsers = is_array($evaluatedUsers) ? $evaluatedUsers : [$evaluatedUsers];
Expand Down

0 comments on commit 6e5d287

Please sign in to comment.