index > Windows Workflow Foundation > Interacting with different users based on roles

Interacting with different users based on roles

Hello,

I've designed a document validation workflow but still with no roles on it, so anyone can introduce a document and anyone can validate it. I've been searching info about roles and what I've seen is that you can say which roles can or cannot do an activity. But my application is a bit different:

There are 4 different roles (ranks of the employees). Role 5 (the less "important") can post a document, that same user can modify it as many times as he wants and then send it to validate, and it has to be shown in the list of pending documents of role 4. But role 4 can as well post a document that has to be validated by role 3, and role 3 need validation from role 2 etc.

I suppose there has to be a way of designing a single workflow but, based on who created it, send the validation request to a particular role and only let that role validate it.

Please can someone give me some advice on that topic? Any ideas, examples, ect. will be welcome!

Thanks,

Rubén

Samoyed

Why not track the workflow id and the role that needs to validate it. You can do this with custom activities and/or a custom tracking service. Then you can use that data to drive your UI.

Matt




See What You Can Learn -- http://www.pluralsight.com/courses/IntroducingWF.aspx
Matt Milner - Pluralsight

Hi Matt,

Thanks for your answer. I was thinking... can I do something like: at the beggining of the workflow insert a "Policy" activity (or perhaps just a normal code activity) where I check which role has the person that started the workflow (still don't know how to do that) and based on that role, I would set the "Roles" property of the event handlers to the role that has to validate them. Do you think that can be done this way, or maybe with some change? If you think that it wouldn't be possible, can you explain a bit more about the solution you suggested in your post, or any other solution?

Thank you very much for your help!

Rubén

Samoyed

I'm trying to do it the way I wrote in the previous message: when I raise the first event, in the event args Identity field I put the userId of the user that raises the event. Then I insert a code condition where I check which role does that user have and based on that I modify the "Roles" property of the event handlers in the workflow to set who can validate etc. But the problem I have is that when I define the roles and add the users to it, I get an exception. I do it like this:

if (!System.Web.Security.Roles.RoleExists("Tecnic"))

{

System.Web.Security.Roles.CreateRole("Tecnic");

string[] tecnics = { "Ruben", "Joan Miquel", "Isra", "Enrique" };

System.Web.Security.Roles.AddUsersToRole(tecnics, "Tecnic");

}

But when I run it, an exeption is raised in the first line. The exception sais that the Function Administrator characteristics isn't entitled. I checked the IIS configuration and in the default website properties, ASP.NET label, Authentication, I checked the Function Administrator characteristics. But it still gives the same exception at the same point. Do you know what can cause it or what can I do to solve it?

Thanks again.

Samoyed
reply 4

You can use google to search for other answers

 

More Articles

• Beta 1.2 install on VS RTM causes error in VS Code Designer
• How to get WPF and WF work together?
• Why doesn't ActivityTrackingRecord.ContextGuid match any context ...
• Query for pending Activities with access prvilages for a specific...
• Generating ruleset in runtime
• Cloning activities in hosted designer for creating version of a w...
• Create a code expression with RuleConditionDialog
• how to find the designer associated to an activity
• event not listened in state machine
• InvokeWorkflow Dependecy .
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Thread Handling
• parameters in SqlWorkflowPersistenceServ
• Serialize and deserialize a workflow wit
• ASP.NET and Workflow
• Business Object to WF Instance - How to
• Strange Exception
• GUID and ID for menu group in the Workfl
• Event cannot be delivered
• HIPAA 837 File Error
• Where can I download Visual Studio 2005
• SqlWorkflowPersistenceService exception
• Assembly reference missing for System.Wo
• Custom DeSerialization Problem: Magic nu
• deleting activities from the designer us
• Bug? ArrayList as parameter

Hot Articles

• WF beta2 in VS.Net 2k5 Express Edition
• [CorrelationProvider]
• Who said 'WWF Designers cant fly?' - WWF
• Modifying a report created in report bui
• How to Obtain Fault from child activity
• Task List presentation of "my assig
• Error while running the Sharepoint Produ
• How fast WF ? Sutable for UI hadling?
• How do I hande exceptions in state machi
• Maximum time-out interval for delay acti
• I have to have Idingo to put the Expense
• Replicator and correlation
• Data-Driven Workflow
• Document approval senario.
• Property persistence inside workflows

Recommend Articles

• Simple Newbie question
• Finally activity?
• WF failed to work, if i add a service
• Workflow Change
• WWF for configurable event sink
• Workflow Lifecylcle Events
• How to convert .dll back to .xoml?
• subclass handle external event activity
• ActivityBind and it's ID property
• Beta 2 and Windows Server 2003 R2
• parallelif
• Create Tracking/ persitence database for
• Message Queue Error: "QueueExists&q
• Interrupt State execution in State Machi
• event not firing