Forum Discussion
RyanDiehl
3 years agoNew Contributor III
Help with GetUsersInWorkflowGroup function
I'm trying to lookup the users in a workflow execution group so I can e-mail them when the harvest batch process runs successfully. Below is the code I'm using to try and lookup the users within a wo...
- 3 years ago
workflowGroupType corresponds to the workflow profile attribute index, not too sure why 1250 is erroring out on you, as that's the exact index for the Workflow Execution Group.
Also, probably better to set your text1Filter to `String.Empty` or `""` instead of `Nothing` since the function is expecting to parse a string, not an object.
Maybe try different groups to check.
Also for reference:
Certification Sign Off Group = 16100
Workflow Execution Group = 1250
RyanDiehl
1 year agoNew Contributor III
So in this case you'd want all users right? Would using the "GetUsers" BRAPI work for you?
objList = BRApi.Security.Admin.GetUsers(si)
Sergey
OneStream Employee
1 year agoThat's the idea yes, however you also have a "nobody" group which also returns 0 users (obviously 😀 ) ... is there a way to just get the group and not the users within the group ?
Regards,
- Nikpowar971 year agoContributor
Sergey ,
Brapi.Security.Admin.GetGroupInfoEx(si,Brapi.Workflow.Metadata.GetProfile(Si,"ProfileName").AccessGroupUniqueID).GroupInfo.Group.Name ' can use attribute Index for other groups
- epadua1 year agoNew Contributor II
Dim workflowExecutionGroupGuid As Guid = Guid.Parse( BRApi.Workflow.Metadata. GetProfile(si, si.WorkflowClusterPk.ProfileKey). GetAttribute( ScenarioType.Administration.Id, SharedConstants.WorkflowProfileAttributeIndexes.WorkflowExecutionGroup ).Value ) Dim groupName As String = BRApi.Security.Admin. GetGroupInfoEx(si, workflowExecutionGroupGuid). GroupInfo.Group.NameReplace the profile key with a manually obtained profile key (or leave it if your business rule is driven by workflow selection).
Replace ScenarioType with your relevant scenario type set on the workflow.
If the scenario type's Workflow Execution Group is set to "Everyone", this group name should return everyone. Similarly, it will return "Nobody", if it is set to that.
Looking into this, it also bothered me that I didn't know where these constant attributes were defined, so I went searching. And apparently they are here:
Related Content
- 1 year ago
- 2 years ago
- 4 years ago