Calling Business Logic
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > WebSphere > WebSphere HATS > Calling Business Logic




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Calling Business Logic  
Ben


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-17-05 10:45 PM

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 ]



    Re: Calling Business Logic  
Alisa


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
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 ]



    Re: Calling Business Logic  
Marta L


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-05-05 12:45 PM

Hi all,
I have the same issue that Ben asked about. How to obtain an existing global
variable is clear, even you can do it with the wizard, but the matter is how
to update or create a global variable inside the jsp (with setVariableGlobal
I suppose). We would be interested in knowing how to code this.

Thanks



"Alisa" <alisa@us.ibm.com> escribió en el mensaje
news:dmqca0$2812$1@news.boulder.ibm.com...
> 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... 
> vars. 
is[vbcol=seagreen] 
within[vbcol=seagreen]
> a 
>
>







[ Post a follow-up to this message ]



    Re: Calling Business Logic  
Ben C


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-07-05 01:45 AM

Thank Wei Guo for this one: (We are using Hats 6.0)


<%@ page import="com.ibm.hats.common.*, com.ibm.hats.util.*" %>

<%
//clear serviceList
IGlobalVariable gv =
((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO)).get
GlobalVariable("serviceList",true);
gv.clear();
// You can set it with this
gv.set("some new value");
%>



Ben
"Marta L" <mlorenzo@opennorte.com> wrote in message
news:dn1a2o$8ok4$1@news.boulder.ibm.com...
> Hi all,
> I have the same issue that Ben asked about. How to obtain an existing
> global
> variable is clear, even you can do it with the wizard, but the matter is
> how
> to update or create a global variable inside the jsp (with
> setVariableGlobal
> I suppose). We would be interested in knowing how to code this.
>
> Thanks
>
>
>
> "Alisa" <alisa@us.ibm.com> escribió en el mensaje
> news:dmqca0$2812$1@news.boulder.ibm.com... 
> ((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO)).g
et 
> is 
> within 
>
>







[ Post a follow-up to this message ]



    Re: Calling Business Logic  
Marta L


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-07-05 12:50 PM

Thanks both, it works.


"Ben C" <hatsnewsgroup99@KURVA.ORG> escribió en el mensaje
news:dn5i9s$800g$1@news.boulder.ibm.com...
> Thank Wei Guo for this one: (We are using Hats 6.0)
>
>
> <%@ page import="com.ibm.hats.common.*, com.ibm.hats.util.*" %>
>
> <%
> //clear serviceList
> IGlobalVariable gv =
>
((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO)).get
GlobalVariable("serviceList",true);
> gv.clear();
> // You can set it with this
> gv.set("some new value");
> %>
>
>
>
> Ben
> "Marta L" <mlorenzo@opennorte.com> wrote in message
> news:dn1a2o$8ok4$1@news.boulder.ibm.com... 
((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO)).get[vbcol=seagreen]
 
global[vbcol=seagreen] 
it[vbcol=seagreen] 
expects[vbcol=seagreen] 
>
>







[ Post a follow-up to this message ]



pkum9999 is offline     Re: Re: Calling Business Logic  
pkum9999


View Ip Address Report This Message To A Moderator Edit/Delete Message


Click Here to See the Profile for pkum9999 Click here to Send pkum9999 a Private Message Find more posts by pkum9999 Add pkum9999 to your buddy list
 
07-26-06 04:05 PM

quote:
Originally posted by Marta L Thanks both, it works. "Ben C" <hatsnewsgroup99@KURVA.ORG> escribió en el mensaje news:dn5i9s$800g$1@news.boulder.ibm.com... > Thank Wei Guo for this one: (We are using Hats 6.0) > > > <%@ page import="com.ibm.hats.common.*, com.ibm.hats.util.*" %> > > <% > //clear serviceList > IGlobalVariable gv = > ((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO)).get GlobalVariable("serviceList",true); > gv.clear(); > // You can set it with this > gv.set("some new value"); > %> > > > > Ben > "Marta L" <mlorenzo@opennorte.com> wrote in message > news:dn1a2o$8ok4$1@news.boulder.ibm.com... ((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO)).get[vbcol=seagreen] global[vbcol=seagreen] it[vbcol=seagreen] expects[vbcol=seagreen] > >
I am trying to add some logic in my index.jsp to set a global variable . I t ried using the above logic but as the global variable doesn't exist , I keep getting null exception. Can you please clarify how to first create and set a global variable in the business logic. thanks PK




[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 04:45 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register