Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have developed a SP State Machine WF and was able to successfully deploy and work through the WF. I was wondering if you can dynamically change a SP WF at runtime.

I don't want to necessarily hardcode the participants to the WF in VS as I have already done. By doing this I will have to create multiple WF based off scenarios, but ti may be the only route

For example, given the type of request that comes into SP, I want it to route to the appropriate approver. Can this be done by placing users into a AD SharePoint security group and it filters through the participants in the group and will add accordingly? Can this be done by passing as metadata of some sort or any other way?

Thanks

  • Nick
share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

I've done this utilizing lookup lists.

In my situation the set of approvers was based on the metadata of the item the workflow was being run against. For example the field could be called Team and it looks up to a Teams list which has a Team Name and a Team Leaders (Person or Group) field. Now when a user selects "Marketing" for their team we know that we need to go back to the lookup list and look at the Team Leaders field where Team Name is Marketing (And you can actually get the exact ID of the item by casting the field on the workflow list as an SPFieldLookupValue).

Once you have the row, you have the approvers which you can then create approval tasks for and voila! It's all dynamic!

This is just one way you can do it but the approaches would all be very similar. In situation X (usually data driven) select Y as the approvers.

share|improve this answer
1  
I've found out how to create lookup lists within SP. How would I associate the metadata with the item been run against the WF? Is there an example of this scenario you gave. How would it recognize that it needs to choose Joe from Marketing instead on the other 2 managers within the same department. Trying to wrap my head around this.... –  nholloway4 Mar 22 '12 at 14:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.