The OneStream Community is temporarily frozen until June 29th due to the ongoing maintenance. Please read the blog post here to learn more.
Forum Discussion
ChrisBadenhorst
3 years agoNew Contributor II
Security Access Error | Get Parent Workflow Status
Hi,
I've got a business rule where I use BRApi.Workflow.Metadata.GetParent(si, si.WorkflowClusterPk) to look at the status of the parent workflow profile.
However, if a user does not have access to the parent workflow profile, then they get an error "Security Access Error. User is not authorized to access workflow profile". So it seems that the function BRApi.Workflow.Metadata.GetParent(si, si.WorkflowClusterPk) is not very useful and it is a bit bizarre that it refers to user security. Is there a way to run this business rule as administrator perhaps or something else I can do?
10 Replies
- MikeGContributor III
Hi ChrisBadenhorst you can get to the Workflow Status of any WFPOV. I have not used a BR to do that. Take a look at this WorkflowStatus Method Query which is available on the platform by way of a Dashboard Data Adapter. Create a new Data Adapter, for the Command Type select 'Method', for the Method Type select 'WorkflowStatus'. OneStream provides you a hint of the parameters needed to execute the Method Query. You can get all of the Statuses for each Workflow Task in a single Cube Root Workflow Profile.
Hope this helps.
- ChrisBadenhorstNew Contributor II
Thank you Mike,
I unfortunately need to use a BR as there are a few things that need to happen based on the workflow status of the parent profile.
Chris
- NicolasArgenteValued Contributor
Try that ;
'Check the Workflow status of the parent (We can't calculate plan if the parent is certified) Dim wfRegParent As WorkflowProfileInfo = BRApi.Workflow.Metadata.GetParent(si, si.WorkflowClusterPk) Dim wfRegParentPk As New WorkflowUnitClusterPk(wfRegParent.ProfileKey, si.WorkflowClusterPk.ScenarioKey, si.WorkflowClusterPk.TimeKey) Dim wfRegParentStatus As WorkflowInfo = BRApi.Workflow.Status.GetWorkflowStatus(si, wfRegParentPk, False)
- NicolasArgenteValued Contributor
Sorry, My bad : Dim wfParentStatus As WorkflowInfo = BRApi.Workflow.Status.GetWorkflowStatus(si, wfParentPk, False)
- ChrisBadenhorstNew Contributor II
Hi Nic,
Yes that is the 3rd line in the code, but it errors at the 1st. Unless there is a different way to get the wfParentPk other than using the GetParent function?
Dim wfRegParent As WorkflowProfileInfo = BRApi.Workflow.Metadata.GetParent(si, si.WorkflowClusterPk) Dim wfRegParentPk As New WorkflowUnitClusterPk(wfRegParent.ProfileKey, si.WorkflowClusterPk.ScenarioKey, si.WorkflowClusterPk.TimeKey) Dim wfRegParentStatus As WorkflowInfo = BRApi.Workflow.Status.GetWorkflowStatus(si, wfRegParentPk, False)
- ckattookaranValued Contributor
Most of the Brapi command uses security to do stuff (which is the whole point of having security). If the user is not having access to the parent, then I don't think there is a way around it. Other way to do it will be querying the profile table and getting the GUID from there and use it to create your clusterpk.
- SudhakarNew Contributor III
Hi Chris,
Did you find any workaround for resolving this issue?
Thanks,
Sudhakar S