Skip to main content

Hi All! I have one problem maybe you help me ...


So i have next source code:


foreach (SourceCode.Workflow.Management.ProcessInstance instance in server.GetProcessInstancesProcSet(procSetId, string.Empty, string.Empty, string.Empty, string.Empty))
            {
                instances.Add(instance);
            }


I want to get all active instance of some workflow. I need this because i want to know if workflow already finished or not, if workflow not finished i write this to my users. This code work normal but it work only for user with admin permission and my users don't have this permission. Maybe you know another way how to know information about workflow without admin permission?

i needed the same function, i've done it like this:

workflowServer.Connection.Open(connectionString.ToString()); //With a technical User with admin permission


ProcessInstances procs = workflowServer.GetProcessInstances();

ProcessInstances procs = workflowServer.GetProcessInstances();



foreach (SourceCode.Workflow.Management.ProcessInstance proc in
procs)
{
if (proc.Originator.Equals("K2:" + currentPage.User.Identity.Name,StringComparison
.CurrentCultureIgnoreCase)){
instances.Add(proc);
}


 


 


I know about this functionality but my customers say that is not good way to store admin password in config files ...


you can encrypt the config file section:


http://msdn.microsoft.com/en-us/library/ms998283.aspx


But it's not good too. Maybe we have another way ...


You can wrap this call in a separate web service, then run the web service using an app pool with a service account that has the relevant permissions. Just make sure you do not do impersonation for the web service and that the app pool account is authenticated when calling K2.


This way you do not require any passwords to be stored anywhere.


Reply