All Running Activities

  • 27 July 2009
  • 2 replies
  • 0 views

Badge +5

Hi Guys,


I have what should really be a simple question.  I am new to BlackPearl so I'm not sure how to do much with it.


As far as I know the little boxes in Visual Studio with lines coming out of them are called Activities.  Or are activities just one type of box with lines coming from it?  From what I know all these boxes are a single step in a workflow.  Either way, from my little knowledge I think it is possible for more than one box (or workflow step) to be active/be running at one time to allow a certain amount of parrallelism.


So far so good?  Now, all I want to do is write some code that says "give me a list of all the running workflow steps for a given instance of the workflow".


Sounds pretty easy to me but I don't know which of the million dlls to look in and I don't know which methods to call.


Any help would be appreciated.


Thanks,


Sachin


2 replies

Badge +5
Does anyone have any ideas about this?
Badge +3

You Need to reference the SourceCode.Workflow.Management API and you need to be a k2 server administrator to utilize the below code sample. 


 


SourceCode.Workflow.Management.WorkflowManagementServer wms = new SourceCode.Workflow.Management.WorkflowManagementServer(ServerName, 5555);


wms.Open();


foreach(SourceCode.Workflow.Management.ProcessInstance pi in wms.GetProcessInstancesAll(ProjectNameProcessName, "", ""))


{


//Loop through the instances and get the data of the process back, from here


//you can manipulate the process as you wish ; )


Console.WriteLine(pi.ProcessFolio);


{


Console.ReadLine();


wms.Close()


wms.Dispose()


 -----------------------------------------------------------------------------------------------------------------


The information contained herin does not reflect the view of K2, this is my own opinion


 

Reply