Skip to main content

Hi All,


Can anyone please explain what is "The Activities object " as defined in the namespace K2Mng.


I have a process which has one activity and one client event. I exported the process and trigerred it from ASP Windows aplln.


It created a process instance which is in Active state and one worklist. Now I am trying to retrieve the activities in the process.


The following is the code snippet :


Activities

acts = Kmg.GetProcInstActivities(kpr.ProcID);


textBox17.Text = acts.Count.ToString();


Here Kmg is an object of K2Manager class .  kpr refers to a particular version . Here it refers to the only version because I have only one version. acts.count is returning 0 . I think it should return 1 because the process has one activity.


Maybe I am wrong.


Please explain ASAP.


Thanks in advance.

Hi,


I'm gonna take a stab and guess that you pass the ProcID instead of the Process Instance ID to the GetProcInstActivities method.


If I may ask, why are you using the K2MNG and not the K2ROM, K2MNG is intended to programatically do K2 Service Manager type stuff. If you want to manipulate active process instances you should be looking at K2ROM, but as I say, I don't know exactly what you are trying to do.


 


Hi ,


Thanks a lot for replying.


Let me giev the exact scenario:


I have taken K2Mng.dll as a reference in a windows application. There I have used the following code :


ProcessFolders

PrFolders = Kmg.GetProcessFolders();


ProcessSets prSets1 = PrFolders[1].ProcessSets;


ProcessSet prSet1 = prSets1[2];


Processes

kprs = Kmg.GetProcessVersions(prSet1.ProcSetID);


Process

kpr = kprs[0];


Activities

acts = Kmg.GetProcInstActivities(kpr.ProcID);


textBox17.Text = acts.Count.ToString();


Here Kmg as mentioned earlier is an object of class K2Manager.


What actually is happening is I am able to drill down to a particular process of a particular project exported in the server.Let's say Project is "K2R&D" and Process is "Test".Here kpr refers to Test. So to the function GetProcInstActivities, I have passed kpr.ProcID.


You are suggesting that I passed ProcID instead of the Process Instance ID to the GetProcInstActivities method. That's true .The function GetProcInstActivities () takes integer as argument. And I am unable to locate anything called ProcessInstanceID. I think ProcID is nothing but the short form representation of ProcessInstanceID


In K2 I have designed the process "Test" which has an activity called "Default". It has a client event.


I also checked in the table _Act. where ProcID is a column By using a select query , I am able to retrieve that for a particular ProcID related to Test , there are 2 activities  "Start" and "Default".


Please suggest ASAP with refernce to K2Mng.


 


Hi,


I think I got the solution. Actually I have to pass ProcessInstance.ID rather than Process.ProcID.


I got confused because of the text written in Help section for the function GetProcInstActivities ()  . It is mentioned in Help that





Parameters



ProcInstId
Determine the version of the process used to create the Activities collection.

But to determine the version of the process, we have to use Process.ProcID because the Process object represents a specific version of the Process Set available on the K2.net 2003 Server.
 

$$Return_Type$$

%%comment%%

" -->

$$Exceptions$$

%%filtereditemlist%%" -->

$$Permissions$$

%%filtereditemlist%%" -->

$$Remarks$$

%%comment%%

" -->

$$Example$$

%%comment%%

" -->

$$Example$$

,format= %%%%filtereditemlist%%" -->

Reply