I am working on a workflow that assigns an approval task to a user and continues other activities including sending him a notification and others, and then I need to wait for his approval.
I've tried 3 approaches so far:
1. Created an activity that checks if the task has been completed or not, and then rechecks and rechecks, which caused lots of thousands of activities to run and the workflow stops working if the task stays some time not getting completed.
2. Stop the workflow and resume it when the user completes the task via
a. apex_workflow.continue_activity procedure, which didn't work at all because of an error.
declare
v_result number;
l_activity_params wwv_flow_global.vc_map;
begin
apex_workflow.continue_activity(p_instance_id => 123,
p_static_id =>'REJECTED',
p_activity_params => l_activity_params
);
end;
b. Suspend the workflow, but it has to be a workflow administrator that suspends the workflow, which in my case the system itself if I wanna create an activity that stops the workflow.
Any help in these 2 approaches, or suggestions for other workarounds are appreciated.
Thanks.