1313use Laravel \Scout \Searchable ;
1414use Log ;
1515use ProcessMaker \Casts \MillisecondsToDateCast ;
16- use ProcessMaker \Contracts \ConditionalRedirectServiceInterface ;
1716use ProcessMaker \Events \ActivityAssigned ;
1817use ProcessMaker \Events \ActivityReassignment ;
1918use 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 /**
0 commit comments