Skip to main content
June 21, 2023

Security Access Error | Get Parent Workflow Status

  • June 21, 2023
  • 4 replies
  • 0 views

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?

4 replies

June 21, 2023

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.


MikeG_0-1687353584507.png

Hope this helps.

 

Chris-BAuthor
June 21, 2023

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

June 21, 2023

Hi ChrisBadenhorst 

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)	



June 21, 2023

Sorry, My bad : Dim wfParentStatus As WorkflowInfo = BRApi.Workflow.Status.GetWorkflowStatus(si, wfParentPk, False) 

Chris-BAuthor
June 21, 2023

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)	

 

June 21, 2023

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.

March 28, 2025

Hi Chris,

Did you find any workaround for resolving this issue?

Thanks,

Sudhakar S