Previous Topic: Define Special FieldsNext Topic: Automatic Scrolling Command Values


Repeating Groups and Automatic Scrolling

Some procedure steps deal with repeating import or export data views. For example, consider a procedure step called List Customers, which provides a list of customer names and phone numbers beginning with a certain value.

Such a procedure step might have import and export views that look like those in the following sample code.

Repeating Export Data View

Procedure Step LIST_CUSTOMER                             
   LIST_CUSTOMERS                                        
      IMPORTS                                            
            Entity ViewCustomer (mandatory, persistem    
                      Attributes                         
                               Name                      
      EXPORTS                                            
            Group ViewListed                             
                    Cardinality MIN: 0  Max: 100  Avg: 50
            Entity ViewCustomer (transitive, export only)
                      Attributes                         
                               Name                      
                               Phone_Number    

Note: The group view Listed is a repeating group view, as indicated by its cardinality. The maximum cardinality, shown as 100, indicates that at most 100 values for Customer Name and Phone_Number will be returned as the result of executing the procedure step List Customers.

The implementation of such a procedure step in an online environment will require a screen similar to the following screens.

Screen Containing a Repeating Group 1

List Customer Starting Custmer Name ===> XXXXXXXXXXXXXXXXXXXX Customer Name Phone Number XXXXXXXXXXXXXXXXXXXXXX (XXX) XXX-XXXX XXXXXXXXXXXXXXXXXXXXXX (XXX) XXX-XXXX XXXXXXXXXXXXXXXXXXXXXX (XXX) XXX-XXXX XXXXXXXXXXXXXXXXXXXXXX (XXX) XXX-XXXX XXXXXXXXXXXXXXXXXXXXXX (XXX) XXX-XXXX XXXXXXXXXXXXXXXXXXXXXX (XXX) XXX-XXXX XXXXXXXXXXXXXXXXXXXXXX (XXX) XXX-XXXX

Screen Containing a Repeating Group 2

List Customer Starting Custmer Name ===> XXXXXXXXXXXXXXXXXXXX Customer Name Phone Number XXXXXXXXXXXXXXXXXXXXXX (XXX) XXX-XXXX (XXX) XXX-XXXX (XXX) XXX-XXXX XXXXXXXXXXXXXXXXXXXXXX (XXX) XXX-XXXX (XXX) XXX-XXXX (XXX) XXX-XXXX XXXXXXXXXXXXXXXXXXXXXX (XXX) XXX-XXXX (XXX) XXX-XXXX (XXX) XXX-XXXX XXXXXXXXXXXXXXXXXXXXXX (XXX) XXX-XXXX (XXX) XXX-XXXX (XXX) XXX-XXXX XXXXXXXXXXXXXXXXXXXXXX (XXX) XXX-XXXX (XXX) XXX-XXXX (XXX) XXX-XXXX XXXXXXXXXXXXXXXXXXXXXX (XXX) XXX-XXXX (XXX) XXX-XXXX (XXX) XXX-XXXX XXXXXXXXXXXXXXXXXXXXXX (XXX) XXX-XXXX (XXX) XXX-XXXX (XXX) XXX-XXXX

The multiple occurrences of Customer Name and Phone_Number shown on this screen are referred to collectively as a repeating group.

Notice that only ten occurrences of the repeating group appear on the screen, yet the maximum cardinality of the group view is 100. In a case like this, you can use scrolling to provide a window on the repeating group. Through this window, a user can see ten values for Customer Name and Phone_Number at a time.

You implement the scrolling feature using the Scroll Indicator property of a screen. When the CA Gen-generated procedure step executes, it automatically includes support for moving backward and forward ten occurrences at a time through the 100 occurrences of Customer Name and Phone_Number.

You can use automatic scrolling on one repeating group per screen. In the case of nested repeating groups, only the highest level repeating group is scrolled. For example, the view definitions in the following sample code reflect a modified version of List Customers, called List Customers 2, in which each customer can have six phone numbers.

Nested Repeating Group Views

Procedure Step LIST_CUSTOMER_2
LIST_CUSTOMER_2
     IMPORTS
         Entity ViewStarting_Customer
               Attributes
                       Name
     EXPORTS
        Group ViewListed
               Cardinality Min: 0  Max: 100  Avg: 50
        Entity ViewReturned_Customer
               Attributes
                       Name

The screen for the nested repeating group views is illustrated next.

Screen With a Nested Partial Repeating Group

List Customer Starting Customer Name ===> XXXXXXXXXXXX Customer Name Phone Number XXXXXXXXXXXXXXXXXXXX (XXX) XXX-XXXX (XXX) XXX-XXXX (XXX) XXX-XXXX XXXXXXXXXXXXXXXXXXXX (XXX) XXX-XXXX (XXX) XXX-XXXX (XXX) XXX-XXXX XXXXXXXXXXXXXXXXXXXX (XXX) XXX-XXXX (XXX) XXX-XXXX (XXX) XXX-XXXX XXXXXXXXXXXXXXXXXXXX (XXX) XXX-XXXX (XXX) XXX-XXXX (XXX) XXX-XXXX XXXXXXXXXXXXXXXXXXXX (XXX) XXX-XXXX (XXX) XXX-XXXX (XXX) XXX-XXXX XXXXXXXXXXXXXXXXXXXX (XXX) XXX-XXXX (XXX) XXX-XXXX (XXX) XXX-XXXX XXXXXXXXXXXXXXXXXXXX (XXX) XXX-XXXX (XXX) XXX-XXXX (XXX) XXX-XXXX