ProcessMaker code contributions
User avatar
By ashkufaraz
#780345

in process maker I assign some tasks usedStart Custom ``Task action to some users,

I want to know that is there any way to roll back to previous tasks in such a workflow,

for example if one of users (user1) reject task by mistake and workflow create another task

for next user (user2), is it possible to roll back workflow to previous step and assign task

to user1 again?

I'll be appreciated if anyone could help me.
User avatar
By ashkufaraz
#780365
hi,
thanks for replay.
if one of users (user1) reject task by mistake and workflow create another task
for next user (user2) then in these circumstances,what to do?
---------------------------------------------------------------------
in the big system with diffrent process and sub process.
we have add new evalution for any task?
---------------------------------------------------------------------
or
in the municipal systems
Mayor wants to change workflow and roll back a specific task to custom task
User avatar
By ashkufaraz
#782597
should delete record from end list of sub_application and app_delegation until record required

with this code i can restore case from anywhere to anywhere
Code: Select all
foreach($GLOBALS['gridHistory'] as $cuurentTask)
{
		$cuurentTask["PRO_UID"] =$dbHandle->Convertnumber2english(trim($cuurentTask["PRO_UID"]));
		$cuurentTask["TAS_UID"] =$dbHandle->Convertnumber2english(trim($cuurentTask["TAS_UID"]));
		$cuurentTask["DEL_INDEX"]=$dbHandle->Convertnumber2english(trim($cuurentTask["DEL_INDEX"]));
		
		if($cuurentTask["PRO_UID"]!==$to_PRO_UID || $cuurentTask["TAS_UID"]!==$to_TAS_UID || $cuurentTask["DEL_INDEX"]!==$to_DEL_INDEX)
		{ 
			$task_type=task_type($cuurentTask["TAS_UID"],$cuurentTask["PRO_UID"]);
			
			$inPath=checkForExistInPath($to_APP_UID,$cuurentTask["APP_UID"],$to_DEL_INDEX,$cuurentTask["DEL_INDEX"]);
			    
			if($task_type=="NORMAL" && $inPath )
			{		
					if(rollbackAppDelegate($cuurentTask["APP_UID"],$cuurentTask["DEL_INDEX"])!=1)
						die('خطا در بازگرداندن کار نرمال '.$cuurentTask["APP_UID"]);
			}
			else if($task_type=="SUBPROCESS" && $inPath)
			{
				$sub_application=$baseClass->query("select APP_UID from sub_application where app_parent='".$cuurentTask["APP_UID"]."' and DEL_INDEX_PARENT='".$cuurentTask["DEL_INDEX"]."'");
				if(deleteSubProcess($sub_application[0]["APP_UID"])!=1)
					die('خطا در حذف زیر فرآیند'.$sub_application[0]["APP_UID"]);
				if(rollbackAppDelegate($cuurentTask["APP_UID"],$cuurentTask["DEL_INDEX"])!=1)
					die('خطا در بازگرداندن کار موازی'.$cuurentTask["APP_UID"]);
			}
			else
				echo 'امکان انتقال وجود ندارد.';
		}
		else
		{
			if($APP_CUR_USER=$baseClass->query("select USR_UID from app_delegation where app_delegation.APP_UID='{$cuurentTask['APP_UID']}' order by DEL_INDEX desc LIMIT 1"))
				if($baseClass->query("update app_delegation set DEL_THREAD_STATUS='OPEN' , DEL_FINISH_DATE=null where  app_delegation.APP_UID='{$cuurentTask['APP_UID']}' and app_delegation.DEL_INDEX='{$cuurentTask["DEL_INDEX"]}';"))
					if($baseClass->query("update application set APP_STATUS='TO_DO' , APP_FINISH_DATE=null,APP_CUR_USER='{$APP_CUR_USER[0]["USR_UID"]}' where  application.APP_UID='{$cuurentTask['APP_UID']}';"))
					{
						echo 'true';
						break;
					}
					else
						echo 'false';
		}
}  
By touhamm
#786192
Hi ashkufaraz,

Where do you run this code? I need to roll back a case but I should not access it. In my use cases, roll backs are requested by users who make mistakes and want to go a step back to correct it. If I need to step in and enter the trigger my self, then I would be involved in the case while I should not.

Regards.

A 1xbet clone script is a pre-designed software so[…]

4rabet clone script is enabling entrepreneurs to e[…]

Parimatch clone script is enabling entrepreneurs t[…]

In the world of cryptocurrency, a wallet is an app[…]