Skip to content
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

FOUR-19863 Use the right context of data to evaluate parallel task self service assignment #7678

Open
wants to merge 2 commits into
base: release-2024-summer
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions ProcessMaker/Repositories/TokenRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use Illuminate\Support\Facades\Log;
use Mustache_Engine;
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 @@ -128,8 +130,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
Loading