Forum Discussion

Fayazuddin1's avatar
Fayazuddin1
New Contributor
5 months ago

Workflow Completion using Dashboard extender Business Rule

Hi All,

We have multiple Profiles under a workflow and each profile contains multiple forms in it. While executing the business rule through the button from workflow dashboard, It is just completing that particular workflow with forms but not the other workflows which consists of multiple forms.

Below is the code using to complete the workflow. Is there a solution for this issue.

Dim selectionChangedTaskResult As New XFSelectionChangedTaskResult()

Dim wfProfile As String = BRApi.Workflow.Metadata.GetProfile(si, si.WorkflowClusterPk.ProfileKey).Name

Dim scenario As String = ScenarioDimHelper.GetNameFromID(si, si.WorkflowClusterPk.ScenarioKey)

Dim time As String = BRApi.Finance.Time.GetNameFromId(si, si.WorkflowClusterPk.TimeKey)

Dim wfClusterPK As WorkflowUnitClusterPk = BRApi.Workflow.General.GetWorkflowUnitClusterPk(si, wfProfile, scenario, time)


BRApi.Workflow.Status.SetWorkflowStatus(si,wfClusterPK, StepClassificationTypes.Certify, WorkflowStatusTypes.Completed, "Auto completing Forms","Error autocompleting Forms", "Auto completing", Nothing)


selectionChangedTaskResult.WorkflowWasChangedByBusinessRule = True
selectionChangedTaskResult.IsOK = True
selectionChangedTaskResult.ShowMessageBox = True
Return selectionChangedTaskResult

  • TheJonG's avatar
    TheJonG
    Contributor III

    I think you would need to get each workflow cluster PK for all child workflows and then set the status for each one. You are only referencing the current workflow through si.WorkflowClusterPk.ProfileKey so that is the one that is completing. I have not used this but there is a BRAPI call BRApi.Workflow.Metadata.GetRelatives which could get all the base input workflows and then you can loop through them and set the status. If that doesn't work, you may have to pull each one individually using the hardcoded name of each one.