Sub Process_Globals
Type DBResult(Tag As Object, Columns As Map , Rows As List)
Type DBCommand(Name As String , Parameters() As Object)
Private const rdcLinc As String = "http://192.168.0.5:17178/rdc"
End Sub
Sub CreateRequest As DBRequestManager
Dim req As DBRequestManager
req.Initialize(Me,rdcLinc)
Return req
End Sub
Sub CreateCommand(Name As String , Parameters() As Object ) As DBCommand
Dim cmd As DBCommand
cmd.Initialize
cmd.Name = Name
If Parameters <> Null Then cmd.Parameters = Parameters
Return cmd
End Sub
Sub Activity_Create(FirstTime As Boolean)
GetRecord(2)
End Sub
Sub GetRecord(id As Int)
Dim req As DBRequestManager = CreateRequest
Dim cmd As DBCommand = CreateCommand("select_employees",Array(id))
wait for (req.ExecuteQuery(cmd,0,Null)) jobdone(j As HttpJob)
If j.Success Then
req.HandleJobAsync(j,"req")
Wait For (req) req_result(res As DBResult)
req.PrintTable(res)
Else
Log("error : " & j.ErrorMessage)
End If
End Sub