Page 1 of 1

roll back a case to previous step

Posted: Mon Sep 22, 2014 9:54 am
by ashkufaraz

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.

Re: roll back a case to previous step

Posted: Mon Sep 22, 2014 11:19 am
by liliana
Hi,

To go back in your process you can use the Selection Routing Rule, depending on a condition your case will go back to the task you have to define.

To derive your case to the same user you can use the attached example.

Regards,

Re: roll back a case to previous step

Posted: Tue Sep 23, 2014 12:35 am
by ashkufaraz
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

Re: roll back a case to previous step

Posted: Wed Sep 24, 2014 1:20 am
by ashkufaraz
db=workflow
by change app_delegate and app_cache_view and app_thread i could create new refrence between task of one process

Re: roll back a case to previous step

Posted: Mon Apr 06, 2015 1:58 am
by ashkufaraz
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';
		}
}  

Re: roll back a case to previous step

Posted: Tue Jul 26, 2016 9:35 am
by touhamm
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.