In this lab you will learn how to create and use variables. Variables are containers for data. Data can be passed into a job when it is first created (Initialization data), retrieved from an external source while the job is running, and can be assigned as inputs (read only), and outputs (updateable), to an activity. As an example, your process may require customer type data e.g. name, address, etc. if you wish to generate a letter and send it to the customer as part of your process. Lab 11-1 Variables Create Process variables In this part of the lab, you will create two process variables. The variables will be used by the loan application process and in other labs throughout the course. Process variables are used to store data in Kofax TotalAgility, for example when a loan is applied for, the Loan Amount variable holds the amount of the loan being applied for, e.g. 500. When a loan decision is required the Approved variable is set to True or False. When a variable is assigned as a Process Initialization variable its value is provided at the beginning of the process. 1. With the Loan Application case process already open, click the Variables modelling link. 2. Add the following new process variables as shown below. Note: Loan Amount, Customer Id, and Customer Name have been set as process initialialization variables i.e. the process expects to be initialized with this data. Lab11 - Create Variables and connect to External Database.docx Last Revision: 08/12/2014 1
3. With the Variables model area still open, click the Initialization Order link and set the Initialization Order to Customer Id, Customer Name, and Loan Amount. Notes: (i) You can switch back to the Variables window using the Variables link. (ii) KTA uses the initialization order when you build a Create New Job form later in the course. The fields will be created on the form in the order you specify. 4. Click the Designer link. Note: Once you create a process variable, you cannot modify its ID or type. You must delete the process variable and re-create it. Add Input and Output Variables to Activities In this part of the lab, you will add variables to activities in the Loan Application process. For the Loan Approval activity an approver will need to know the customer's details and credit score (inputs), before they can approve or reject the loan (outputs). Also notice the use of the Creditscore variable, a variable specific to this activity, which cannot be provided by the loan applicant when the loan application is first applied for. We will retrieve the customer's credit score from a Customer database later on in the labs. 5. Select the Loan Approval activity. 6. Click the Extended Properties icon and select the Input/Output link. 7. Click the Variables consume icon in the Input field, and select Process in the Explorer. 8. Drag and drop the following process variables into the Input/Output area: Lab11 - Create Variables and connect to External Database.docx Last Revision: 08/12/2014 2
9. Click Close. 10. Release the process. Test a Variable Value in a Decision Node In this part of the lab, you will test the value of a variable in a Decision Node. 11. On the process, select the Approved decision node, click the Extended Properties icon and select the Condition Text link. 12. Delete the word TRUE from the condition textbox and drag the Approved variable into the Condition Text field. Notes: (i) [Approved] and [Approved]=True are equivalent. (ii) You can also use the following loigical operators/keywords: <, >, =, <>, >=, <=, NOT, And, Or etc. 13. Click Close. 14. Release the process (leave the process open for the next part). Lab11 - Create Variables and connect to External Database.docx Last Revision: 08/12/2014 3
In this lab, you will add a data node to the Loan Application Case Process. In this example we will use the data node to retrieve the applicant's credit score from an external database. Lab 11-2 Data Node Add a Data Node The Customer Id will be used as an input to the node to enable us to locate the matching credit score. A connection to the database that holds the credit score has already been created to hold this value. The connection string is: Server=(local);Trusted_Connection=Yes;Database=Customer; Note: this server variable can be found in the Data Module, filter by XYZ Bank category. 1. Select the Credit Check activity. 2. From the Type drop-down in Properties, change the Type from an Ordinary Activity to a Data Access. 3. Click the Extended Properties icon and select the Configuration link. 4. Click the Variables consume icon in the Connection String field, and select Server Variables. 5. In the Explorer filter by XYZ Bank category, and drag the Customer Database server variable to the Connection String field. 6. Click Configure. Kofax TotalAgility will attempt to connect to the database. 7. For Type select Tables. For Table select CreditScores. For Record select View. 8. In the All Columns list, select CreditScore and using the Add Arrow move to the Selected Columns list. For Selected Columns select Return Single Row. Lab11 - Create Variables and connect to External Database.docx Last Revision: 08/12/2014 4
9. Under the Conditions panel, configure the following: 10. Click Test (top right). 11. Enter 1 as the Customer Id and click OK. The Results for the test should return 10. Hint: To verify results, you can open Microsoft SQL Server Management Studio (from Start menu) login and open the CreditScores table in the Customer database. Note: The Data Access activity supports aggregate functions (Max, Min, and Count). 12. Click Ok and Ok again (top right). The Query is now listed in the Query window and the Output Parameter is also listed (CreditScore). 13. If Variables are not displayed in the List area, click the Variables icon in the Connection String field. 14. Click Server, filter by XYZ Bank category, drag and drop the Creditscore variable to the Output Parameters Value field. Lab11 - Create Variables and connect to External Database.docx Last Revision: 08/12/2014 5
15. Click Close. 16. Release the Loan Application Process. Lab11 - Create Variables and connect to External Database.docx Last Revision: 08/12/2014 6