Description
The CaseActionGen Generator emulates multiple if-then-else cases.
In This Article
- Video Training
- Generator Parameters
- Example - Generate User's Mode of Transportation based on Random Case
Video Training
The following video can be used to see a quick tutorial on how to use the CaseActionGen Generator:
Generator Parameters
The following parameters may be configured for the CaseActionGen Generator. Items with an asterisk* are required.
- default* - Defines the value selected if no cases are met.
- caseList - Defines a list of cases whose value should be Boolean.
- actionList - Defines a list of actions with each action matching one case.
Example - Generate User's Mode of Transportation based on Random Case
Determine the mode of a user's transportation based on the random case the falls into:
- if case 1 is true, then take a Car
- if case 2 is true, then take a Train
- if case 3 is true, then take a Plane
- else Walk
Generation Sequence From Left To Right
- Randomly generate a true or false value.
- Randomly generate a true or false value.
- Randomly generate a true or false value.
- Choose a final result based on the precedence of which case is true or choose the default case if none are true.
Note: This example shows the configuration with linked generators; however, users can also reference Attributes.
Step 1 - Assign the Required Generators to Attribute
- BooleanValueGen - car
- BooleanValueGen - plane
- BooleanValueGen - train
- CaseActionGen - generates output based on values generated by other linked generators
Step 2 - Enter 'walk' for Default Value
When all generated boolean values are 'false', the generated value will be 'walk'.
Step 3 - Enter Corresponding Actions for each Case
The generated value is based on the first generated boolean, 'true'. For example:
- value1 = false
- value 2 = true
- value 3 = true
The generated value will be based on value 2, and value 3 is ignored.