Skip to content
Merged
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
13 changes: 11 additions & 2 deletions ProcessMaker/Nayra/Repositories/PersistenceTokenTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace ProcessMaker\Nayra\Repositories;

use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Log;
use ProcessMaker\Facades\WorkflowManager;
use ProcessMaker\Listeners\BpmnSubscriber;
use ProcessMaker\Listeners\CommentsSubscriber;
Expand Down Expand Up @@ -166,9 +167,17 @@ public function persistGatewayTokenConsumed(array $transaction)
public function persistGatewayTokenPassed(array $transaction)
{
$gateway = $this->deserializer->unserializeEntity($transaction['gateway']);
$transition = $this->deserializer->unserializeEntity($transaction['transition']);
if (!is_numeric($transaction['transition'])) {
Log::info('Invalid transition id for gateway token passed. ' . json_encode($transaction));
return;
}
$transition = $gateway->getTransitions()[$transaction['transition']] ?? null;
if (empty($transition)) {
Log::info('Invalid transition for gateway token passed. ' . json_encode($transaction));
return;
}
$tokens = $this->deserializer->unserializeTokensCollection($transaction['tokens']);
$this->tokenRepository->persistGatewayTokenPassed($gateway, $tokens[0]);
$this->tokenRepository->persistGatewayTokenPassed($gateway, $tokens->item(0));

// Comments
$subscriber = new CommentsSubscriber();
Expand Down