IC5Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
Topic
  • 8 replies
  • Latest Post - ‏2013-10-10T22:12:26Z by sree666
sree666
sree666
8 Posts

Pinned topic JSR 286 Portlet: Assigning Event Payload to a global variable

‏2013-08-30T20:15:47Z |

Hi Everyone

I need to implement portlet communication between a non HATS portlet and a HATS Portlet. I am using JSR286 Standard portlet.

1. I have a non HATS Portlet which publishes the event

2. I have configured the HATS Portlet to process this event and assign the event Object (payload) to a global Variable by doing the following setting in Project settings

Project Settings > Other > Portlet > Add Global Variable.

I tried to use the above global variable in another screen event to this event value. But I got the below error

2013.08.30 14:48:05.302 com.ibm.hats.common.actions.InsertAction executeVariable  x7      
  ERROR HAT0606 Global variable "memberId" does not exist.

Can you please help in understanding the issue here. I do not get a clue here. Please let me if you have any other suggestions in implementing JSR 286 Portlet implementation.

 

THANKS IN ADVANCE

Updated on 2013-08-30T20:16:10Z at 2013-08-30T20:16:10Z by sree666
  • SanthiRamala
    SanthiRamala
    34 Posts

    Re: JSR 286 Portlet: Assigning Event Payload to a global variable

    ‏2013-09-02T10:19:28Z  

    Hi Sree,

    Check the following...

    ->  In portal server wiring is configured or not?

    -> Before insert action try to add a business logic to print the "memberId" global variable.

     

    Thanks

    Santhi

     

  • sree666
    sree666
    8 Posts

    Re: JSR 286 Portlet: Assigning Event Payload to a global variable

    ‏2013-09-03T16:56:18Z  

    Hi Sree,

    Check the following...

    ->  In portal server wiring is configured or not?

    -> Before insert action try to add a business logic to print the "memberId" global variable.

     

    Thanks

    Santhi

     

    Thanks Santhi for the response.....

    Here are the answers for your questions....

     

    ->  In portal server wiring is configured or not?

    Yes wiring is configured through Portal Administration. I am also able to navigate from non HATS portlet to HATS portlet successfully. Only issue is I am not able to assign the Portlet event payload(event object) to a Global variable. Please find the screenshots attached for the configuration I have done on HATS Project Settings for this.

    -> Before insert action try to add a business logic to print the "memberId" global variable.

    Yes I tried to print the value of global variable in business logic, I am getting null here. I have also added a screenshot for this.

     

    Thanks

    Sree

    Attachments

  • sudhakarkethi
    sudhakarkethi
    7 Posts

    Re: JSR 286 Portlet: Assigning Event Payload to a global variable

    ‏2013-09-30T16:49:50Z  

    Check the Web.xml if the value is being passed or not and where are you using this GV.

  • sree666
    sree666
    8 Posts

    Re: JSR 286 Portlet: Assigning Event Payload to a global variable

    ‏2013-10-03T17:04:01Z  

    Check the Web.xml if the value is being passed or not and where are you using this GV.

    HI Sudhakar

    Thanks for your reply

    Can you please let me know what element I should look for in web.xml

    I am using the GV to pass as an input to a particular screen. Apart from this, as I explained before, I tried to print this value in business logic and it printed null.

  • sudhakarkethi
    sudhakarkethi
    7 Posts

    Re: JSR 286 Portlet: Assigning Event Payload to a global variable

    ‏2013-10-03T18:56:21Z  
    • sree666
    • ‏2013-10-03T17:04:01Z

    HI Sudhakar

    Thanks for your reply

    Can you please let me know what element I should look for in web.xml

    I am using the GV to pass as an input to a particular screen. Apart from this, as I explained before, I tried to print this value in business logic and it printed null.

    Hi Sree,

     

    What i understand from the post is that you are trying to update the GV from the value you are getting it from another portlet? for that you should have that value to be part of the web.xml as in the receiving Events and also part of the portlet wiring. then you can see the events sent and receieved properly

     

    Thanks,

    Sudhakar

  • sree666
    sree666
    8 Posts

    Re: JSR 286 Portlet: Assigning Event Payload to a global variable

    ‏2013-10-07T21:03:08Z  

    Hi Sree,

     

    What i understand from the post is that you are trying to update the GV from the value you are getting it from another portlet? for that you should have that value to be part of the web.xml as in the receiving Events and also part of the portlet wiring. then you can see the events sent and receieved properly

     

    Thanks,

    Sudhakar

    HI Sudhakar

     

    I do not have a problem in the portlet event communication. In fact I am also able to print the received event value(pay load) in the processEvent() method of the receiver portlet. The problem here is this event value is not being assigned to the global variable which is supposed to be when the project settings is configured.

    This event value is not a static value like some property. It will be passed from a non HATS portlet to HATS portlet at runtime based on the application input. I am not sure how you want this to be configured in web.xml. Can you please provide more details.

  • sudhakarkethi
    sudhakarkethi
    7 Posts

    Re: JSR 286 Portlet: Assigning Event Payload to a global variable

    ‏2013-10-07T21:17:07Z  
    • sree666
    • ‏2013-10-07T21:03:08Z

    HI Sudhakar

     

    I do not have a problem in the portlet event communication. In fact I am also able to print the received event value(pay load) in the processEvent() method of the receiver portlet. The problem here is this event value is not being assigned to the global variable which is supposed to be when the project settings is configured.

    This event value is not a static value like some property. It will be passed from a non HATS portlet to HATS portlet at runtime based on the application input. I am not sure how you want this to be configured in web.xml. Can you please provide more details.

    In Web.xml you will not do any configurations. usually when you create any event, the information of the event is stored in web.xml.

    I was asking you to check if that created properly.

    can you try assigning the Event value to the global variable inside a custom.event instead of trying it at the project level.

    if you want to assign it once the connection happens try to assign it at the connect.evnt

  • sree666
    sree666
    8 Posts

    Re: JSR 286 Portlet: Assigning Event Payload to a global variable

    ‏2013-10-10T22:12:26Z  

    In Web.xml you will not do any configurations. usually when you create any event, the information of the event is stored in web.xml.

    I was asking you to check if that created properly.

    can you try assigning the Event value to the global variable inside a custom.event instead of trying it at the project level.

    if you want to assign it once the connection happens try to assign it at the connect.evnt

    Sudhakar

    If you want me to look out for a alternative, I already have a solution. I am wondering why the setting which is expected to work is not working. Did this work for you in the scenario I presented ?