private void FindUserInRole()
        {
            ServiceObject serviceObject = this.Service.ServiceObjects[0];
            serviceObject.Properties.InitResultTable();

            DataTable results = this.ServicePackage.ResultTable;
            DataRow row;
            bool isRoleMember = false;

            UserRoleManager urmServer = new UserRoleManager();
            using (urmServer.CreateConnection())
            {
                urmServer.Connection.Open(WFMServerConnectionString);
                Role role = urmServer.GetRole(serviceObject.Properties[Constants.Properties.RoleName].Value as string);
                if (role == null)
                {
                    throw new ApplicationException(Constants.ErrorText.RoleNotExist);
                }

                foreach (RoleItem roleItem in role.Include)
                {
                    string roleItemName = roleItem.Name;

                    if (roleItem is UserItem)
                    {
                        // check if the specified username matches the current roleItem name
                        if (serviceObject.Properties[Constants.Properties.RoleItem].Value.ToString() == roleItem.Name)
                        {
                            // user exist in role
                            row = results.NewRow();
                            results.Rows.Add(FillResultRow(row, true));
                            isRoleMember = true;
                            break;
                        }
                    }
                    else
                    {
                        // It is a group item, use the smartobject method UMUser.Get_Group_Users to resolve all group users  
                        
                        // Open a K2 Server connection
                        smartobjectClient.SmartObjectClientServer smoServer = new smartobjectClient.SmartObjectClientServer();
                        smoServer.CreateConnection();
                        smoServer.Connection.Open(WFMServerConnectionString);

                        // Get a handle to the ' UMUser' SmartObject
                        smartobjectClient.SmartObject umUser = smoServer.GetSmartObject("UMUser");

                        // Specify which method will be called
                        smartobjectClient.SmartListMethod getGroupUsers = umUser.ListMethods["Get_Group_Users"];
                        umUser.MethodToExecute = getGroupUsers.Name;

                        // Split FQN in SecurityLabel and groupname
                        string[] fqn = roleItem.Name.Split(':');
                        
                        // Set the input properties
                        getGroupUsers.InputProperties["Labelname"].Value = fqn[0];
                        getGroupUsers.InputProperties["Group_name"].Value = fqn[1];

                        // Call the method
                        smartobjectClient.SmartObjectList smartObjectGroupUsers = smoServer.ExecuteList(umUser);

                        List<string> groupUsers = new List<string>();

                        foreach (smartobjectClient.SmartObject smo in smartObjectGroupUsers.SmartObjectsList)
                        {
                            groupUsers.Add(smo.Properties["FQN"].Value);
                        }

                        foreach (string user in groupUsers)
                        {
                            // check if the specified username matches the current roleItem name
                            if (serviceObject.Properties[Constants.Properties.RoleItem].Value.ToString() == user)
                            {
                                // user exist in role
                                row = results.NewRow();
                                results.Rows.Add(FillResultRow(row, true));
                                isRoleMember = true;
                                break;
                            }
                        }
                    }
                }

                // the specified user is not found in the specified role
                if (!isRoleMember)
                {
                    row = results.NewRow();
                    results.Rows.Add(FillResultRow(row, false));
                }
            }
        }