Short-circuiting Navigation

RAMP-NL

Short-circuiting Navigation


Sometimes 5250 enquiry style transactions use a 5250 screen that loop on <enter key values> -> <display data> -> <enter key values> -> <display data> interactions.

 Typically these screens have an INVOKE script that is structured along these lines:  

 

         var strAccessMenu   = "SomeMenuScreenName";

         var strThisEnquiry  = "SomeCherryEnquiryScreenName";    

 

         /*  Navigate to the menu that will provide access to the enquiry function */

        

         NAVIGATE_TO_JUNCTION(strAccessMenu);

         if ( !( CHECK_CURRENT_FORM(strAccessMenu, "Could not display menu", strAccessMenu) ) return;

 

         /* Invoke the screen from the access menu */

 

         SETVALUE("uMenuOptionField","7");  /* Say */

         SENDKEY(KeyEnter);

         if ( !( CHECK_CURRENT_FORM(strThisEnquiry,"Could not display enquiry screen", strThisEnquiry ) ) return;

 

         /* Enter the appropriate key value and display the enquiry details */

        

         SETVALUE("uKeyValueField",objInstanceList.Akey1[0] );  /* Say */

         SENDKEY(KeyEnter);

         if ( !( CHECK_CURRENT_FORM(strThisEnquiry,"Could not display", strThisEnquiry ) ) return;

         

         /* Finished */

 

When this transaction is used repeatedly (for example by clicking down through an instance list or orders, products, policies, etc) you can sometimes short-circuit the navigation logic by a simple script change along the following lines. This change produces less 5250 screen interactions giving a faster response for your end-users:

 

         var strAccessMenu   = "SomeMenuScreenName";

         var strThisEnquiry  = "SomeCherryEnquiryScreenName";    

 

         /* We only need to navigate if we are not already at the screen */

 

         if ( CURRENT_FORM() != strThisEnquiry )

         {      

 

             /*  Navigate to the menu that will provide access to the enquiry function */

        

             NAVIGATE_TO_JUNCTION(strAccessMenu);

             if ( !( CHECK_CURRENT_FORM(strAccessMenu, "Could not display menu", strAccessMenu) ) return;

 

             /* Invoke the screen from the access menu */

 

             SETVALUE("uMenuOptionField","7");  /* Say */

             SENDKEY(KeyEnter);

             if (!(CHECK_CURRENT_FORM(strThisEnquiry,"Could not display enquiry screen",strThisEnquiry)) return;

        

         }  

 

 

         /* Enter the appropriate key value and display the enquiry details */

        

         SETVALUE("uKeyValueField",objInstanceList.Akey1[0] );  /* Say */

         SENDKEY(KeyEnter);

         if ( !( CHECK_CURRENT_FORM(strThisEnquiry,"Could not display", strThisEnquiry ) ) return;

 

         /* Finished */