How to Use grEnable to Dynamically Turn Segments On and Off
This lesson provides information about dynamically turning Segments/Loops on and off within a G-Case using the grEnable Attribute. Segments/Loops (i.e., Domains) added to a G-Case are enabled by default.
Segments/Loops can be disabled (turned off) through the EDI Tree View or the G-Case Editor Tab. When turned off, the Segment/Loop will not be present within the generated EDI Document/Transaction Set.
In some instances, the Segment/Loop may need to be present in some but not every generated EDI Document/Transaction Set. Users can accomplish this by dynamically turning Segments/Loops on and off based on a generated value.
What is the grEnable Attribute?
The grEnable Attribute is added to a Test Case Domain for a Segment/Loop when it is turned off (disabled) within a G-Case. It can be used to dynamically turn Segments/Loop on and off during EDI test data generation.
By default, the grEnable Attribute is assigned the ConstantGen Generator and has a value of “false.”
Disable a Segment/Loop within a G-Case
Users can turn off Segments/Loops through the EDI Tree View by using the provided checkbox. Disabled Segments/Loops will not have a checkmark.
Step 1: Click on the EDI Tree View icon within the G-Case Management Dashboard.
Step 2: Turn off one or more Segments/Loops by removing the checkmark.
Step 3: Click the OK button.
The Segment/Loop will appear disabled within the G-Case Editor Tab.
Note: Segments/Loops can also be turned off directly within the G-Case Editor Tab by clicking the toggle to the right of the Segment/Loop name.
Modify the grEnable Attribute for the Segment/Loop
After the Segment/Loop has been disabled, the assigned Generator for the grEnable Attribute will need to be replaced with another Generator. A user can use more than one available Generator to accomplish this, including the following:
- BooleanValueGen Generator
- MultiWeightGen Generator
- SwitchGen Generator
For this example, we will show how to replace the assigned Generator with the BooleanValueGen Generator.
To dynamically turn Segments/Loops on and off, complete the following steps:
Step 1: View the Test Case Domain for the Segment/Loop. Click on the EDI (Pencil) icon within the EDI Tree View or the G-Case Editor Tab.
Step 2: Select the grEnable Attribute.
Step 3: Enter BooleanValueGen Generator within the Quick Generator Replacement Menu.
Step 4: Click on the Replace button.
Step 5: Modify the Generator Parameters and click the Save Generator button.
During EDI test data generation, the Segment/Loop will be dynamically turned on or off based on the value generated by the assigned BooleanValueGen Generator.
Below is a preview of the values generated by the BooleanValueGen Generator: