05-29-2024 08:21 PM
What is the difference between WorkflowUnitClusterPk vs WorkflowUnitPk?
When would you use one over the other?
Thanks,
Scott
Solved! Go to Solution.
05-30-2024 04:20 AM
In the Workflow Unit Cluster Pk object you can access:
The Workflow Unit Pk is the Workflow Unit Cluster Pk + the Workflow Key.
The workflow key identifies the "Workflow Name" so what you se here:
All Workflow keys available are in SharedConstants.WorkflowKeys. For example, "Import, Validate and Load" is the Workflow SharedConstants.SimpleDataLoad.
I use any of the two depending on what the method that I want call gets as input parameter. Most of them are usually getting the WFU Cluster PK as that identifies your selection in open place. Indeed, you can create the WF Unit Cluster PK from the WF Unit PK using method CreateWorkflowUnitClusterPk().
HTH.
05-30-2024 11:20 AM - edited 05-30-2024 11:49 AM
WorkflowUnitPk can be used as a factory object with error checking to create instances of WorkflowUnitClusterPK:
Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As ExtenderArgs) As Object
Try
Dim profileKey As Guid = New Guid(args.NameValuePairs.XFGetValue("ProfileKey"))
Dim scenarioId As Integer = ConvertHelper.ToInt32(args.NameValuePairs.XFGetValue("ScenarioId"))
Dim timeId As Integer = ConvertHelper.ToInt32(args.NameValuePairs.XFGetValue("TimeId"))
Dim wfClusterPK As WorkflowUnitClusterPk
Dim wfUnitPK As New WorkflowUnitPk(profileKey, scenarioId, timeId)
If wfUnitPK.KeyInitialized Then
wfClusterPK = wfUnitPK.CreateWorkflowUnitClusterPk()
Else
BRApi.ErrorLog.LogError(si, XFErrorLevel.Error, "Workflow could not be intialized")
End If
Return Nothing
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
05-30-2024 04:20 AM
In the Workflow Unit Cluster Pk object you can access:
The Workflow Unit Pk is the Workflow Unit Cluster Pk + the Workflow Key.
The workflow key identifies the "Workflow Name" so what you se here:
All Workflow keys available are in SharedConstants.WorkflowKeys. For example, "Import, Validate and Load" is the Workflow SharedConstants.SimpleDataLoad.
I use any of the two depending on what the method that I want call gets as input parameter. Most of them are usually getting the WFU Cluster PK as that identifies your selection in open place. Indeed, you can create the WF Unit Cluster PK from the WF Unit PK using method CreateWorkflowUnitClusterPk().
HTH.
05-30-2024 11:20 AM - edited 05-30-2024 11:49 AM
WorkflowUnitPk can be used as a factory object with error checking to create instances of WorkflowUnitClusterPK:
Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As ExtenderArgs) As Object
Try
Dim profileKey As Guid = New Guid(args.NameValuePairs.XFGetValue("ProfileKey"))
Dim scenarioId As Integer = ConvertHelper.ToInt32(args.NameValuePairs.XFGetValue("ScenarioId"))
Dim timeId As Integer = ConvertHelper.ToInt32(args.NameValuePairs.XFGetValue("TimeId"))
Dim wfClusterPK As WorkflowUnitClusterPk
Dim wfUnitPK As New WorkflowUnitPk(profileKey, scenarioId, timeId)
If wfUnitPK.KeyInitialized Then
wfClusterPK = wfUnitPK.CreateWorkflowUnitClusterPk()
Else
BRApi.ErrorLog.LogError(si, XFErrorLevel.Error, "Workflow could not be intialized")
End If
Return Nothing
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function