Skip to main content

Can some one please advise me how to 'softcode' the 'Run As' functionality in the event property. I need to run the event as a specified user account but need this value to be configurable when moving through environments.


Thank you.

Greetings,


What kind of event are you talking about? I'm assuming you're using the K2 Designer for Visual Studio?


It's a SharePoint List Items event (it's updating a list item). And yes I'm using K2 Designer for VS. Any help would be appreciated!


Not sure of this will work, but you can try creating a new Miscellaneous environment field which is populated with what is needed and then use this field in the Run As.


HTH


Vernon


Well, i would suggest you open the WF (Windows Workflow Foundation) code that is generated by that event (by right clicking and choosing "View Code" on the event), and change the C# code behind code that is generated to do an impersonation of another user (there are a few snippets of C# code on the internet that show you how to do it) around the code that actually does the Sharepoint Interaction.


You can have the user, domain and user password of the user you're going to impersonate in environment variables (if the password being clear text is a problem, you can somehow encrypt it, and save the encrypted one on the environment variables, and decrypt it in the C# code) 


Basically, the idea is.. In the designer, i don't think you'll be able to do what you want... but editing the C# WF code that is generated for the event you probably can.


If you have any other questions, feel free to PM me.


Reply