You are viewing limited content. For full access, please sign in.

Question

Question

Manual Delete all Tasks

asked on May 31, 2022

Is there a way to manually delete all tasks that isn't from the monitor tab?   We have a client that had a runaway WF kicking off forms processes.  To terminate things the user deleted the Forms process.  Normally, this would delete the process and terminate the tasks.  Unfortunately, there were an extremely large amount of tasks (40,000+), and deleting the form did delete the form but did not remove the tasks.  They are now stuck with 40,000+ tasks that do not show up in the monitor tab, but are stuck in the inbox.  So we're looking for a way to remove these, any advice?

0 0

Replies

replied on January 6, 2023

We have improved the mechanism of clean up large amount tasks when delete process in Forms 11 Update 3. It should not happen again to leave large amount of tasks after delete process. 

You can see other changes of Forms 11 Update 3 from  https://support.laserfiche.com/kb/1014413/list-of-changes-for-laserfiche-forms-11-update-3 and get Forms 11 Update 3 from Laserfiche 11 package  https://support.laserfiche.com/kb/1014263/software-versions-and-fixes-included-in-the-laserfiche-11-download-package

1 0
replied on May 31, 2022

I've never heard of something showing tasks but not instances.  Wonder if it's still working through the deletion or failed somehow during the deletion process.  If it failed, it might require some cleanup of the database itself.  It might be worth checking event logs to see if there is any sign of the deltions still being ongoing or having failed.

Forms 11 Update 2 includes the ability to see tasks on the Monitoring page instead of just instances, if they are on the version, it might be worth checking there.

Beyond that , this might be one of those types of situations where your best bet will be to get a case open with Laserfiche Support.

0 0
replied on May 31, 2022 Show version history

I have this query set-up as a view on my LFForms database.  It (sort of) mimics the Monitor page, listing all the instances and breaking out who they are assigned to (you'll likely see more items than the monitor page, since that shows things like "assigned to 3 users" when this will return 3 lines for that same record).

Perhaps something like this could be useful for determining if the list of active tasks is still decreasing from an ongoing deletion process or if it is static.

SELECT        [Process Name], [Instance name], [Started by], [Last updated], [Assigned to], [Assigned to (username)], [Assigned to (email)], [Current step], [Step start date], [Start date], [Instance ID], [Step due date]
FROM            (SELECT        instance.bp_name AS [Process Name], instance.title AS [Instance name], CASE WHEN start_user.displayname LIKE '%WORKFLOW%' THEN 'Workflow' ELSE start_user.displayname END AS [Started by], 
                                                    instance.lastacted_date AS [Last updated], CASE WHEN bp_worker_resume.status = 5 AND assigned_user_snapshot.displayname IS NOT NULL 
                                                    THEN assigned_user_snapshot.displayname WHEN bp_worker_resume.status = 5 AND assigned_user_snapshot.displayname IS NULL 
                                                    THEN assigned_user_record.displayname WHEN bp_worker_resume.status = 2 THEN assigned_user_snapshot.displayname WHEN assigned_user_team_snapshot.displayname IS NULL AND 
                                                    teams.name IS NOT NULL THEN CONCAT(teams.name, ' (Listing the Team Manager)') WHEN assigned_user_team_snapshot.displayname IS NULL 
                                                    THEN teams.name WHEN bp_worker_resume.status = 1 THEN assigned_user_team_snapshot.displayname END AS [Assigned to], CASE WHEN bp_worker_resume.status = 5 AND 
                                                    assigned_user_snapshot.username IS NOT NULL THEN assigned_user_snapshot.username WHEN bp_worker_resume.status = 2 AND assigned_user_snapshot.username IS NOT NULL 
                                                    THEN assigned_user_snapshot.username WHEN assigned_user_team_snapshot.displayname IS NULL AND team_users.username IS NOT NULL 
                                                    THEN team_users.username WHEN bp_worker_resume.status = 1 AND assigned_user_team_snapshot.username IS NOT NULL 
                                                    THEN assigned_user_team_snapshot.username ELSE 'Laserfiche Administrator' END AS [Assigned to (username)], CASE WHEN bp_worker_resume.status = 5 AND 
                                                    assigned_user_snapshot.displayname IS NOT NULL AND assigned_user_snapshot.email IS NOT NULL THEN assigned_user_snapshot.email WHEN bp_worker_resume.status = 5 AND 
                                                    assigned_user_snapshot.displayname IS NULL AND assigned_user_record.email IS NOT NULL THEN assigned_user_record.email WHEN bp_worker_resume.status = 2 AND 
                                                    assigned_user_snapshot.email IS NOT NULL THEN assigned_user_snapshot.email WHEN assigned_user_team_snapshot.displayname IS NULL AND team_users.email IS NOT NULL 
                                                    THEN team_users.email WHEN bp_worker_resume.status = 1 AND assigned_user_team_snapshot.email IS NOT NULL 
                                                    THEN assigned_user_team_snapshot.email ELSE 'laserfiche.administrator@amucu.org' END AS [Assigned to (email)], CASE WHEN bp_worker_resume.step_name IS NOT NULL 
                                                    THEN bp_worker_resume.step_name ELSE bp_steps.name END AS [Current step], CASE WHEN bp_worker_resume.assign_date IS NOT NULL 
                                                    THEN bp_worker_resume.assign_date ELSE bp_worker.update_date END AS [Step start date], instance.start_date AS [Start date], instance.bp_instance_id AS [Instance ID], 
                                                    bp_worker_resume.due_date AS [Step due date]
                          FROM            dbo.cf_bp_main_instances AS instance LEFT OUTER JOIN
                                                    dbo.cf_user_snapshot AS start_user_snapshot ON start_user_snapshot.id = instance.user_snapshot_id LEFT OUTER JOIN
                                                    dbo.cf_users AS start_user ON start_user.user_id = start_user_snapshot.user_id LEFT OUTER JOIN
                                                    dbo.cf_bp_worker_instances AS bp_worker ON bp_worker.bp_instance_id = instance.bp_instance_id LEFT OUTER JOIN
                                                    dbo.cf_bp_steps AS bp_steps ON bp_steps.step_id = bp_worker.current_step_id AND bp_steps.process_id = bp_worker.current_process_id AND (bp_steps.step_type = 'catchEvent' OR
                                                    bp_steps.step_type = 'serviceTask') AND bp_steps.is_deleted = 0 LEFT OUTER JOIN
                                                    dbo.cf_bp_worker_instnc_to_resume AS bp_worker_resume ON bp_worker_resume.worker_instance_id = bp_worker.instance_id LEFT OUTER JOIN
                                                    dbo.cf_bp_worker_instance_history AS bp_worker_history ON bp_worker_history.instance_id = bp_worker.instance_id AND (bp_worker_history.status = 'assigned' OR
                                                    bp_worker_history.status = 'reassigned') AND bp_worker_resume.resume_id = bp_worker_history.assigned_resume_id AND bp_worker_resume.owner_snapshot_id IS NULL LEFT OUTER JOIN
                                                    dbo.cf_user_snapshot AS assigned_user_snapshot ON assigned_user_snapshot.id = bp_worker_resume.owner_snapshot_id LEFT OUTER JOIN
                                                    dbo.cf_users AS assigned_user_record ON assigned_user_record.username = assigned_user_snapshot.username LEFT OUTER JOIN
                                                    dbo.cf_user_snapshot AS assigned_user_team_snapshot ON assigned_user_team_snapshot.id = bp_worker_history.target_snapshot_id LEFT OUTER JOIN
                                                    dbo.teams AS teams ON (teams.id = bp_worker_resume.team_id OR
                                                    bp_worker_resume.team_id IS NULL AND teams.id = bp_worker_history.team_id) AND bp_worker_resume.owner_snapshot_id IS NULL LEFT OUTER JOIN
                                                    dbo.team_members AS team_members ON team_members.team_id = teams.id AND team_members.member_rights = 3 AND team_members.leave_date IS NULL LEFT OUTER JOIN
                                                    dbo.cf_users AS team_users ON team_users.user_id = team_members.user_group_id
                          WHERE        (instance.status = 1) AND (bp_worker.status <> 6) AND (bp_worker_resume.status = 5 OR
                                                    bp_worker_resume.status = 1 OR
                                                    bp_worker_resume.status = 2) AND (bp_worker_resume.assign_date IS NOT NULL) AND (bp_steps.step_type IS NULL OR
                                                    bp_steps.step_type = 'catchEvent') OR
                                                    (instance.status = 1) AND (bp_worker.status <> 6) AND (bp_worker_resume.assign_date IS NOT NULL) AND (bp_steps.step_type IS NULL OR
                                                    bp_steps.step_type = 'catchEvent') AND (bp_steps.step_id IS NOT NULL) OR
                                                    (instance.status = 1) AND (bp_worker.status <> 6) AND (bp_worker_resume.status = 5 OR
                                                    bp_worker_resume.status = 1 OR
                                                    bp_worker_resume.status = 2) AND (bp_steps.step_type IS NULL OR
                                                    bp_steps.step_type = 'catchEvent') AND (bp_steps.step_id IS NOT NULL) OR
                                                    (instance.status = 1) AND (bp_worker.status <> 6) AND (bp_steps.step_type IS NULL OR
                                                    bp_steps.step_type = 'catchEvent') AND (bp_steps.step_id IS NOT NULL) AND (bp_steps.step_id IS NOT NULL) OR
                                                    (instance.status = 1) AND (bp_worker.status = 3) AND (bp_steps.step_type = 'serviceTask')) AS subquery
GROUP BY [Process Name], [Instance name], [Started by], [Last updated], [Assigned to], [Assigned to (username)], [Assigned to (email)], [Current step], [Step start date], [Start date], [Instance ID], [Step due date]

Note that if you are on a version before 11 Update 2, line 35's reference to user_group_id needs to be user_id instead.

1 0
replied on May 31, 2022 Show version history

Coincidently, we have run into this same exact scenario.  Any luck finding a resolutions?

0 0
replied on May 31, 2022

I found this thread most helpful for this issue.

https://answers.laserfiche.com/questions/98078/Clear-Forms-Results#147054

0 0
replied on June 1, 2022 Show version history

You may have many orphaned tasks left if you delete the process when the Laserfiche Forms Routing Service is stopped at the time the process is deleted(This is a known bug (ID 376970) and it will be fixed with next Forms release). As Lexie mentioned, the solution is to run a similar query I provided at https://answers.laserfiche.com/questions/98078/Clear-Forms-Results#199232. (Do not need "update [dbo].[cf_bp_main_instances] set status=99 where process_id in (select process_id from [cf_bp_processes] where bp_id={bp_id}) and status=2" as those instances have already been set with status 99.

declare @RowCount as Int =0
select @RowCount=count(*) FROM cf_bp_main_instances where status= 99
while @RowCount > 0
  begin
  exec Forms_MigrationDeleteMainInstances
set @RowCount = @@RowCount;
end;
0 0
replied on June 1, 2022

I can confirm that the tasks were obviously orphaned but did not have a status of 99 yet. The Routing Service was not Stopped at any point that we were aware of. There were however over 60,000 tasks to iterate through upon deletion and it may have just failed to digest that amount of active tasks. It was generating a new task every 15 minutes over the weekend. Luckily we were not live with the process and could just copy it and delete the one that spun out. We ran the query to set the status to 99 and just left out the Status=2 argument.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.