[JWF] [API] displays all current user information

Source: Internet
Author: User
Tags dsn
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.