Skip to main content

How to generate a session id when using activity notifications

Article # 3036710 - Page views: 123


Activity notifications are used to alert a resource that they have an activity pending in the Work Queue.  A URL to the activity is included in the email.  Since no session id is included in the URL, we get errors when trying to take the activity directly from the email.

There are 2 solutions to this problem.  These solutions are only guidelines and can be changed based on requirements.


Solution 1

When setting up the notifications at activity level, we enter the URL of a Landing Page & set Append Associated File to false as shown below.  This Landing Page will be a logon form (manual or windows) so a session id is generated prior to taking the activity.

Configure URL.png

The URL generated in the email will be like below.


Due to the query string in the URL, our landing page form needs to have form initialisation parameters configured with the exact same name.

Configure Landing Page.png

When we logon using the Landing Page, the below actions should be fired:

  1. Logon: Use one of the logon SDK methods to generate a valid SESSION_ID
  2. Take Activity: Calls ActivityService.TakeActivity() to take the job activity identified by the query string parameters.  In the return variables, map AssociatedFile to a form variable.  This will be used in step 3

Configure Associated File.png

   3. Redirect:  Performs a dynamic redirect to the form associated with the activity while passing in the form initialisation parameters

Configure Dynamic Redirect.png

The result will be the user will be automatically directed to the activity after logging in.


Solution 2

We can also direct to an activity directly without going through a landing page. When setting up the notifications at activity level, we enter a base URL & set Append Associated File to true as shown below.

Solution 2 - Configure URL.png

The URL generated in the email will be like below.  As you can see the associated activity form and relevant query string parameters are concatenated with the base URL.


To automatically generate a session after clicking the URL, the below actions should be added on load of the take activity form.

  1. Begin Condition: Checks if the SESSION_ID global variable is empty
  2. Logon: Calls UserService.LogOnWithWindowsAuthentication2() to generate a valid SESSION_ID
  3. End Condition

NOTE:This will only work when the take form has Header Form set to None. If a header form is present that requires a session id to perform actions, errors will be thrown.

Level of Complexity 



Applies to  

Product Version Build Environment Hardware
Kofax TotalAgility All      


Add any references to other internal or external articles


  • Was this article helpful?