12-02-05 10:45 PM
You need to use TransformInfo to work with global variables in a
transformation jsp- eg:
IGlobalVariable column1 =
((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO)).get
GlobalVariable("Column1", true);
Thanks,
Alisa
"Ben" <hatsnewsgroup99@kurva.org> wrote in message
news:dlhmj7$3vb6$1@news.boulder.ibm.com...
> Using hats 6.0 I am trying to call business logic to clear some global
vars.
> It works fine when I call it it from an event but I was wondering if it is
> possible to call it with JSP? When I try to call it in JSP, it expects
> blInfo but I can't seem to get it right. I've also tried to call it within
a
> macro but I couldn't get that to work either. Help on either would be
> greatly appreciated.
>
> Thanks
> Ben
>
>
> public class ListGlobalVars
> {
>
> /**
> * Method that executes business logic on a session
> * This is invoked by the runtime when an Execute Action is requested
> * in the Screen Customization Event
> * @param blInfo - Contains useful information about the current
> application
> */
> public static void execute(BusinessLogicInfo blInfo)
> {
> // TEST reading Globals
> IGlobalVariable local_global_variable =
> getGlobalVariable(blInfo,"AcctNum");
> if( null != local_global_variable) {
> //Retrieve the local Global Variable listing in Hashtable form.
> Hashtable localGlobalVariables = blInfo.getGlobalVariables();
> System.out.println ("size: " + localGlobalVariables.size());
> //System.out.println (localGlobalVariables.toString());
> for (Enumeration e = localGlobalVariables.elements() ;
> e.hasMoreElements() ;) {
> System.out.println(e.nextElement());
> }
> }
> }
>
> /**
> * Example method that sets a named global variable from the
> current session to a value
> * @param blInfo - BusinessLogicInfo from current session
> * @param name - Name of the global variable
> * @param value - Value of the global variable
> */
> public static void setGlobalVariable(BusinessLogicInfo
> blInfo,String name,Object value)
> {
> IGlobalVariable gv = blInfo.getGlobalVariable(name);
> if ( gv == null )
> ...
> ...
> ...
> ...
>
>
>
[ Post a follow-up to this message ]
|