How to Get Most Current User View Before Checking In.
Hi,
We have several custom workflows which users can start from end-user menu and have some resource accounts created/modified after approvals.
User view is checked out once at the beginning of each workflow, then some user attributes are modified through forms and user view is checked in with new attributes at the end.
If any user starts a workflow (say W2) before completion of another workflow (say W1) he started before, and W1 is completed when W2 is waiting for approvals or etc., W2 completely discards changes made to user view through W1 since it has already checked out the user view before.
If I checkout the user once more just before checkin, I'm able to get a current user view but this time changes made through forms used in the current workflow are lost.
What's the best way, to get an updated user view of the user without overwriting any changes made out of the running workflow and losing form data?
Regards,
Mehtap.
[989 byte] By [
mehtapa] at [2007-11-27 6:17:45]

# 1
In a situation like this, you should probably change the front end to store the changes in workflow variables instead of using the view directly. Then, post approval, you checkout the view and apply the changes. I've used this approach to perform changes on large numbers of users (kind of like a bulk action, only more reliable).
Alternatively, you can checkout the user object at the beginning of the workflow, and this will prevent your race condition by putting a lock on it. This will obviously cause problems (for you) if your users expect to be able to do multiple changes simultaneously. Don't try this approach if an angry mob will storm your cubicle -- IDM coders are hard to come by.
Jason
# 3
Hi sudheer1,
Actually, targetResources parameter is given for our checkout operations, and even if the target resource is Lighthouse, the user can start a workflow and when still the workflow is active (waiting for approvals..etc.), he can change his passwords, Authentication Questions and the operators can edit his resource accounts, I haven't observed such a lock-error caused by workflows up to now.
Anyway, does it make sense to keep the lock that long? Since some workflows wait for approvals more than one/two days in our environment...
# 4
This was one solution I thought of trying Jason, I just hoped IDM to have some better options to refresh the user view letting you protect some fields, since I recognized "refreshView" or "protected" keywords through documents which didn't work for me though.
I'll try and share the results,
Thanks,
Mehtap.
# 5
You can have work around for error you get if the view is locked as mentioned by sudhir.so if one view is already checkedout and another activity is trying to access the view the error can be avoided
You can add wait activity in the workflow(if you are allowed to do this..someone will say..PERFORMANCE ISSUE) but that is workaround to avoid the view is locked error.i have never tried this option but this feature is available.