From 4bd544b07a7368e296ab2c6d2ae249599ac53977 Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Tue, 1 Feb 2022 11:43:51 -0400 Subject: [PATCH 1/2] PMCORE-2490 --- workflow/engine/classes/class.pmFunctions.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/workflow/engine/classes/class.pmFunctions.php b/workflow/engine/classes/class.pmFunctions.php index 5da34277b..b4e7be18f 100644 --- a/workflow/engine/classes/class.pmFunctions.php +++ b/workflow/engine/classes/class.pmFunctions.php @@ -1159,10 +1159,11 @@ function WSDerivateCase ($caseId, $delIndex) * @param string(32) | $value1 | Value of the first variable | The value of the first variable to be sent to the created case. * @param string(32) | $name2 | Name of the second variable | The name of the second variable to be sent to the created case. * @param string(32) | $value2 | Value of the second variable | The value of the second variable to be sent to the created case. + * @param string(32) | $taskId | Task ID | The unique ID for the task * @return array | $fields | WS Response Associative Array | A WS Response associative array. * */ -function WSNewCaseImpersonate ($processId, $userId, $name1, $value1, $name2, $value2) +function WSNewCaseImpersonate ($processId, $userId, $name1, $value1, $name2, $value2, $taskId) { $client = WSOpen(); @@ -1176,14 +1177,17 @@ function WSNewCaseImpersonate ($processId, $userId, $name1, $value1, $name2, $va $v2->name = $name2; $v2->value = $value2; - $variables = array ($v1,$v2 - ); + $variables = [$v1,$v2]; - $params = array ("sessionId" => $sessionId,"processId" => $processId,"userId" => $userId,"variables" => $variables - ); + $params = [ + "sessionId" => $sessionId, + "processId" => $processId, + "taskId" => $taskId, + "userId" => $userId, + "variables" => $variables + ]; - $result = $client->__soapCall( "NewCaseImpersonate", array ($params - ) ); + $result = $client->__soapCall("NewCaseImpersonate", [$params]); $fields["status_code"] = $result->status_code; $fields["message"] = $result->message; From b6e2748d9eb9eb58c059d9c089c962074ba37c4f Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Tue, 1 Feb 2022 14:49:28 -0400 Subject: [PATCH 2/2] PMCORE-2491 --- workflow/engine/classes/class.pmFunctions.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/workflow/engine/classes/class.pmFunctions.php b/workflow/engine/classes/class.pmFunctions.php index b4e7be18f..998036d91 100644 --- a/workflow/engine/classes/class.pmFunctions.php +++ b/workflow/engine/classes/class.pmFunctions.php @@ -1159,11 +1159,11 @@ function WSDerivateCase ($caseId, $delIndex) * @param string(32) | $value1 | Value of the first variable | The value of the first variable to be sent to the created case. * @param string(32) | $name2 | Name of the second variable | The name of the second variable to be sent to the created case. * @param string(32) | $value2 | Value of the second variable | The value of the second variable to be sent to the created case. - * @param string(32) | $taskId | Task ID | The unique ID for the task + * @param string(32) | $taskId = '' | Task ID | The unique ID for the task * @return array | $fields | WS Response Associative Array | A WS Response associative array. * */ -function WSNewCaseImpersonate ($processId, $userId, $name1, $value1, $name2, $value2, $taskId) +function WSNewCaseImpersonate ($processId, $userId, $name1, $value1, $name2, $value2, $taskId = '') { $client = WSOpen(); @@ -3205,16 +3205,16 @@ function PMFUnCancelCase($caseUID, $userUID) * @name PMFDynaFormFields * @label PMF DynaForm Fields * @param string | $dynUid | Dynaform ID | Id of the dynaform - * @param string | $appUid | Case ID | Id of the case - * @param int | $delIndex | Delegation index | Delegation index for case + * @param string | $appUid = '' | Case ID | Id of the case + * @param int | $delIndex = 0| Delegation index | Delegation index for case * @return array | $fields | List of fields | Return a list of fields */ -function PMFDynaFormFields($dynUid, $appUid = false, $delIndex = 0) +function PMFDynaFormFields($dynUid, $appUid = '', $delIndex = 0) { - $fields = array(); - $data = array(); + $fields = []; + $data = []; - if ($appUid !== false) { + if (!empty($appUid)) { if ($delIndex < 0) { throw new Exception(G::LoadTranslation('ID_INVALID_DELEGATION_INDEX_FOR_CASE') . "'" . $appUid . "'."); }