Skip to content

Commit b6a50b2

Browse files
committed
Revert "Merge pull request #8544 from ProcessMaker/feature/FOUR-26707"
This reverts commit 272750c, reversing changes made to a804b1a.
1 parent b5e9070 commit b6a50b2

File tree

9 files changed

+3
-1194
lines changed

9 files changed

+3
-1194
lines changed

ProcessMaker/Contracts/ConditionalRedirectServiceInterface.php

Lines changed: 0 additions & 32 deletions
This file was deleted.

ProcessMaker/Events/ProcessUpdated.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ class ProcessUpdated implements ShouldBroadcastNow
2626

2727
public $activeTokens;
2828

29-
public $elementDestination;
30-
3129
/**
3230
* Create a new event instance.
3331
*
@@ -43,7 +41,6 @@ public function __construct(ProcessRequest $processRequest, $event, TokenInterfa
4341
if ($token) {
4442
$this->tokenId = $token->getId();
4543
$this->elementType = $token->element_type;
46-
$this->elementDestination = $token->elementDestination;
4744
}
4845
}
4946

ProcessMaker/Models/ProcessRequestToken.php

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use Laravel\Scout\Searchable;
1414
use Log;
1515
use ProcessMaker\Casts\MillisecondsToDateCast;
16-
use ProcessMaker\Contracts\ConditionalRedirectServiceInterface;
1716
use ProcessMaker\Events\ActivityAssigned;
1817
use ProcessMaker\Events\ActivityReassignment;
1918
use ProcessMaker\Facades\WorkflowUserManager;
@@ -1395,28 +1394,10 @@ public function reassign($toUserId, User $requestingUser, $comments = '')
13951394
*
13961395
* @return array|null Returns the destination URL.
13971396
*/
1398-
private function getElementDestination($elementDestinationType, $elementDestinationProp, array $conditionalRedirectProp): ?array
1397+
private function getElementDestination($elementDestinationType, $elementDestinationProp): ?array
13991398
{
14001399
$elementDestination = null;
14011400

1402-
if (!empty($conditionalRedirectProp['isEnabled']) && !empty($conditionalRedirectProp['conditions'])) {
1403-
$result = $this->evaluateConditionalRedirect(app(ConditionalRedirectServiceInterface::class), $conditionalRedirectProp);
1404-
if ($result) {
1405-
$elementDestinationType = $result['taskDestination']['value'];
1406-
1407-
$url = match ($elementDestinationType) {
1408-
'customDashboard' => $result['customDashboard']['url'] ?? null,
1409-
'externalURL' => $result['externalUrl'] ?? null,
1410-
default => null,
1411-
};
1412-
1413-
$elementDestinationProp = [
1414-
'value' => [
1415-
'url' => $url,
1416-
],
1417-
];
1418-
}
1419-
}
14201401
switch ($elementDestinationType) {
14211402
case 'anotherProcess':
14221403
case 'customDashboard':
@@ -1460,15 +1441,6 @@ private function getElementDestination($elementDestinationType, $elementDestinat
14601441
];
14611442
}
14621443

1463-
private function evaluateConditionalRedirect(ConditionalRedirectServiceInterface $conditionalRedirectService, array $conditionalRedirectProp): ?array
1464-
{
1465-
if (!$conditionalRedirectProp['isEnabled']) {
1466-
return null;
1467-
}
1468-
1469-
return $conditionalRedirectService->resolveForToken($conditionalRedirectProp['conditions'], $this);
1470-
}
1471-
14721444
/**
14731445
* Determines the destination URL based on the element destination type specified in the definition.
14741446
*
@@ -1479,8 +1451,6 @@ public function getElementDestinationAttribute(): ?array
14791451
$definition = $this->getDefinition();
14801452
$elementDestinationProp = $definition['elementDestination'] ?? null;
14811453
$elementDestinationType = null;
1482-
$conditionalRedirectProp = $definition['conditionalRedirect'] ?? '[]';
1483-
$conditionalRedirectProp = json_decode($conditionalRedirectProp, true);
14841454

14851455
try {
14861456
$elementDestinationProp = json_decode($elementDestinationProp, true);
@@ -1491,7 +1461,7 @@ public function getElementDestinationAttribute(): ?array
14911461
return null;
14921462
}
14931463

1494-
return $this->getElementDestination($elementDestinationType, $elementDestinationProp, $conditionalRedirectProp);
1464+
return $this->getElementDestination($elementDestinationType, $elementDestinationProp);
14951465
}
14961466

14971467
/**

ProcessMaker/Providers/ProcessMakerServiceProvider.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
use ProcessMaker\Cache\Settings\SettingCacheManager;
3030
use ProcessMaker\Console\Commands\HorizonListen;
3131
use ProcessMaker\Console\Migration\ExtendedMigrateCommand;
32-
use ProcessMaker\Contracts\ConditionalRedirectServiceInterface;
3332
use ProcessMaker\Events\ActivityAssigned;
3433
use ProcessMaker\Events\ScreenBuilderStarting;
3534
use ProcessMaker\Events\TenantResolved;
@@ -50,7 +49,6 @@
5049
use ProcessMaker\PolicyExtension;
5150
use ProcessMaker\Providers\PermissionServiceProvider;
5251
use ProcessMaker\Repositories\SettingsConfigRepository;
53-
use ProcessMaker\Services\ConditionalRedirectService;
5452
use RuntimeException;
5553
use Spatie\Multitenancy\Events\MadeTenantCurrentEvent;
5654
use Spatie\Multitenancy\Events\TenantNotFoundForRequestEvent;
@@ -243,12 +241,6 @@ public function register(): void
243241
});
244242

245243
$this->app->instance('tenant-resolved', false);
246-
247-
/**
248-
* Conditional Redirect Service
249-
* This service is used to evaluate the conditional redirect property of a process request token.
250-
*/
251-
$this->app->bind(ConditionalRedirectServiceInterface::class, ConditionalRedirectService::class);
252244
}
253245

254246
/**

ProcessMaker/Services/ConditionalRedirectService.php

Lines changed: 0 additions & 220 deletions
This file was deleted.

0 commit comments

Comments
 (0)