Forum Discussion
MarcusH
8 months agoContributor III
The Process Control Manager (PCM) MarketPlace solution has an example and that uses SQL so I'm not sure if there is a built-in function:
Dim accountChannelId As Guid = BRApi.Finance.Account.GetWorkflowChannelID(si,dataCell.DataCell.DataCellPk.AccountId, wfUnitPk.ScenarioKey)
Dim accountChannelName As String = Me.GetWFChannelNameFromId(si, accountChannelId.ToString)
.....
Public Function GetWFChannelNameFromId(ByVal si As SessionInfo, ByVal channelKey As String)
Try
'Return the WF Channel from the provided ID
Dim channelName As String
If channelKey = "44f49acf-571f-4a98-a58d-069671b909e5" Then
channelName = "PCM_Standard"
Else If channelKey = "2bca6f09-00d8-4087-9d66-8c378077de01" Then
channelName = "AllChannelInput"
Else
Dim sql As New Text.StringBuilder
sql.Append("SELECT Name ")
sql.Append("From WorkflowChannel ")
sql.Append("Where UniqueID = '" & channelKey.ToString & "'")
Using dbConnApp As DbConnInfo = BRApi.Database.CreateApplicationDbConnInfo(si)
Using sqlTable As DataTable = BRApi.Database.ExecuteSql(dbConnApp, sql.ToString, False)
If Not sqlTable Is Nothing Then
Dim dr As DataRow = sqlTable.Rows(0)
channelName = "PCM_" & dr(0).ToString
End If
End Using
End Using
End If
Return channelName
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
The Standard Application Reports (RPTA) solution does it in a different way from a Dashboard Extender:
Dim wfWcfService As New OneStream.Shared.Wcf.Workflow()
Dim wfChannel As WorkflowChannel = wfWcfService.GetWorkflowChannel(si, storedGuidValue)
If (Not wfChannel Is Nothing) Then
Return wfChannel.Name
End If
Related Content
- 4 months ago
- 6 months ago
- 10 months ago