Integrate VB code with Workflow
Hi all,
I have the following codes to get the current user who is logging in the Windows XP workstation.
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal)
Dim MyPrincipal As WindowsPrincipal = CType(System.Threading.Thread.CurrentPrincipal, WindowsPrincipal)
Dim pUserName As String = MyPrincipal.Identity.Name
I need to hook this piece of codes with a Workflow, so that when the Workflow runs, it knows who is logging on the workstation.
My question is if this is possible and how this can be managed in Workflow Designer?
Thanks!
Cheers,
Alex
-
I believe there is now a workflow task in the latest designer that already does this. There is an activity called get current user that returns the user name accessing the workflow I belive. I have not yet tried it yet but it looks similar to your vb code. You could always create your own custom activity as well.
0 -
Alex,
You would have to put that code into a custom workflow activity to run it from workflow, BUT-
Since a workflow is run by Essentials on behalf of a user, it would only ever get the identity of the Essentials app pool.
The new Get Current User activity should do what you want. If your site is secured with Windows security, this activity will determine which user authenticated against the workflow.
Regards,
-Malcolm
0 -
Thanks, Nick and Malcolm, for both of your replies.
I ever tried GetCurrentUser workflow that comes with Work Designer 3.6, it returned nothing while it wasn't configured to use any security scheme. I am sure when Windows Authentication is properly configured it would work it out.
Now the question is, however, how to correctly configure Geocortex site with Windows Authentication. I tried to enable Security and selected Windows Authentication in Site Configuration. But I failed to get it to work as I am unsure which role and username to put in there. Very very little about it is given in the Workflow Designer Help Document.
An example would be really appreciated on it. Thanks!
Alex
0 -
I believe you need version 3.7 to access the current user activity.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
4 Kommentare