Share ideas, ask questions, and get feedback about developing for ProcessMaker

Moderator: ArturoRobles

Forum rules: Please post new questions under "Developing processes & programming" for ProcessMaker 2 or 3.
By Rachma
#828848
hi everyone,

has anyone try using setCatchUser function?
my code using that function below did not work
please help
Code: Select all
$fetched_queued = "SELECT * FROM PMT_CANCELL_WELCOME_CALL WHERE STATUS = 'QUEUE'";
$fetched_queued = executeQuery($fetched_queued);
foreach($fetched_queued as $queued_key=>$queued_value){
	$Caseno=$queued_value['CASENO'];
	$expiry_date_seconds = strtotime($queued_value['DUEDATE']);
	$query= "SELECT * FROM APP_CACHE_VIEW WHERE APP_NUMBER='$Caseno' AND (APP_STATUS='TO_DO' OR APP_STATUS='DRAFT') AND DEL_THREAD_STATUS='OPEN'";
	//echo "<pre>";
	$aCases = executeQuery($query);
	if (count($aCases)==0) {
		//echo "tidak ";
		$update="UPDATE PMT_CANCELL_WELCOME_CALL SET STATUS = 'COMP' WHERE CASENO = '$Caseno'";
		executeQuery($update);
	    //die("Error: Bad Query: $query\n");
	}else{
		echo "$Caseno";
	}
	foreach ($aCases as $aCase) {
	   $c = new Cases();
	   $aCaseInfo = $c->loadCase($aCase['APP_UID'], $aCase['DEL_INDEX']);
	   $aData = array(
		  'caseNo' => $aCase['APP_NUMBER'],
		  'caseTitle' => $aCase['APP_TITLE'],
		  'caseStatus' => $aCase['APP_STATUS'],
		  'taskName' => $aCase['APP_TASK_TITLE'],
		  'taskAssignedDate' => $aCase['DEL_DELEGATE_DATE'],
		  'taskDueDate' => $aCase['DEL_TASK_DUE_DATE'],
		  'caseCreatedBy' => $aCaseInfo['CREATOR'],
		  'caseStartDate' => $aCaseInfo['CREATE_DATE'],
		  'caseUpdatedDate'=> $aCaseInfo['UPDATE_DATE'],
		  'caseLink' => (G::is_https() ? "https://" : "http://") . $_SERVER['SERVER_NAME'] . 
			  ':' . $_SERVER['SERVER_PORT'] . //comment out if no port number
			  '/sys'[email protected]#SYS_SYS.'/'[email protected]#SYS_LANG.'/'[email protected]#SYS_SKIN.'/cases/open?APP_UID=' . 
			  $aCase['APP_UID'] . '&DEL_INDEX=' . $aCase['DEL_INDEX'] . '&action=draft' 
	   );
			//set the date here*******************************
			
			if(($expiry_date_seconds==strtotime(date('Y-m-d'))) or ($expiry_date_seconds<strtotime(date('Y-m-d')))){
				//enable this code to test cancel case
				@@indNew=$aCase['DEL_INDEX'];
				$appuid=$aCase['APP_UID'];
				[email protected]%indNew + 1;
				//echo @@indNew;
				$app= @@APPLICATION;
				//echo "$app";
				echo "<pre>";
				//echo "$aCase['APP_UID']";
				//$d=new cases();
				echo "oke";
				$c->setCatchUser($appuid, $indexbaru,"7648899695d9ec252724b35018079376");
				echo "oke";
				
				@@return=PMFCancelCase($aCase['APP_UID'], $aCase['DEL_INDEX'], $aCaseInfo['CURRENT_USER_UID']);
				if (@@return=="1"){
					$update="UPDATE PMT_CANCELL_WELCOME_CALL SET STATUS = 'CANCEL' WHERE CASENO = '$Caseno'";
					executeQuery($update);
					echo "CANCELLED";
				}else{
					echo "UNCANCELLED";
				}
				
			}else{
			  echo "not yet achieve 90 days";
			}

			$aUser = userInfo($aCase['USR_UID']);
	}
}

exit;
By jessicajessi
#828849
AWS Training in Chennai .Amazon Web Services is a subsidiary of Amazon providing on-demand cloud computing platforms and APIs to individuals, companies, and governments, on a metered pay-as-you-go basis.The AWS technology is implemented at server farms throughout the world, and maintained by the Amazon subsidiary. Fees are based on a combination of usage (known as a "Pay-as-you-go" model), hardware, operating system, software, or networking features chosen by the subscriber required availability, redundancy, security, and service options. Subscribers can pay for a single virtual AWS computer, a dedicated physical computer, or clusters of either. As part of the subscription agreement.

For AWS Training in Hyderabad : https://www.acte.in/AWS-training-in-hyderabad

Hello guys! I want to build a process which each […]

The students, who feel helpless in the face of aca[…]

If I create a report table in an existing process […]