Skip to content

Commit 7a65997

Browse files
authored
Merge pull request #8545 from ProcessMaker/FOUR-26713
FOUR-26713 Make the adjustments required in ScreenBuilder to support the Conditional Destination
2 parents 0b6d83a + 27f68dd commit 7a65997

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

ProcessMaker/Events/ProcessUpdated.php

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

2727
public $activeTokens;
2828

29+
public $elementDestination;
30+
2931
/**
3032
* Create a new event instance.
3133
*
@@ -41,6 +43,7 @@ public function __construct(ProcessRequest $processRequest, $event, TokenInterfa
4143
if ($token) {
4244
$this->tokenId = $token->getId();
4345
$this->elementType = $token->element_type;
46+
$this->elementDestination = $token->elementDestination;
4447
}
4548
}
4649

ProcessMaker/Models/ProcessRequestToken.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,10 +1317,17 @@ private function getElementDestination($elementDestinationType, $elementDestinat
13171317
$result = $this->evaluateConditionalRedirect(app(ConditionalRedirectServiceInterface::class), $conditionalRedirectProp);
13181318
if ($result) {
13191319
$elementDestinationType = $result['taskDestination']['value'];
1320+
1321+
$url = match ($elementDestinationType) {
1322+
'customDashboard' => $result['customDashboard']['url'] ?? null,
1323+
'externalURL' => $result['externalUrl'] ?? null,
1324+
default => null,
1325+
};
1326+
13201327
$elementDestinationProp = [
13211328
'value' => [
1322-
'url' => ($result['customDashboard']['url'] ?? null) ?: ($result['externalUrl'] ?? null),
1323-
]
1329+
'url' => $url,
1330+
],
13241331
];
13251332
}
13261333
}
@@ -1372,6 +1379,7 @@ private function evaluateConditionalRedirect(ConditionalRedirectServiceInterface
13721379
if (!$conditionalRedirectProp['isEnabled']) {
13731380
return null;
13741381
}
1382+
13751383
return $conditionalRedirectService->resolveForToken($conditionalRedirectProp['conditions'], $this);
13761384
}
13771385

0 commit comments

Comments
 (0)