This discussion is archived
1 2 Previous Next 25 Replies Latest reply: Jan 3, 2013 1:31 PM by 936409 RSS

Need to popup error message peopelsoft environment

936409 Newbie
Currently Being Moderated
Hi All,

I have some business requirement that i need to popup error message on peopelsoft environment based on table flag value for each 1 second i need to check the flag value in the table and popu the message( i mean not only one component it means any where in the peoplesoft environment)

I dont what event will trigger to do this in peoplesoft . May be java scrpit will work. But i dont know where to write thsi code ?

Any help will be apprecitated.

Regards,
Sabarinathan
  • 1. Re: Need to popup error message peopelsoft environment
    jim.marion Pro
    Currently Being Moderated
    To make this global, add the JavaScript to PT_COMMON or PT_COPYURL (depending on your PeopleTools release). If I were creating this, though, I would have some serious concerns. My primary concern would be the 1 second polling interval. 1 second is extremely often in a web environment. The point of the web is to connect, and then disconnect. It works because it is semi to fully stateless. Change that model and you may start experiencing network bandwidth issues, DOS, etc. basically resulting in poor performance all the way around. Because the polling interval is so tight (1 second), the alternative to a 1 second Ajax ping would be to use Comet or WebSockets. WebSockets are the recommended, HTML5 approach, but might not be available in your supported web browser. So basically, the Comet (or long polling Ajax) approach would be to have your JavaScript make a call to an iScript. The iScript would loop, querying the database every second. When it finds a flag value requiring a popup, the iScript would return. The JavaScript would take action, and then make another request to the iScript and wait. Keep in mind that this approach will tie up one connection (web server, app server, and database server) per logged in user. For this to work, your app server connection pool would have to be large enough to support all of these concurrent connections PLUS all normal, shared/pooled connections. This would be the simplest, but also most resource intensive method.

    The client side concept will be the same regardless of your approach, but I would recommend using some type of secondary server (reverse proxied through your PeopleSoft reverse proxy so the domain stays the same to avoid cross site scripting limitations) that accepts these long polling requests, and is notified by PeopleSoft (database scheduled task, integration broker, etc) so that you aren't tying up all those app server connections. It seems that a node.js HTTP(S) server would be a really good way to handle this type of event based long polling notification.
  • 2. Re: Need to popup error message peopelsoft environment
    jim.marion Pro
    Currently Being Moderated
    From the server side, I think the way I would architect this is to use socket.io with socket.broadcast.emit. Each client would join the conversation and one special client running on the server would join as well. That one special client would check the database on interval and then call broadcast.emit to notify all the other listeners. That way you aren't using up a lot of additional connections with everyone querying the database every second.
  • 3. Re: Need to popup error message peopelsoft environment
    936409 Newbie
    Currently Being Moderated
    jim ,

    Thanks for response, Its helps me.

    Just want to explain my real requirement here.

    I have table REC_TBL it has a field EMPLID, FLAG. When there is a value FLAG=Y/N . I have to check for every one second .

    if there is a value Y Then

    In Peoplesoft CRM i have to open a in new window of 360 degree component automaticaly for that EMPLID. ( this should trigger when the user was there in any part of the environment )

    UPDATE table REC_TBL Field FLAG=N;

    End;
  • 4. Re: Need to popup error message peopelsoft environment
    936409 Newbie
    Currently Being Moderated
    Jim,

    I saw your blog

    http://jjmpsj.blogspot.com/2006/09/ajax-and-peoplesoft.html

    I am new to ajax can you help me how can i implement this peoplesoft for this senario ?

    Thanks,
    Sabari
  • 5. Re: Need to popup error message peopelsoft environment
    jim.marion Pro
    Currently Being Moderated
    The solution is a bit too complicated for a forum answer. I wrote up a blog post with a lot of details: http://jjmpsj.blogspot.com/2012/12/broadcasting-notifications-to-logged-in.html, but that is only an example. It still leaves a lot for the reader to implement.
  • 6. Re: Need to popup error message peopelsoft environment
    936409 Newbie
    Currently Being Moderated
    Jim,

    After a long struggle i achieved this, used Iscript with jquery.

    Thanks
    Sabari
  • 7. Re: Need to popup error message peopelsoft environment
    jim.marion Pro
    Currently Being Moderated
    Sabari, are you using jQuery to send an Ajax request to your server every second or did you take some other approach?
  • 8. Re: Need to popup error message peopelsoft environment
    936409 Newbie
    Currently Being Moderated
    Jim,

    currently i am using Setinterval to check the database for every second. I know as you mention this will create a performance issue.

    I was thinking that can we use the some database trigger to initiate the Javascript ? I don't know how will we do it or possible or not ?

    If you have some idea plz share ?

    Thanks,
    Sabari
  • 9. Re: Need to popup error message peopelsoft environment
    936409 Newbie
    Currently Being Moderated
    Jim,

    Exactly i am calling the Iscript from Jquery using the setinterval of 1 sec.

    Iscript has the url content that will popup the page with information when ever the database record flg=Y.

    This is working now. Since i am working in demo instance it is fine no performance issue as of now. But my concern is when it goes to production this is not a good idea?

    So i am thinking how to make it perfect :)

    Regards,
    Sabari
  • 10. Re: Need to popup error message peopelsoft environment
    jim.marion Pro
    Currently Being Moderated
    I will be curious to know if you see performance issues. Theoretically you should, but there are a lot of variables. If you run any performance tests or go into production with the current setup, please write back with your experience.

    Per the blog post noted above, you will see that it isn't technically possible for the database to call client JavaScript directly. The blog post shows how to use socket.io to make that happen. With something like socket.io, the browser opens a connection to a server, and then when the server has something to send, it responds. Allowing a server to connect to a client would be a complete violation of the design of the internet. Fortunately, we can work around it with web sockets. The idea is that the clients connect to a central server, and then the database notifies the central server when it is time to send a message to clients. Server to server communication is perfectly acceptable. It is just not possible for server to browser connections because of firewalls, and listeners (there is no client listener to accept a connection if a server wanted to connect to a client).

    The blog post shows one mechanism using node.js. The same concept applies to other servers and other related technologies.
  • 11. Re: Need to popup error message peopelsoft environment
    936409 Newbie
    Currently Being Moderated
    Jim,

    This is my first ajax with peoplesoft. You have used so many technical words in your post which i am not aware about. But got the concept what you are talking about, will do more analysis and get back.

    Thanks
    Sabari
  • 12. Re: Need to popup error message peopelsoft environment
    jim.marion Pro
    Currently Being Moderated
    Congratulations and well done so far! You have made very good progress. I recommend using the Firebug plugin with Firefox as well as Fiddler. Firebug and Fiddler allow you to see the Ajax requests and responses.
  • 13. Re: Need to popup error message peopelsoft environment
    936409 Newbie
    Currently Being Moderated
    Thank you Jim,

    As you mentioned previously in my old post. I already installed the firebug add-on in to my Mozilla to debug the request and response. Its really cool.

    I followed your Post :)

    Regards,
    Sabari
  • 14. Re: Need to popup error message peopelsoft environment
    Nicolas.Gasparotto Oracle ACE
    Currently Being Moderated
    Sorry to jump in
    933406 wrote:
    ...
    currently i am using Setinterval to check the database for every second. I know as you mention this will create a performance issue.
    Despite the challenge it represents and really nice solution suggested by Jim, I'm wondering why such a requirement "+check the database for every second+".
    Where's this specification come from ? This will probably create a high network traffic as well as database checking and table lock (how many simultaneous connections are you going to have on the system ?). And you also want to make sure that the checking process is on hold status when you popup the window to the client and aknowledge it to avoid multiple popup window.
    Moreover, you said that once the check is done and it retrieves the value "Y", then you popup a message and update the value to "N". But what makes the change back the value to Y to make it checking again and again for every single second ?

    That said, I could understand as Jim explained in his blog, that is a good solution to send popup window to the client to tell that the system is going down or other maintenance related actions.

    Nicolas.
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points