HATS Tricks

5 Posts tagged with the transformation tag
0

HATS at RSC 2009

Posted by alisalm Jun 5, 2009


Hi everyone,

As HATS product manager, I wanted to take a little time to update you on HATS happenings at RSC 2009. There were three presentations that featured HATS:

  • EM03- Customer Examples - Lowering theTotal Cost of Ownership.. In this session, Al Grega, our WW EM sales executive, told how HATS was used at a Southern US Utility Company to decrease application training time and entry errors and increase productivty for CSRs, and also to extend part of the application to the Web to provide internet self help to customers to further off load the call center.
  • EM11- How a tactical HATS solution became a strategic asset - A Customer Story... Kenny Smith, of Strongback Consulting, and I did this session. I provided brief HATS overview, and Kenny described how HATS was used at a large company that does electronic payment processing to extend two feature rich (1000's of screens) CICS applications used by CSRs to do credit card account management to the Web in roughly four months. It is estimated that there will be a 75% reduction in training time.
  • SDP31- Web services in Minutes.... featuring HATS... In this session, Al Grega described HATS Web services creation, and then demoed it, featuring the easy to use Visual Macro Editor. You can try this yourself, using the Creating a Web Service using HATS lab, provided here at the HotSpot.

All in all, it was a great conference, with tons of technical resources, great presentations, opportunities for networking, and fun!


Alisa

0 Comments Permalink
0

The following code sample can be used to change the appearance of the active HATS input field.


  • This block of code can be added to the header of an individual transformation to apply this feature to a single page or to the template of the project to apply to all transformations.


<script type="text/javascript">
function highlight(e) {
   //get event from browser
   if (!e) var e = window.event;
      var element =  e.srcElement || e.target;
      if(element != null){
         //focus event occurs when input gains focus
         if(e.type == 'focus'){
            //store previous background color if it exists
            element.style.oldColor = element.style.backgroundColor;
            //set new background color to specified value
            element.style.backgroundColor="#ffff90";
         }
         //blur event occurs when input loses focus
         else if(e.type == 'blur'){
            //if input had a specific background color restore it
            if(element.style.oldColor) {
               element.style.backgroundColor = element.style.oldColor;
            }
            //else set background color back to white
            else {
               element.style.backgroundColor = "#FFFFFF";
            }
         }
      }
}

function initInputs() {
   //get array with all input elements on HATS Form
   var inputs = document.HATSForm.getElementsByTagName("input");

   for (i=0; i<inputs.length; i++) {
      var attr = inputs[i].getAttribute("type");
      //assign events to inputs that are visible, text and password
      if ((attr == "text"|| attr == "password") && (attr != "hidden")) {
         //this syntax appends events instead of overwriting the current event list
         //Mozilla uses addEventListener to append events
         if(window.addEventListener) {
            inputs[i].addEventListener("focus",highlight,false);
            inputs[i].addEventListener("blur", highlight,false);
         } 
         //IE uses attachEvent to append events
         else if (window.attachEvent) {
            inputs[i].attachEvent('onfocus', highlight);
            inputs[i].attachEvent('onblur', highlight);
         }
      }
   }
}

//use window.onload event to run function once page is loaded
if(document.createElement) window.onload = function(){
   initInputs();
};
</script>

Using this code the resulting screen would look like this:
http://www-949.ibm.com/software/rational/cafe/servlet/JiveServlet/downloadImage/1574/highlight.gif

  • An alternate highlighting option could be to highlight the border of the input instead of the background. This can be accomplished by changing the highlight function in the code above to the following:


function highlight(e) {
   //get event from browser
   if (!e) var e = window.event;
   var element =  e.srcElement || e.target;
   if(element != null){
      //focus event occurs when input gains focus
      if(e.type == 'focus'){
         //store previous border color
         element.style.oldBorderColor = element.style.borderColor;
         //set new border color to specified value
         element.style.borderColor = "black";
      }
      //blur event occurs when input loses focus
      else if(e.type == 'blur'){
         //set the border color back to the original value
         element.style.borderColor = element.style.oldBorderColor;
      }
   }
}


Using this code the resulting screen would look like this:
http://www-949.ibm.com/software/rational/cafe/servlet/JiveServlet/downloadImage/1575/border.gif

The two options could also be combined to highlight the background and border together:
http://www-949.ibm.com/software/rational/cafe/servlet/JiveServlet/downloadImage/1576/highlight_border.gif

0 Comments Permalink
1

How to use Global Variables to populate Macro Variables in a HATS Transformation Macro

If you want to populate a macro variable with a global variable value, there is an easy way to do so.
The first step is to make sure that there is a global variable to prompt from.

Create a Global Variable

  1. In your screen customization, go to the Actions tab.
  2. Choose Add and select Set Global Variable.
  3. Name the global variable and give it an initial value so that we can use it in the macro later.
  4. Click Finish and make sure that the actions are in the proper order (the Set Global Variable should be before the Play Macro).
http://www-949.ibm.com/software/rational/cafe/servlet/JiveServlet/downloadImage/38-1197-1553/setGlobalVariable.JPG
Now we need to make sure that your macro is set up to work with macro variables, and that the macro has a macro variable available to work with.

Create a Macro Variable

  1. Open up the macro with the Visual Macro Editor.
  2. Right click on the screen and choose properties.
  3. In the properties panel choose Variables and Types.
  4. Make sure the choice for Enable support for variables and arithmetic expressions is enabled.
  5. If you have a macro variable, make sure it is available, otherwise create a macro variable on this page.
  6. To create a macro variable, click Add and give the variable a name (you do NOT need $ symbols around the name for this wizard) and a value (string values require single quotes) and press Finish.
http://www-949.ibm.com/software/rational/cafe/servlet/JiveServlet/downloadImage/38-1197-1554/addMacroVar.jpg
This macro variable will show in the source view as
<vars>
<create name="$testMV1$" type="string" value="'hello world!'"/>

</vars>
Now that we have a valid macro variable, we can use it in the prompt action.

Create a Prompt Action

  1. In the macro, create a new prompt action using the Visual Macro Editor. In the macro main view, right click on the screen that you wish to modify and choose properties.
  2. Choose Actions. In the actions table, choose Add. When given the choice of what action to add, choose Prompt.
  3. In the Prompt panel, name the prompt, select save value to variable and choose the correct macro variable. Make sure to enable Do not insert value into field unless it was specifically your intention to do otherwise. For the handler, choose Set prompt to global variable and choose the correct global variable. Press Finish and make sure that the new prompt action is in the correct place in the list.
http://www-949.ibm.com/software/rational/cafe/servlet/JiveServlet/downloadImage/38-1197-1555/add+macro+prompt+steps.jpg
In the source view you can see that the following action was added to the screen.
<prompt assigntovar="$testMV1$" clearfield="false" col="0" default="" description="" encrypted="false" len="80" movecursor="false" name="'gv_to_mv'" required="false" row="0" title="" varupdateonly="true" xlatehostkeys="false"/>
Note that the assigntovar parameter has the macro variable name with the $ symbol surrounding the macro variable name. Also notice that the varupdateonly parameter in the prompt action was set to true, so that we will not accidentally change the host screen.
We are finished, and now can get our global variable value to our macro variable!

Next time I will cover how to copy data in the other direction, from a macro variable to a global variable.

1 Comments Permalink
0

HATS 7.5.0.1 fix pack is now available.

The HATS 7.5.0.1 fix pack includes fixes as well as these new enhancements:

*Host On-Demand custom table support in HATS

*Rational products Visual Editor support for use in creating HATS Rich Client transformations

*Automatic sorting of component and widget settings in the application.hap file rendering sets

*WebFacing migration update

*JIS2004 support

For more information on this fix pack, please see Rational Host Access Transformation Services, Version 7.5.0.1

0 Comments Permalink
0

Welcome to the HATS HotSpot!

We plan to use this space as a place to have discussions and enable collaboration between HATS users.

In case you are new to HATS, H A T S stands for Host Access Transformation Services. HATS enables you to quickly invest in Enterprise Modernization by allowing you to access your applications and transform the appearance and flow without needing to modify the back-end systems.

With HATS, you can extend your 3270 and 5250 host applications to the Web, to portlets, to rich clients, to web services, or to browsers on mobile devices quickly, easily, and with low risk. This can go even further to allow you to provide Web Services as SOA assets and create additional logic from customized code, or even create services from VT host applications!

You can improve the workflow and navigation of your host applications, without needing access to application source code.

The technology that HATS provides allows many different possibilities right from the beginning. Import BMS maps, use our WebFacing technology with your DDS source to automatically transform whole systems of screens, or just start off with the default renderings.

You can define transformations to extend and modernize individual and sets of screens, define additional business logic with data storable in global variables, use text replacements and global rule definitions to transform content, and let HATS automatically take care of the screens you haven't handled. Macros allow you redefine the flow directly or by creating Integration Objects which can be turned into services or their own web pages, even EJBs. With HATS you can even redefine how a user sees a Green Screen view, so that a list of selections can be recognized as a component of the screen and transformed into a drop down or links or removed altogether.

You can find more information about the HATS product at the HATS Product Site as well as the WebFacing and HATS technology blogs, sites, and discussions around the IBM Rational Cafés. We are looking forward to collaborating with everyone on many exciting ideas.

0 Comments Permalink
Bottom Banner