- Fri Feb 15, 2019 2:07 am
#822949
Hi all, here's where I'm stuck. Here's what my workflow looks like:
Here's what I'm trying to do.. a document gets submitted and all 5 approvers have the opportunity to approve it. Once one of them approves it the workflow should continue for 1 case and the other 4 cases should do nothing (go to far right) End Event.
After one of the approvers reviews the dynaform and approves the request it should run the trigger. The code for the trigger I got in the forums:
This is what it looks like after one of the members approves it:
I want to have only 1 flow go to the Create Eventbrite and the other 4 to End.. it seems like the trigger only ever runs on 1 of the previous tasks. I did verify the Task IDs were correct by querying mysql. What am I doing wrong?
Thanks for any help.
Here's what I'm trying to do.. a document gets submitted and all 5 approvers have the opportunity to approve it. Once one of them approves it the workflow should continue for 1 case and the other 4 cases should do nothing (go to far right) End Event.
After one of the approvers reviews the dynaform and approves the request it should run the trigger. The code for the trigger I got in the forums:
Code: Select all
Here's what the case layout looks like after it is created (this is as expected):$caseId = @@APPLICATION;
@@task_taken = true;
//set to the IDs of the 3 parallel tasks.
//(You can find them by looking at the @@TASK variable in the Debugger while running cases):
$aTasks = array(
'3645403925c65af61c647f7058166380',
'6646433025c65af62050a49044001044',
'2666452175c65af60ccf6c6025265082',
'1360269725c65af619bcdd4054211402',
'8891732165c65af60ac2f99040883054'
);
$aTasksToCancel = array();
foreach ($aTasks as $taskId) {
if ($taskId != @@TASK)
$aTasksToCancel[] = $taskId;
}
foreach ($aTasksToCancel as $taskId) {
// select = @@APPLICATION;
//lookup the delegation index and the user name and the MD5 hash of that user assigned to the other parallel task:
$query = "select AD.DEL_INDEX, RU.USR_USERNAME, RU.USR_PASSWORD
from APP_DELEGATION AD, RBAC_USERS RU
where AD.APP_UID='$caseId' and AD.TAS_UID='$taskId' and AD.DEL_THREAD_STATUS='OPEN' and
AD.USR_UID=RU.USR_UID ";
$result = executeQuery($query);
if (!is_array($result) or count($result) == 0)
die("Error in query:<br>$query<br>Or there is no parallel task.");
$delIndex = $result[1]['DEL_INDEX'];
$username = $result[1]['USR_USERNAME'];
$pass = 'md5:' . $result[1]['USR_PASSWORD'];
$url = 'https://'. $_SERVER['SERVER_NAME']
. '/sys' . @@SYS_SYS . '/en/classic/services/wsdl2';
//login via web services:
$client = new SoapClient($url);
$params = array(array('userid'=>$username, 'password'=> $pass));
$result = $client->__SoapCall('login', $params);
if ($result->status_code == 0)
$sessionId = $result->message;
else
die('Unable to connect to ProcessMaker.<br>Error Message:<br>' . $result->message);
$params = array(array(
'sessionId' => $sessionId,
'caseId' => $caseId,
'delIndex' => $delIndex
));
$result = $client->__SoapCall('routeCase', $params);
if ($result->status_code != 0)
die("Error routing case:<br>" . $result->message);
}
This is what it looks like after one of the members approves it:
I want to have only 1 flow go to the Create Eventbrite and the other 4 to End.. it seems like the trigger only ever runs on 1 of the previous tasks. I did verify the Task IDs were correct by querying mysql. What am I doing wrong?
Thanks for any help.