This project is read-only.

3. Search History Information: Controller Program

VB .NET: 

  1.         Public Class RetrieveAuditInfoController
  2.             Public Function RetrieveAuditInfo(ByVal piid As String) As AuditVdb
  3.                 Dim vdb As New HSDc.RingleFlow.Api.Kernel.History.AuditVdb()
  4.                 Dim engine As IWorkflowEngine = WorkflowEngineFactory.GetInstance()
  5.                 Dim service As IHistoryService = engine.HistoryService
  6.                 vdb = Service.RetrieveAuditInfo(piid)
  7.                 Return TransferVdb(vdb)
  8.             End Function
  9.             Private Function TransferVdb(ByVal original As HSDc.RingleFlow.Api.Kernel.History.AuditVdb) As AuditVdb
  10.                Dim vdb As New AuditVdb
  11.                For Each table As DataTable In original.Tables
  12.                    If vdb.Tables.Contains(table.TableName) Then
  13.                        For Each row As DataRow In table.Rows
  14.                            Dim newrow As DataRow = vdb.Tables(table.TableName).NewRow()
  15.                            For Each column As DataColumn In table.Columns
  16.                                newrow(column.ColumnName) = row(column.ColumnName)
  17.                            Next
  18.                            If (table.TableName.Equals("Stage")) Then
  19.                                Dim stagevar As String = String.Empty
  20.                                Dim srow As HSDc.RingleFlow.Api.Kernel.History.AuditVdb.StageRow = CType(row, HSDc.RingleFlow.Api.Kernel.History.AuditVdb.StageRow)
  21.                                For Each svrow In srow.GetStageVariablesRows
  22.                                    stagevar += svrow.VariableName + " : " + svrow.VariableValue + ","
  23.                                Next
  24.                                If (stagevar.Length > 0) Then
  25.                                    stagevar = stagevar.Substring(0, stagevar.Length - 1)
  26.                                End If
  27.                                newrow("StageVariables") = stagevar
  28.                            End If
  29.                            vdb.Tables(table.TableName).Rows.Add(newrow)
  30.                        Next
  31.                    End If
  32.                Next
  33.                Return vdb
  34.            End Function
  35.        End Class

Last edited Jun 25, 2012 at 3:57 PM by cathysung, version 2

Comments

No comments yet.