To be honest, the API of AdobeWorkFlow is too general, and there are basically no examples that can be run directly.
A large amount of code is completed using the asp vbs script. For such a help document, I can only guess what functions it implements.
To sum up, it is very useful to show that the unique identifier of all users in the current WorkFlow, because this ID is often used in subsequent job processing.
However, the WorkFlow API only provides a method that is too weak for program developers.
I used to write an example in VB for reference.
Option Explicit
Dim g_connObj As EPSDK. Connection
Dim g_connStr As String
Dim g_userName As String
Dim g_password As String
Dim g_dsnName As String
Dim g_server As String
Private Sub cmdInitializeConnect_Click ()
Set g_connObj = New EPSDK. Connection
Dim connStr
'Connstr = "DSN =" & g_dsnName & "; SERVER =" & g_server & "; UID =" & g_userName & "; PWD =" & g_password
ConnStr = "DSN = Adobe Workflow Server"
'Open connection
G_connObj.Open (connStr)
Debug. Print "Initialize connection succeful"
End Sub
Private Sub listener listusers_click ()
If g_connObj Is Nothing Then
MsgBox ("Please connect to server first ")
Exit Sub
End If
Dim rs As EPSDK. Recordset
Set rs = New EPSDK. Recordset
Dim strSql As String
StrSql = "select DisplayName, userID from users"
Set rs = g_connObj.Execute (strSql)
If rs. EOF Then
MsgBox "There are not any user"
Exit Sub
End If
Dim I As Integer
I = 0
While Not rs. EOF
I = I + 1
'Here, a list of user tasks is displayed.
Debug. Print "------------" & I &"-------------"
Debug. Print rs ("DisplayName ")
Debug. Print rs ("userID ")
Rs. MoveNext
Wend
End Sub
Note that a select statement is used. It is used to access WorkFlowServer data.
Let's take a look at the code I have rewritten with C.
Private EPSDK. Connection CreateConnection (String userName, String password)
{
EPSDK. Connection conn = new EPSDK. ConnectionClass ();
Conn. Open ("DSN = Adobe WorkFlow Server", "xuzhong ","");
Return conn;
}
Private void button#click (object sender, System. EventArgs e)
{
EPSDK. Recordset rs = new EPSDK. RecordsetClass ();
String strSql = "select DisplayName, UserID from Users ";
EPSDK. Connection conn = this. CreateConnection ("xuzhong ","");
Rs = conn. Execute (strSql );
While (! Rs. EOF)
{
String name = String. Format ("{0,-30} {1 }",
Rs. Fields ["DisplayName"]. Value. ToString (),
Rs. Fields ["UserID"]. Value. ToString ()
);
Print (name );
Rs. MoveNext ();
}
}
It implements the same functions as those written in VB.