Skip to main content
Hi,

I want to list the activities by passing processsetid or process name and then assigned users dynamically for that activities and How can I assign user permission (start, view etc..) for particular process via coding rather than using K2 service manager ? Is any k2 dll file for this?


Gops
You can reference the K2mng.dll to get access to most of the functions normally provided by the K2 service manager. Just note that you will have to connect as a K2 administrator, because only they have rights to assign permissions to users/processes
I can list k2 server processes but not activities.How can i list the activities for a process?
If you have a Process Instance object you can get its Activities: like so:


Public oK2Manager As K2Mng.K2Manager
Public oProcessInstance As K2Mng.ProcessInstance

Private Sub Get_ActivityCollection()
Dim oActivities As K2Mng.Activities

Try
oActivities = oK2Manager.GetProcInstActivities(oProcessInstance.ProcID)
For Each oActivity As K2Mng.Activity In oActivities
'do something with each oActivity
Next
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub

Reply