Skip to main content
Nintex Community Menu Bar

How do I populate users with members of Destination Queue

  • February 19, 2004
  • 12 replies
  • 36 views

Forum|alt.badge.img+3
I want to have a drop down list box on a smartform that contains all the users in a destination queue.

The user will then select a user, and the next activity will be assigned to the chosen user.

What is the best way to do this?

Alternatively, if this is not possible, is it possible to list in the Drop down, all users of a certain AD Group

12 replies

Forum|alt.badge.img+4
  • February 20, 2004
Add the ADUM.dll and the Sourcecode.K2UMI.dll to the .Net Smartforms web references. The files are located in the C:Program FilesK2.net 2003Bin dir. Remeber to change the AD Group Name "ADGroupName" to an existing group in your AD Structure.

Use the following code to populate the K2 DropdownListBox:

Dim ADUM As New ADUM.K2UserManager
Dim Users As SourceCode.K2UMI.IK2Users
Dim User As SourceCode.K2UMI.IK2User

'Clear
K2cboAD.Items.Clear()

If Trim(txtGroup.Text) <> "" Then
Users = ADUM.FindSecurityUsers("ADGroupName", , , , )
If Not Users Is Nothing Then
For Each User In Users
K2cboAD.Items.Add(User.Name.ToString)
Next
End If
End If


In the Destination Rule where you see the following code, replace with field value that's linked to your K2 DropdownListBox Value:

'== sendto
K2.Destinations.Add(DestinationType.User, K2.ProcessInstance.DataFields.Item("FieldName").Value)

There you go...

Forum|alt.badge.img+7
  • February 23, 2004
David,
thanks for this excellent post! :)

Forum|alt.badge.img+3
  • Author
  • February 23, 2004
Many thanks David, excellent work

Forum|alt.badge.img+1
  • June 22, 2004
Hi,

i had use these code in my k2.it was ok.
But when i used it in K2 workflow service pack 1, it failled. It was nothing inside the [users].

any ideas?

Thanks

Forum|alt.badge.img+2
I had the same experience in code searching for a specific user.

What I found was that the user's name is now retruned as DOMAINUsername and not just Username as in Hotfix 2

Thus I had to slipt the DOMAIN and username first before I could search for the user with Username only

Tersia

Forum|alt.badge.img+3
  • November 10, 2005
Hi.

I rewrited previous example to C#, to console application but it actually doesn't work very well. That means, method FindSecurityUsers returns me always all users in AD, not only these that are in specified group.

");
Console.ReadLine();


But, when I'm in K2 Studio and I'm adding the same group to destination rule, it extraxts correctly only users from this group. So, there definitely must be something wrong in my code.

Does anyone have an idea what am I doing wrong?

Thanx in advance.

Forum|alt.badge.img+11
  • Nintex Employee
  • November 30, 2005
The ADUM.dll is for internal K2.net use only and not meant for other custom solutions. This library needs certain startup/configuration parameters in order to function properly. To get a list of AD group members, you should use the standard .NET DirectoryServices class.

Regards,
Ockert

Forum|alt.badge.img+3
  • November 30, 2005
5, maximum 10 minutes ago I finished coding a two methods which will return a list of user's groups and list of groups' users. This methods of course use the DirectoryServices.

Ockert, it must really be a deduction :)

OK, thank you anyway for reply.

Forum|alt.badge.img+3
Hi K2 Experts,

I'm interested in getting all the users in a particular Destination Queue. I tried but failed to find ADUM.dll on my hard drive as per this suggestion in the thread:

"Add the ADUM.dll and the Sourcecode.K2UMI.dll to the .Net Smartforms web references. The files are located in the C:Program FilesK2.net 2003Bin dir."

Where can I obtain ADUM.dll?

I'm using 3.5140.1.0.

Thanks

Forum|alt.badge.img+11
  • Nintex Employee
  • March 8, 2006
It should be in the specified directory on a machine or server running K2.net SERVER. If it's not there, your K2Server will not start up.

Regards,
Ockert

Forum|alt.badge.img+3
Thanks Ockert,

I suppose that it would not be a good idea to copy ADUM.dll from the server to my development machine to use with a SmartForm application.

Thanks for the reply.

Forum|alt.badge.img+11
  • Nintex Employee
  • March 9, 2006
Should not be a problem - as long as it is the same version as the one running on the server.

Cheers,