Skip to main content
Kofax

Kofax TotalAgility - How to generate a session id when using activity notifications

Applies To

  • TotalAgility 7.5
  • TotalAgility 7.6
  • TotalAgility 7.7
  • TotalAgility 7.8

Scenario

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.  Note: These solution 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.

clipboard_e273d24dd4b39d722a1a33dd493ee2313.png

The URL generated in the email will be like below.

http://server/TotalAgility/Forms/LandingPage.form?jobid=616AA423EE8411EA945F0050560238AC&nodeid=1&EPC=0

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

clipboard_edfba35198dea6f502d1b2e2a0442f6e5.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

clipboard_e2ecf93d2eef42b6346fd4420025c44df.png

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

clipboard_e510b51d80dc87fc31e053950b6deee6f.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.

clipboard_eafe31a52dafddd19a5e78a46cdae8807.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.

http://server/TotalAgility/forms/Activity%20NotificationActivity%201.form?jobid=81EDAF6BEE8011EA945F0050560238AC&nodeid=1&EPC=0

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.