Use Event Hooks to call VIP Flows
Search Knowledge Base by Keyword
Using Event Hooks provides a way to
- Call an expression
- Save and modify an object using an assigned statement
- Save an object back to the DB
- Call a VIP flow to do something fancy with it
- Call a VIP flow to update an object API to perform an action/do something with it
EventHooks Example:
Let’s look at the Event Hooks Tab:
This example, which again refers to the SampleCommerce Database, will use an expression to do two things:
1) Gets a value from an OrderItem value that has been generated
2) Modifies the value based on the Total Amount value that is generated in the OrderItem.
First we create a Lambda Expression in the Expression Column. A Lambda Expression is code that takes in Parameter/s and returns a Value.
- The left side specifies which Object needs to be modified.
- The right side specifies the calculation function.
A Lambda expression for calculating the Total for an OrderItem is:
var_Order_.Total = lst_OrderItem_.Where(Function(x) x.OrderID = var_Order_.ID).Sum(Function(a) a.UnitPrice * a.Quantity)
**Lambda Expressions use VB.Net syntax**
More information on Lambda Expressions
To see what the Expression ResultType should be, look back at the Order Table:
Above you can see in the Data_Type column that DECIMAL should be lowercase decimal so that needs to be changed in the EventHooks Table:
Note: Values for Type should be followed by a ‘?’ except for Type ‘String’. The ‘?’ notation allows for a NULL value. If this is not done, and a NULL value is encountered an error will be triggered.
Alternatively, the same thing can be achieved using a flow. A FlowPath (FlowPath Column) must be specified in the Type Column. Example (CaluculateTotal.vip)
The Parameters can be specified in EventHooks Parameter.
The Parameter Name (ParameterName Column) must exist in the flow
Specifies which parameter should be passed from the Data Generation flow. It could be
- A PreProcessVariable name
- Any Parameters supported in vip (and can be looked at)
For more information see the Parameters section.
You can pass either Parameters or Fixed Values to the Flow.
-
-
-
- IEnumerable to Data Reader
- Data Table to List
- Nested String List to Data Table
- List to Data Table
- IEnumerable to List
- List to IEnumerable
- Remove from List
- Exists in List
- Value Exists in Dictionary
- Key Exists in Dictionary
- Remove from Dictionary
- Get from Dictionary
- Clear Dictionary
- Add to Dictionary
- Clear List
- Add to List
- Show all articles ( 1 ) Collapse Articles
-
-
-
-
- Introduction
- Overview of the Advanced Control Spreadsheet
- Refining the Control Spreadsheet
- The ProcessModel sheet – Toggling Subset Rules
- The Tables Sheet: Defining Metadata that will be read from the Source Database
- The ForeignKeys Sheet - Specifying which Foreign Keys to read from the Source Database
- Explanation of Remaining Sheets in the Control Spreadsheet (for reference only)
-
- Overview of Post-Subset Actions
- Add Primary Keys
- Add Foreign Keys
- Add Both Primary and Foreign Keys (The Composite ADDKEYS action)
- Validate that Primary Keys are Unique
- Validate that Foreign Keys are Unique
- Validate Both Primary and Foreign Keys (The composite ValidateKeys Action)
- Drop Foreign Keys
- Drop Primary Keys
- Drop both Primary and Foreign Keys (The composite DROPKEYS Action)
- Delete Orphans
- Truncate Data
- Drop Tables
-
-
- How to Configure the Synthetic Test Data Configuration Control Sheet
- Sample Commerce Configuration Sheet Examples
- Adding Event Hooks in Configuration sheet for custom functionality
- Use Event Hooks to call VIP Flows
- How the PreProcessVariables Table is used in the Configuration sheet
- PreProcess Variables and Parameters
- Using SQL Functions to query Databases and Using the Queries in Data Generation Functions
- Different Methods for Connecting to Source Databases
- Summary of the Process to Configure the Test Data Configuration sheet
-
-
-
-
-
- Test Modeller : System requirements (Windows, Linux)
- Test Modeller : Installation components
- Test Modeller: Software Pre-requisites
- Test Modeller Core (Linux) Installation
- Test Modeller Core (Linux) Optional – Active Directory
- Test Modeller Core (Linux) Optional – SSL Certificate Installation
- Test Modeller Core (Linux) Optional – Postgres LDAP
- Test Modeller – Maintenance
- The UI Recorder
-
-
-
- Articles coming soon
-
- Articles coming soon
-
-
-
- Welcome Selenium (Java)
- Prerequisites (Selenium Java)
- Configuration (Java)
- Scan an Existing Web App
- Build a Model (Java)
- Generate Automation Code
- Execute Tests (Java)
- Import existing framework / custom page objects (Advanced)
- Edit Code Templates (Advanced)
- Extend Test Modeller (Advanced)
- Common Problems
-
-
-