Hi Erica,
I passed your question around to some team members here and received the following response from
Chris Lincoln as a potential solution (because there is not enough information to establish that it could be a definite solution).
Feel free to get in touch with any questions about the following, and we hope it helps.
Thanks,
The MetroStar Systems team
* * * * *
If a declarative workflow (i.e. SharePoint Designer 2007 workflow) (1) is attached to a Document Library that requires document check out and (2) is triggered upon item creation,
the workflow will run while the Document is checked out. This often results in unspecific (read: misleading or inaccurate) workflow errors.
When a Document (i.e. List Item) is uploaded to a Document Library that requires document check out, the Item Created event is triggered and thus the declarative workflow is triggered. However, declarative workflows (even if running under the same account as the
Checked Out To account) often run into errors updating a checked out List Item. Checking out a List Item while it is already checked out logically causes a workflow error.
Therefore, the resolution is to prevent the workflow from running while the List Item is still checked out (something that cannot be avoided due to default SharePoint behavior), check out the List Item (as it is required per List Settings), perform any desired update(s) to the List Item, and check in the Document (to commit the pending update(s) and allow other Users to work with the List Item).
The first step of any declarative workflow used in such a scenario should look something like:
* If
Checked Out To is not empty * Log
Waiting for Document to be checked in. to the workflow history list
* then Wait for
Checked Out To to be empty * then Log
Document checked in. Continuing workflow... to the workflow history list
Then, the List Item should be checked out by the declarative workflow. Using the default action
Check Out Item will accomplish this.
Then, the workflow should update the List Item as desired.
Finally, the List Item should be checked in (by the declarative workflow or otherwise). Using the default action
Check In Item will accomplish this.
* Please note that use of timed actions is highly discouraged unless required by some business rule. Use of the default action
Pause For Duration ensures that the declarative workflow will have a significant minimum time to completion (i.e. every workflow in the described scenario would require at least 5 minutes to complete) and thus appropriate triggering of the declarative workflow may not be ensured. While a declarative workflow is In Progress, no other instances of the declarative workflow will be created.
** Also, If the declarative workflow is not attached to the Document Library, it will be unable to access the List Item even if it is responsible for the check out; the List Item will immediately become inaccessible to the declarative workflow (likely throwing an error relating to the List Item not existing).
*** Finally (for now), note that using the default action
Check In Item will result in a major, rather than minor, version check in. This may be undesirable depending on the System design. If a minor version check in is required, please see below for a use case describing a solution. Unfortunately, I am unaware of a solution that does not require development.
1. User creates or modifies List Item (System begins declarative workflow at this time)
2. System navigates User to a redirection page
3. System checks the status of the workflow until the workflow status is not 2 ("In Progress")
(by either the SharePoint object model or web services (
GetListItems method of the
Lists web service))
4. System checks in the List Item
(again, by either the SharePoint object model or web services)
5. System navigates User to destination
For more information regarding workflow statuses, see
David Wise's Sharepoint blog.
* * * * *