views:

2747

answers:

3

I'm trying to create a workflow on the Sharepoint Designer. The workflow should wait until an Out-Of-The-Box approval workflow is complete. This is done by starting my workflow with the item's creation, and usign the wait activity:

Wait for field change in current item:
Wait for InternalApproval to equal 16

The problem: the rule is correct, but the event doesn't fire unless an edit is made on the item. Normally, every edit triggers the workflow check, but my tests show approving a workflow doesn't trigger this event on the item.

Is there an easy way around this issue? I though about implementing a busy wait, but how (there's a wait 5 minutes activity, but no goto)? Is there an activity I can download that can wait for another workflow to complete, or busy wait until a condition is met?
Another way to solve my problem is if the InternalApproval workflow changed a field, but I cannot achieve that either...

+1  A: 

This is expected behaviour. An approval workflow that is wired to cancel itself upon changes to the item would otherwise be useless. At the API level, SharePoint is disabling events from being raised when it needs to update the item upon which it is running.

-Oisin

x0n
Thanks Oisin. I guess I can find reasoning one way or the other... Do you know any way around this one? I'd like to continue my workflow when another workflow is done, or trigger an edit.
Kobi
Take a good read through this:http://blogs.msdn.com/sharepointdesigner/archive/2009/07/13/service-pack-2-prevents-an-on-change-workflow-from-starting-itself.aspxIt presents alternatives.
x0n
I've read the article, thanks for that. Creating two workflows would work, but it worries me - the behavior already changed once, breaking many workflows (as the article says), and it feels a little hacky. Thanks again!
Kobi
A: 
Kobi
+1  A: 

The article How to wait for a change in any list, wait for multiple field changes the current item for a different take on waiting for field changes in the current item (link below).

The article explains how to configure a workflow which uses Standard (OOB) workflow actions and is developed using SharePoint Designer. Instead of using the "Wait for field change in the current item" action, the components of the workflow which are completed after waiting is finished are added to a separate "On Change" workflow, which uses standard conditions in the first step to determine if it can continue. If the conditions are not met for the field in the current item, the workflow will stop. If another instance of the workflow is running, new instances will also stop by setting a "Workflow_running" field to yes while an instance is running.

Using this technique gives you more control when waiting for specific criteria to be met. This includes being able to wait until a field in another list item is updated, or waiting for multiple fields in the current item.

See How to wait for a change in any list, wait for multiple field changes the current item (SharePoint Workflow) for more details.

Daniel - SharePoint Dev
Interesting, and I like the idea of waiting on the task. However - in my scenario, I'm supposed to wait for a user to start a workflow (with unique parameters), and wait for it to complete: how can I wait on multiple tasks that aren't yet created? How can I tell it's completed?
Kobi