Dear Jack,
I truly appreciate your response and it looks like we are very close to finding the correct way to fill out all the forms, but we keep getting the following error, do you have any idea what is wrong with the below code?
Our Extensibility Rule looks like this:
#Region "Complete Workflow"
For Each WFStep As String In WFEntities
For Each WFProc As String In WFProcess
Dim WorkFlowStep As String = WFStep & "." & WFProc
Dim WFInfo As WorkFlowProfileInfo = BRApi.Workflow.Metadata.GetProfile(si, WorkFlowStep) 'create loop
Dim WFCluster As New WorkflowUnitClusterPk(WFInfo.ProfileKey,si.WorkflowClusterPk.ScenarioKey, si.WorkflowClusterPk.TimeKey)
Dim WfStatus As WorkflowInfo = BRApi.Workflow.Status.getworkflowstatus(si, wfcluster, False)
Select Case WfStatus.name
Case Is = "Form Input, Process, Confirm"
' get all forms in the currently-selected Worflow cluster (wf/scenario/time combination)
Dim objXFFormsForWorkflow As XFFormsForWorkflow = BRApi.Forms.Metadata.GetForms(si, WFCluster)
' for each form
For Each formObj As XFFormSummaryInfo In objXFFormsForWorkflow
' retrieve the XFFormPk
Dim objXFFormPk As XFFormPk = formObj.FormPk
brapi.Forms.Process.ExecuteCompleteForm(si, objXFFormPk)
Next
brapi.Forms.Process.ExecuteUpdateFormWorkflow(si, WFCluster, True)
brapi.DataQuality.Process.ExecuteProcessCube(si, WFCluster, StepClassificationTypes.ProcessCube, False)
brapi.DataQuality.Process.ExecuteConfirmation(si, WFCluster)
'Case Is = "Import, Validate, Load"
Case Is = "Workspace"
BRApi.Workflow.Status.SetWorkflowStatus(si, si.WorkflowClusterPk, StepClassificationTypes.Workspace, WorkflowStatusTypes.Completed, StringHelper.FormatMessage("", ""), "", "", Guid.Empty)
' Case Is = "ZZZ"
End Select
Next
Next
Dim selectionResult As New XFSelectionChangedTaskResult()
selectionResult.WorkflowWasChangedbyBusinessRule = True
Return selectionResult
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
#End Region