If a user has been completing tasks in Forms and then their license is removed from LFDS, what does Forms do with the task history for that user? If the user is then given a license in LFDS again, should their completed tasks from before their license was removed show for them again?
Question
Question
What does Forms do with task history when a license is removed?
Answer
If you only have "Remove instance data from completed processes " enabled in Data Maintenance enabled, the completed tasks will be shown in Monitor tasks list as following greyed one, but will not show up in user's inbox. And such task can still be queried out with the query I provided before.
Replies
They should, provided all you're doing is removing their license in LFDS and not deleting the account. The Forms database stores task history by user SID, and I believe user license checks are runtime/login checks (not background sync'd). Forms would have no specific knowledge of the license change and no reason to change anything in the database. Once the user is relicensed and can log back in, they should see everything associated with their account SID they have rights to.
Since you brought it up, if their account was deleted, what happens then?
Not sure offhand. I'm guessing the SID-linked entries remain. If you delete an AD user from LFDS, then re-add them, I'm pretty sure the user doesn't lose any of their active Forms tasks or history. While deleted, certain user attributes Forms can no longer look up might get wiped out, like display name or email.
@████████ would know better than me!
Here is why the question has come up. We have a user that was out on leave and has now returned. We do not recall if their license was removed, account deleted, etc. When the user logs in now though, using same Windows account, they do not see any previous tasks they completed. Looking in the Forms database, in the table cf_bp_worker_instnc_to_resume_archive and searching by the users snapshot_id, there are 12,863 rows returned. We aren't sure why these would not be showing up for the end user in their Completed Tasks.
Yeah, that's definitely a question for Xiang. My knowledge of the Forms database schema doesn't go quite that deep!
Probably not an answer to your question, but some info about the databse tables.
The cf_users table includes all current users. The pertinent values here are the sid and user_id values.
Then there is the cf_user_snapshot table, which also includes sid and user_id. This will include multiple records for the history of the user as their username/displayname/email have changed historically.
Much of the history of instances, and I think currently assigned tasks - are through this cf_user_snapshot table. That is why you can still see history for users who have been deleted and no longer show on the cf_users table.
When your user was on leave, I wonder if their record was removed from the cf_users table, and when they came back, it ended up making a different user entirely. Perhaps search the cf_user_snapshot table for that user to see if the user_id value and sid value is consistent across the board.
Here's a query that might help:
SELECT * FROM [LFForms].[dbo].[cf_user_snapshot] WHERE [username] LIKE '%matthew%'
Obviously, any edits to that table are high risk, and you shouldn't do it unless you know what you are doing. But, if you find the user_id and/or sid have changed after they returned from leave, you could change those cf_user_snapshot records from the old values to the new ones, and that should carry over all their history and tasks assignments.
I checked with Forms 11, for same AD user, if the user is removed from LFDS, then removed from Forms system security page, then after add the AD user back in LFDS and grant the license, the AD user will be able to see all his open tasks/drafts/completed tasks after user synchronization. So the conclusion is as long as the SID for the user is not changed, all the task history can be kept. When a user is deleted from Forms, the related entry in cf_user_snapshot will still be kept(The user_id column will become blank), if the user is added back, the user_id column will be set to the latest value during user synchronization if the SID is the same. Please check from cf_user_snapshot to confirm whether there are multiple entries for same username and whether the SID for all these entries are the same.
There is only 1 entry for the user in the cf_user_snapshot table.
Will you be able to test with another AD user to check whether it behaves like I described? If it is specific to that user, please open a support case and provide the backup of the Forms database for us to investigate.
Unfortunately neither of those are an option for us at this time. What table(s) hold the data that shows for a users Completed Tasks?
You can use following query to get the completed tasks for the user based on his sid(replace {sid} with the actual sid)
SELECT * FROM [cf_bp_worker_instance_history] as wih join cf_submissions as s on wih.submission_id=s.submission_id where s.user_snapshot_id in (select id from cf_user_snapshot where sid='{sid}')
In Forms code, it will first get the current login user's sid, then use express similar as above query to get the tasks list.
When I run the query you supplied and put in the SID for the user in question there are 12,546 rows returned. Would data maintenance settings have an effect on what would show for Completed Tasks?
If you only have "Remove instance data from completed processes " enabled in Data Maintenance enabled, the completed tasks will be shown in Monitor tasks list as following greyed one, but will not show up in user's inbox. And such task can still be queried out with the query I provided before.
That is probably what is going on. The user in question was on leave for 7 months and the 'Remove instance data from completed processes' is set to 183 days while the 'Remove instance statistics from completed processes' is set to 365 days. So she wouldn't have any completed tasks to show because they all would have been cleared out.