- Wed Apr 06, 2016 7:28 am
#785041
Hello,
I'd like to route last task with current user logged:
I have following code from wiki:
-----------------------------
$caseId = @@APPLICATION;
//lookup the user assigned to the next task in the case
$query = "SELECT AD.DEL_INDEX, U.USR_USERNAME
FROM APP_DELEGATION AD, USERS U
WHERE AD.APP_UID='$caseId' AND
AD.DEL_INDEX=(SELECT MAX(DEL_INDEX) FROM APP_DELEGATION WHERE APP_UID='$caseId')
AND AD.USR_UID=U.USR_UID";
$result = executeQuery($query);
$nextUser = $result[1]['USR_USERNAME'];
$nextIndex = $result[1]['DEL_INDEX'];
//lookup the md5 hash for the password
$result = executeQuery("SELECT USR_PASSWORD FROM USERS WHERE USR_USERNAME='$nextUser'", 'rbac');
$nextPass = 'md5:' . $result[1]['USR_PASSWORD'];
$client = new SoapClient('http://192.168.1.76:2036/sysworkflow/en ... ices/wsdl2');
$params = array(array('userid' => $nextUser, 'password' => $nextPass));
$result = $client->__SoapCall('login', $params);
if ($result->status_code == 0)
$sessionId = $result->message;
else
die("Unable to connect to ProcessMaker.\nError Message: {$result->message}");
$params = array(array(
'sessionId'=> $sessionId,
'caseId' => @@APPLICATION,
'delIndex' => $nextIndex
));
$result = $client->__SoapCall('routeCase', $params);
if ($result->status_code != 0)
die("Error routing case: {$result->message}\n");
-----------------------------------
Code works fine, but when I want to route last task in process ( Rejected, Approved ), then the status does not change to completed.
Could you please advise what parameter should be updated in order to get process completed.
Thank you for help
Adrian
I'd like to route last task with current user logged:
I have following code from wiki:
-----------------------------
$caseId = @@APPLICATION;
//lookup the user assigned to the next task in the case
$query = "SELECT AD.DEL_INDEX, U.USR_USERNAME
FROM APP_DELEGATION AD, USERS U
WHERE AD.APP_UID='$caseId' AND
AD.DEL_INDEX=(SELECT MAX(DEL_INDEX) FROM APP_DELEGATION WHERE APP_UID='$caseId')
AND AD.USR_UID=U.USR_UID";
$result = executeQuery($query);
$nextUser = $result[1]['USR_USERNAME'];
$nextIndex = $result[1]['DEL_INDEX'];
//lookup the md5 hash for the password
$result = executeQuery("SELECT USR_PASSWORD FROM USERS WHERE USR_USERNAME='$nextUser'", 'rbac');
$nextPass = 'md5:' . $result[1]['USR_PASSWORD'];
$client = new SoapClient('http://192.168.1.76:2036/sysworkflow/en ... ices/wsdl2');
$params = array(array('userid' => $nextUser, 'password' => $nextPass));
$result = $client->__SoapCall('login', $params);
if ($result->status_code == 0)
$sessionId = $result->message;
else
die("Unable to connect to ProcessMaker.\nError Message: {$result->message}");
$params = array(array(
'sessionId'=> $sessionId,
'caseId' => @@APPLICATION,
'delIndex' => $nextIndex
));
$result = $client->__SoapCall('routeCase', $params);
if ($result->status_code != 0)
die("Error routing case: {$result->message}\n");
-----------------------------------
Code works fine, but when I want to route last task in process ( Rejected, Approved ), then the status does not change to completed.
Could you please advise what parameter should be updated in order to get process completed.
Thank you for help
Adrian
Attachments
Screen_923.jpg (21.9 KiB) Viewed 2842 times