Search This Blog
Wednesday, September 30, 2009
Tuesday, September 29, 2009
How to clear appserver cache without shutting it down
It is often necessary to clear the physical cache files on the PeopleSoft application server. You would think that after all the length of time that PeopleTools has been around, that development would have sorted out the problems in object version numbering. Sometimes, recently migrated changes do not take effect until the cache is cleared. Global Support will nearly always ask you to clear the cache if you are experiencing any kind of problem in the PIA.
Normally, you would shut down the application server, delete the physical cache directories and restart the application server.
From PeopleTools 8.48, each Application server process can only use one dedicated set of physical cache files that is in a directory whose name includes the name and ID number of the server, (previously the server process could use any unlock set cache directories). This allowed PeopleSoft to add an option to the psadmin utility to trigger each PSAPPSRV process to clear out its own physical cache. This option also causes each server process to recycle. It is the recommended and supported way to clear the physical cache files.
This can also be invoked from the command line
psadmin -c purge -d <domain> [-noarch | -arch <archive_directory>] [-log <"log_comments">]
where 'domain' specifies domain name in PS_HOME and
'archive_directory' specifies location to which to quarantine the purged cache,
'log_comments' specifies any comments to be added to the purge cache log entry
However, even in previous versions, there has always been a way to invalidate all physical cache files. Any cached object older than the value of LASTREFRESHDTTM on the table PSSTATUS (it was on a different table prior to PeopleTools 8) is purged from the cache when the process that references that cache starts. Therefore, if that value is updated to the current time, the entire cache will be purged.
UPDATE PSSTATUS
SET LASTREFRESHDTTM = SYSDATE
/
COMMIT
/
Sometimes, developers also have to clear the physical cache on their clients used by Application Designer. Updating PSSTATUS also clears two-tier client caches. In fact, this behaviour is left over from the days when PeopleTools was a two-tier application, and it was necessary to clear cache files on users' desktop computers.
- If you have multiple Application Servers on a single database, then you can shut each one down in turn without any loss of server. The users will fail over to the surviving servers. However, this can result in the load being unevenly distributed and could overload one server.
- In small environments, and this includes most development and test systems, there is only a single application server. Shutting down an application server requires downtime and can be disruptive.
Remember, that users will experience a reduction in performance after clearing the cache because it needs to be rebuilt by querying the PeopleTools table.
The Process Scheduler, Master Process Scheduler, Distribution Server, and Application Engine processes also have physical caches. These are also cleared when LASTREFRESHDTTM is updated and the processes restarted. However, you should not shut down the Process Scheduler while processes are executing. The server process will shutdown and the Application Engine will be killed if using an Application Engine server process (PSAESRV). Any stand-alone processes, including psae, will be killed by the Process Scheduler when it is restarted.
DBA Blog |
Transferring files from ftp path to any folder
Recently got a small enhancement requirement for attaching a word file into a mail send to the recruiter, which is stored in a FTP path. First I tired the ViewAttachment() function to access the file.
Tried to catch the file URL which got generated to send in the mail. As the URL generated was dynamic, it was not possible.
The second try was to take the file from the ftp path and put it into a folder in the appserver and attaching to the mail send to the recruiter. And the idea worked fine.
- How to get the file from ftp and transfer it to the desired folder?
This can be accomplished using the GetAttachment() function, which will take the file from the FTP path specified and will transfer to the folder specified.
Below is the sample code for the functionality.
/*********To transfer the file, File_invitaton.doc, from ftp://anonymous:passowrd@222.12.13.52/docfolder to \\222.12.13.54\TF9DEV_temp\ File_invitaton.doc which is an appserver path******/
&nbr_RetCode = GetAttachment("ftp://anonymous:passowrd@222.12.13.52/docfolder", "File_invitaton.doc", "\\222.12.13.54\TF9DEV_temp\ File_invitaton.doc ");
Local string &MAIL_CC, &MAIL_TO, &MAIL_BCC, &MAIL_SUBJECT, &MAIL_TITLES, &MAIL_TEXT, &MAIL_FILES, &MAIL_FROM, &REPLYTO, &SENDER;
Local number &MAIL_FLAGS;
&MAIL_FLAGS = 0;
&MAIL_TO = "ps@ps.com";
&MAIL_CC = "";
&MAIL_BCC = "";
&MAIL_SUBJECT = "ps@gmail.com";
&MAIL_TEXT = "Sending an email from PeopleCode.";
/*********for attaching the file in the mail***************************/
&MAIL_FILES = "\\222.12.13.54\TF9DEV_temp\ File_invitaton.doc ";
&MAIL_TITLES = "Requested File";
&MAIL_FROM = "test@test.com";
&MAIL_SEP = ";";
&CONTTYPE = "";
&REPLYTO = "";
&SENDER = "";
&RET = SendMail(&MAIL_FLAGS, &MAIL_TO, &MAIL_CC, &MAIL_BCC, &MAIL_SUBJECT, &MAIL_TEXT, &MAIL_FILES, &MAIL_TITLES, &MAIL_FROM, &MAIL_SEP, &CONTTYPE, &REPLYTO, &SENDER);
/*********Successfully Sent the mail J***************************/
/*********We can do the reverse functionality using the PutAttachment() function***************************/
/*********Make sure that you have the right to access the FTP path and the file exists J***********************/
Create iCalender using PeopleCode
Its all about creating and iCalender which is compatible with Outlook. You can send mail to whomever it is concerned with the .ics file as an attachment. The person can open the .ics file and save to the outlook calendar. That's called collaborative flexibility
Below are the core objects for creating an ics file:
Here is a simple example of an iCalendar object, "Bastille Day Party" event which occurs July 14, 1997 17:00 (UTC) through July 15, 1997 03:59:59 (UTC):
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
BEGIN:VEVENT
DTSTART:19970714T170000Z
DTEND:19970715T035959Z
SUMMARY:Bastille Day Party
END:VEVENT
END:VCALENDAR
To-do (VTODO)
VTODO explains a to-do item, i.e., an action-item or assignment.
The following is an example of a to-do due on April 15, 1998
An audio alarm has been specified to remind the calendar user at noon, the day before the to-do is expected to be completed and repeat hourly, four additional times. This to-do has been modified twice since it was initially created.
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//ABC Corporation//NONSGML My Product//EN
BEGIN:VTODO
DTSTAMP:19980130T134500Z
SEQUENCE:2
UID:uid4@host1.com
ORGANIZER:MAILTO:unclesam@us.gov
ATTENDEE;PARTSTAT=ACCEPTED:MAILTO:jqpublic@example.com
DUE:19980415T235959
STATUS:NEEDS-ACTION
SUMMARY:Submit Income Taxes
BEGIN:VALARM
ACTION:AUDIO
TRIGGER:19980403T120000
ATTACH;FMTTYPE=audio/basic:http://example.com/pub/audio-
files/ssbanner.aud
REPEAT:4
DURATION:PT1H
END:VALARM
END:VTODO
END:VCALENDAR
Journal entry (VJOURNAL)
VJOURNAL is a journal entry. They attach descriptive text to a particular calendar date, may be used to record a daily record of activities or accomplishments, or describe progress with a related to-do entry. A "VJOURNAL" calendar component does not take up time on a calendar, so it has no effect on free or busy time (just like TRANSPARENT entries). In practice, few programs support VJOURNAL entries, although examples exist: Plum Canary's Chirp software uses VTODO and VJOURNAL together.
The following is an example of a journal entry:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//ABC Corporation//NONSGML My Product//EN
BEGIN:VJOURNAL
DTSTAMP:19970324T120000Z
UID:uid5@host1.com
ORGANIZER:MAILTO:jsmith@example.com
STATUS:DRAFT
CLASS:PUBLIC
CATEGORY:Project Report, XYZ, Weekly Meeting
DESCRIPTION:Project xyz Review Meeting Minutes\n
Agenda\n1. Review of project version 1.0 requirements.\n2.
Definition
of project processes.\n3. Review of project schedule.\n
Participants: John Smith, Jane Doe, Jim Dandy\n-It was
decided that the requirements need to be signed off by
product marketing.\n-Project processes were accepted.\n
-Project schedule needs to account for scheduled holidays
and employee vacation time. Check with HR for specific
dates.\n-New schedule will be distributed by Friday.\n-
Next weeks meeting is cancelled. No meeting until 3/23.
END:VJOURNAL
END:VCALENDAR
Free/busy time (VFREEBUSY)
VFREEBUSY is a request for free/busy time, is a response to a request, or is a published set of busy time
The following is an example of published busy time information.:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//RDU Software//NONSGML HandCal//EN
BEGIN:VFREEBUSY
ORGANIZER:MAILTO:jsmith@example.com
DTSTART:19980313T141711Z
DTEND:19980410T141711Z
FREEBUSY:19980314T233000Z/19980315T003000Z
FREEBUSY:19980316T153000Z/19980316T163000Z
FREEBUSY:19980318T030000Z/19980318T040000Z
URL:http://www.host.com/calendar/busytime/jsmith.ifb
END:VFREEBUSY
END:VCALENDAR
vCalendar 1.0
iCalendar's design was based on the previous file format vCalendar created by the Internet Mail Consortium (IMC).
Here is an example of information in vCalendar format:
BEGIN:VCALENDAR
VERSION:1.0
BEGIN:VEVENT
CATEGORIES:MEETING
STATUS:TENTATIVE
DTSTART:19960401T033000Z
DTEND:19960401T043000Z
SUMMARY:Your Proposal Review
DESCRIPTION:Steve and John to review newest proposal material
CLASS:PRIVATE
END:VEVENT
END:VCALENDAR
Sample PeopleCode for creating the ics file:
&descr = Substitute(&descr, Char(10), " ");
&descr = Substitute(&descr, Char(13), "");
/*build calendar file*/
Local string &strFileName;
&strFileName = %This.Validate_FileName(&ActivityCode);
&attachUserFile = &strFileName | "*.ics";
&fCal = GetFile(&attachUserFile, "N", %FilePath_Relative);
&attachSysFileName = &fCal.Name;
If &fCal.IsOpen Then
&fCal.WriteLine("BEGIN:VCALENDAR");
&fCal.WriteLine("PRODID:-//Microsoft Corporation//Outlook 10.0 MIMEDIR//" | &str_lLanguageCode);
&fCal.WriteLine("VERSION:2.0");
&fCal.WriteLine("METHOD:PUBLISH");
&fCal.WriteLine("BEGIN:VEVENT");
&fCal.WriteLine("DTSTART:" | &strStartDT);
&fCal.WriteLine("DTEND:" | &strEndDT);
&fCal.WriteLine("LOCATION;ENCODING=QUOTED-PRINTABL E:" | &location);
&fCal.WriteLine("TRANSP:OPAQUE");
rem &fCal.WriteLine("SEQUENCE:0");
&fCal.WriteLine("UID:" | &UID);
&fCal.WriteLine("DTSTAMP:" | &strCurrDT);
/* this the code is which prints the description containing URL*/
&fCal.WriteLine("DESCRIPTION;ENCODING=QUOTED-PRINT ABLE:" | &descr);
&fCal.WriteLine("SUMMARY;ENCODING=QUOTED-PRINTABLE :" | &summary);
&fCal.WriteLine("PRIORITY:5");
rem &fCal.WriteLine("X-MICROSOFT-CDO-IMPORTANCE:1");
&fCal.WriteLine("CLASS:PUBLIC");
&fCal.WriteLine("END:VEVENT");
&fCal.WriteLine("END:VCALENDAR");
&fCal.Close();
End-If;
Using transfer function
I got the following error message while working with the following transfer function ,
Transfer( True, MenuName.ADMINISTER_WORKFORCE_(GBL), BarName.USE2,ItemName.RRD_ADMIN_PLEDGE_CARD, Page.SEARCH, "U")
Error: There is no conversion from MENUNAME to a PeopleCode object. (2,56)
Solution:
Transfer( True, MenuName.ADMINISTER_WORKFORCE_(GBL) , BarName.USE2,ItemName.RRD_ADMIN_PLEDGE_CARD, Page.SEARCH, "U") is generally a transfer menthod but since the menu name has two brackets enclosed at the end it doesn't pick the menu name giving the error "There is no conversion from MENUNAME to a PeopleCode object. (2,56)"...
Try this:
Transfer( True, MenuName."ADMINISTER_WORKFORCE_(GBL)", BarName.USE2,
ItemName.RRD_ADMIN_PLEDGE_CARD, Page.SEARCH, "U"). I have enclosed the menuname in a closed bracket making sure that peoplecode recognizes this as a single unit
For passing parameters to the transfer function:
Transfer( True, @("MENUNAME." | &PSSTEPDEFN.MENUNAME.Value), @("BARNAME." | &PSSTEPDEFN.BARNAME.Value), @("ITEMNAME." | &PSSTEPDEFN.ITEMNAME.Value),
@("PAGE." | &PSSTEPDEFN.PAGEITEMNAME.Value), &ACTION, &MYREC);
Monday, September 28, 2009
How to Hide the Menu Bar and Header in a PeopleSoft Page
First, you need to create a derived record with the HTMLAREA field. Then in the Row init of this field you need to copy the following code.
Global integer &transfer;
Local integer &tr;
&tr = &transfer;
rem Error "" | &transfer;
If &tr = 1 Then;
#RECORDNAME#.HTMLAREA.Value = "<script type='text/javascript'>if
(parent.frames['NAV']){parent.parent.location=parent.TargetContent.location;}</script>";
&transfer = 0;
End-If;
The you need to place an html are in the target page, linked to the HTMLAREA field in the record previously created. Finally, you need to add the following code in the source page (the page with the button/link that makes the transfer to the target page) just before the Transfer function:
Global integer &transfer;
&transfer=1;
And thats it!
Thursday, September 24, 2009
Commencement address by Steve Jobs at Stanford University,2005
This is the text of the Commencement address by Steve Jobs, CEO of Apple Computer and of Pixar Animation Studios, delivered on June 12, 2005.
I am honored to be with you today at your commencement from one of the finest universities in the world. I never graduated from college. Truth be told, this is the closest I've ever gotten to a college graduation. Today I want to tell you three stories from my life. That's it. No big deal. Just three stories.
The first story is about connecting the dots.
I dropped out of
It started before I was born. My biological mother was a young, unwed college graduate student, and she decided to put me up for adoption. She felt very strongly that I should be adopted by college graduates, so everything was all set for me to be adopted at birth by a lawyer and his wife. Except that when I popped out they decided at the last minute that they really wanted a girl. So my parents, who were on a waiting list, got a call in the middle of the night asking: "We have an unexpected baby boy; do you want him?" They said: "Of course." My biological mother later found out that my mother had never graduated from college and that my father had never graduated from high school. She refused to sign the final adoption papers. She only relented a few months later when my parents promised that I would someday go to college.
And 17 years later I did go to college. But I naively chose a college that was almost as expensive as Stanford, and all of my working-class parents' savings were being spent on my college tuition. After six months, I couldn't see the value in it. I had no idea what I wanted to do with my life and no idea how college was going to help me figure it out. And here I was spending all of the money my parents had saved their entire life. So I decided to drop out and trust that it would all work out OK. It was pretty scary at the time, but looking back it was one of the best decisions I ever made. The minute I dropped out I could stop taking the required classes that didn't interest me, and begin dropping in on the ones that looked interesting.
It wasn't all romantic. I didn't have a dorm room, so I slept on the floor in friends' rooms, I returned coke bottles for the 5¢ deposits to buy food with, and I would walk the 7 miles across town every Sunday night to get one good meal a week at the Hare Krishna temple. I loved it. And much of what I stumbled into by following my curiosity and intuition turned out to be priceless later on. Let me give you one example:
None of this had even a hope of any practical application in my life. But ten years later, when we were designing the first Macintosh computer, it all came back to me. And we designed it all into the Mac. It was the first computer with beautiful typography. If I had never dropped in on that single course in college, the Mac would have never had multiple typefaces or proportionally spaced fonts. And since Windows just copied the Mac, its likely that no personal computer would have them. If I had never dropped out, I would have never dropped in on this calligraphy class, and personal computers might not have the wonderful typography that they do. Of course it was impossible to connect the dots looking forward when I was in college. But it was very, very clear looking backwards ten years later.
Again, you can't connect the dots looking forward; you can only connect them looking backwards. So you have to trust that the dots will somehow connect in your future. You have to trust in something — your gut, destiny, life, karma, whatever. This approach has never let me down, and it has made all the difference in my life.
My second story is about love and loss.
I was lucky — I found what I loved to do early in life. Woz and I started Apple in my parents garage when I was 20. We worked hard, and in 10 years Apple had grown from just the two of us in a garage into a $2 billion company with over 4000 employees. We had just released our finest creation — the Macintosh — a year earlier, and I had just turned 30. And then I got fired. How can you get fired from a company you started? Well, as Apple grew we hired someone who I thought was very talented to run the company with me, and for the first year or so things went well. But then our visions of the future began to diverge and eventually we had a falling out. When we did, our Board of Directors sided with him. So at 30 I was out. And very publicly out. What had been the focus of my entire adult life was gone, and it was devastating.
I really didn't know what to do for a few months. I felt that I had let the previous generation of entrepreneurs down - that I had dropped the baton as it was being passed to me. I met with David Packard and Bob Noyce and tried to apologize for screwing up so badly. I was a very public failure, and I even thought about running away from the valley. But something slowly began to dawn on me — I still loved what I did. The turn of events at Apple had not changed that one bit. I had been rejected, but I was still in love. And so I decided to start over.
I didn't see it then, but it turned out that getting fired from Apple was the best thing that could have ever happened to me. The heaviness of being successful was replaced by the lightness of being a beginner again, less sure about everything. It freed me to enter one of the most creative periods of my life.
During the next five years, I started a company named NeXT, another company named Pixar, and fell in love with an amazing woman who would become my wife. Pixar went on to create the worlds first computer animated feature film, Toy Story, and is now the most successful animation studio in the world. In a remarkable turn of events, Apple bought NeXT, I returned to Apple, and the technology we developed at NeXT is at the heart of Apple's current renaissance. And Laurene and I have a wonderful family together.
I'm pretty sure none of this would have happened if I hadn't been fired from Apple. It was awful tasting medicine, but I guess the patient needed it. Sometimes life hits you in the head with a brick. Don't lose faith. I'm convinced that the only thing that kept me going was that I loved what I did. You've got to find what you love. And that is as true for your work as it is for your lovers. Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do. If you haven't found it yet, keep looking. Don't settle. As with all matters of the heart, you'll know when you find it. And, like any great relationship, it just gets better and better as the years roll on. So keep looking until you find it. Don't settle.
My third story is about death.
When I was 17, I read a quote that went something like: "If you live each day as if it was your last, someday you'll most certainly be right." It made an impression on me, and since then, for the past 33 years, I have looked in the mirror every morning and asked myself: "If today were the last day of my life, would I want to do what I am about to do today?" And whenever the answer has been "No" for too many days in a row, I know I need to change something.
Remembering that I'll be dead soon is the most important tool I've ever encountered to help me make the big choices in life. Because almost everything — all external expectations, all pride, all fear of embarrassment or failure - these things just fall away in the face of death, leaving only what is truly important. Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose. You are already naked. There is no reason not to follow your heart.
About a year ago I was diagnosed with cancer. I had a scan at 7:30 in the morning, and it clearly showed a tumor on my pancreas. I didn't even know what a pancreas was. The doctors told me this was almost certainly a type of cancer that is incurable, and that I should expect to live no longer than three to six months. My doctor advised me to go home and get my affairs in order, which is doctor's code for prepare to die. It means to try to tell your kids everything you thought you'd have the next 10 years to tell them in just a few months. It means to make sure everything is buttoned up so that it will be as easy as possible for your family. It means to say your goodbyes.
I lived with that diagnosis all day. Later that evening I had a biopsy, where they stuck an endoscope down my throat, through my stomach and into my intestines, put a needle into my pancreas and got a few cells from the tumor. I was sedated, but my wife, who was there, told me that when they viewed the cells under a microscope the doctors started crying because it turned out to be a very rare form of pancreatic cancer that is curable with surgery. I had the surgery and I'm fine now.
This was the closest I've been to facing death, and I hope its the closest I get for a few more decades. Having lived through it, I can now say this to you with a bit more certainty than when death was a useful but purely intellectual concept:
No one wants to die. Even people who want to go to heaven don't want to die to get there. And yet death is the destination we all share. No one has ever escaped it. And that is as it should be, because Death is very likely the single best invention of Life. It is Life's change agent. It clears out the old to make way for the new. Right now the new is you, but someday not too long from now, you will gradually become the old and be cleared away. Sorry to be so dramatic, but it is quite true.
Your time is limited, so don't waste it living someone else's life. Don't be trapped by dogma — which is living with the results of other people's thinking. Don't let the noise of others' opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary.
When I was young, there was an amazing publication called The Whole Earth Catalog, which was one of the bibles of my generation. It was created by a fellow named Stewart Brand not far from here in
Stewart and his team put out several issues of The Whole Earth Catalog, and then when it had run its course, they put out a final issue. It was the mid-1970s, and I was your age. On the back cover of their final issue was a photograph of an early morning country road, the kind you might find yourself hitchhiking on if you were so adventurous. Beneath it were the words: "Stay Hungry. Stay Foolish." It was their farewell message as they signed off. Stay Hungry. Stay Foolish. And I have always wished that for myself. And now, as you graduate to begin anew, I wish that for you.
Stay Hungry. Stay Foolish.
Thank you all very much.
Wednesday, September 23, 2009
Send User to a Portal Folder
Sometimes you would want to give users the option to click a button on the page and send them back to the Portal Folder they came from, or may be couple folders back! Here is how you go about doing that.
You can actually use the PeopleSoft delivered function NavPageURL to accomplish this! So, lets get started!
On your page, go ahead and add a button. Place the following PeopleCode at the Component Record Field level under FieldChange event.
Declare Function NavPageURL PeopleCode EOPP_SCRTN_WRK.FUNCLIB FieldFormula;
&LINKURL = NavPageURL(%Portal, %Node, "your-folder-object-name", "PSC", "", "", "False", "", "", "");
%Response.RedirectURL(&LINKURL);
And here is the code for the NavPageURL function:
/********************************************************************/
/* Function: NavPageURL */
/* Purpose: Returns the Absolute URL value to the Navigation Page */
/* for a given collecton object name or folder object. */
/* Inputs: Nav Page PortalName, Nav Page NodeName, Nav Page */
/* Collection or Folder ObjectName, and URLType. */
/* Output: URL value as a string */
/* Format: &MYURL = NavPageURL("EMPLOYEE", "ERP", "MY_OBJECT", */
/* "", "", "", "", "") */
/********************************************************************/
Function NavPageURL(&PortalName As string, &NodeName As string, &ObjName As string, &URLType As string, &FolderName As string, &TargPortalName As string, &SecValue As string, &VirtualValue As string, &PTfname As string, &PTcname As string) Returns string;
Local string &URL;
If All(&PortalName, &NodeName, &ObjName) Then
Evaluate Upper(&URLType)
When =
"PSC"
&URL = GenerateScriptContentURL(&PortalName, &NodeName, Record.WEBLIB_EOPP_SC, Field.HOMEPAGE, "FieldFormula", "IScript_AppHP");
Break;
When =
"PSP"
&URL = GenerateScriptPortalURL(&PortalName, &NodeName, Record.WEBLIB_EOPP_SC, Field.HOMEPAGE, "FieldFormula", "IScript_AppHP");
Break;
When-Other
&URL = GenerateScriptContentURL(&PortalName, &NodeName, Record.WEBLIB_EOPP_SC, Field.HOMEPAGE, "FieldFormula", "IScript_AppHP");
End-Evaluate;
&URL =
&URL |
"?scname="
|
&ObjName;
If All(&SecValue) Then
&URL =
&URL |
"&secondary="
|
&SecValue;
End-If;
If All(&FolderName) Then
&URL =
&URL |
"&fname="
|
&FolderName;
End-If;
If All(&PTcname) Then
/* pass either CFAN Cref or DFAN Fref, not both */
&URL =
&URL |
"&PORTALPARAM_PTCNAV="
|
&PTcname;
Else
If All(&PTfname) Then
&URL =
&URL |
"&pt_fname="
|
&PTfname;
End-If;
End-If;
If All(&TargPortalName) Then
&URL =
&URL |
"&targetportal="
|
&TargPortalName;
End-If;
If Upper(&VirtualValue)
=
"TRUE" Then
&URL =
&URL |
"&isvirtual="
|
&VirtualValue;
End-If;
End-If;
Return
&URL;
End-Function;
CTY:Compshack |
Extract Project Objects Using an SQL
The query below will return all the objects inside of an Application Designer project. You can then copy the rows and paste them where ever you'd like.
SELECT
(CASE OBJECTTYPE WHEN 0 THEN 'Record'
WHEN 1 THEN 'Index'
WHEN 2 THEN 'Field'
WHEN 3 THEN 'Field Format'
WHEN 4 THEN 'Translate Value'
WHEN 5 THEN 'Pages'
WHEN 6 THEN 'Menus'
WHEN 7 THEN 'Components'
WHEN 8 THEN 'Record PeopleCode'
WHEN 9 THEN 'Menu PeopleCode'
WHEN 10 THEN 'Query'
WHEN 11 THEN 'Tree Structures'
WHEN 12 THEN 'Trees'
WHEN 13 THEN 'Access group'
WHEN 14 THEN 'Color'
WHEN 15 THEN 'Style'
WHEN 16 THEN 'N/A'
WHEN 17 THEN 'Business process'
WHEN 18 THEN 'Activity'
WHEN 19 THEN 'Role'
WHEN 20 THEN 'Process Definition'
WHEN 21 THEN 'Server Definition'
WHEN 22 THEN 'Process Type Definition'
WHEN 23 THEN 'Job Definitions'
WHEN 24 THEN 'Recurrence Definition'
WHEN 25 THEN 'Message Catalog'
WHEN 26 THEN 'Dimension'
WHEN 27 THEN 'Cube Definitions'
WHEN 28 THEN 'Cube Instance Definitions'
WHEN 29 THEN 'Business Interlink'
WHEN 30 THEN 'SQL'
WHEN 31 THEN 'File Layout Definition'
WHEN 32 THEN 'Component Interfaces'
WHEN 33 THEN 'AE program'
WHEN 34 THEN 'AE section'
WHEN 35 THEN 'Message Node'
WHEN 36 THEN 'Message Channel'
WHEN 37 THEN 'Message'
WHEN 38 THEN 'Approval rule set'
WHEN 39 THEN 'Message PeopleCode'
WHEN 40 THEN 'Subscription PeopleCode'
WHEN 41 THEN 'N/A'
WHEN 42 THEN 'Component Interface PeopleCode'
WHEN 43 THEN 'AE PeopleCode'
WHEN 44 THEN 'Page PeopleCode'
WHEN 45 THEN 'Page Field PeopleCode'
WHEN 46 THEN 'Component PeopleCode'
WHEN 47 THEN 'Component Record PeopleCode'
WHEN 48 THEN 'Component Rec Fld PeopleCode'
WHEN 49 THEN 'Image'
WHEN 50 THEN 'Style sheet'
WHEN 51 THEN 'HTML'
WHEN 52 THEN 'Not used'
WHEN 53 THEN 'Permission List'
WHEN 54 THEN 'Portal Registry Definitions'
WHEN 55 THEN 'Portal Registry Structures'
WHEN 56 THEN 'URL Definitions'
WHEN 57 THEN 'Application Packages'
WHEN 58 THEN 'Application Package Peoplecode'
WHEN 59 THEN 'Portal Registry User Homepage'
WHEN 60 THEN 'Problem Type'
WHEN 61 THEN 'Archive Templates'
WHEN 62 THEN 'XSLT'
WHEN 63 THEN 'Portal Registry User Favorite'
WHEN 64 THEN 'Mobile Page'
WHEN 65 THEN 'Relationships'
WHEN 66 THEN 'Component Interface Property Peoplecode'
WHEN 67 THEN 'Optimization Models'
WHEN 68 THEN 'File References'
WHEN 69 THEN 'File Type Codes'
WHEN 70 THEN 'Archive Object Definitions'
WHEN 71 THEN 'Archive Templates (Type 2)'
WHEN 72 THEN 'Diagnostic Plug In'
WHEN 73 THEN 'Analytic Model'
ELSE 'UNKNOWN OBJECT TYPE' END)
AS OBJECTTYPE
, OBJECTVALUE1
, OBJECTVALUE2
, OBJECTVALUE3
, OBJECTVALUE4
FROM PSPROJECTITEM
WHERE PROJECTNAME =
'Your_Project'
--- Replace w/ your project name
ORDER
BY OBJECTTYPE, OBJECTVALUE1, OBJECTVALUE2, OBJECTVALUE3;
If you would like to extract objects that are only marked for migration then add the following into the "Where" clause:
AND TAKEACTION =
'1'
-- 1 means checked for upgrade
-- 0 means do not upgrade
Monday, September 21, 2009
Using Array in PeopleSoft
Local array of array of string &BOTH;
Local File &MYFILE;
Local string &HOLDER;
/* Create empty &BOTH array */
&BOTH = CreateArrayRept(CreateArrayRept("", 0), 0);
/* Read first file into first column */
&MYFILE = GetFile("names.txt", "R");
While &MYFILE.ReadLine(&HOLDER);
&BOTH.Push(&HOLDER);
End-While;
/* read second file into second column */
&MYFILE = GetFile("numbers.txt", "R");
&LINENO = 1;
While &MYFILE.ReadLine(&HOLDER);
If &LINENO > &BOTH.Len Then
/* more number lines than names, use a null name */
&BOTH.Push(CreateArray("", &HOLDER));
Else
&BOTH[&LINENO].Push(&HOLDER);
End-If;
&LINENO = &LINENO + 1;
End-While;
/* if more names than numbers, add null numbers */
for &LINENO = &LINENO to &BOTH.Len
&BOTH[&LINENO].Push("");
End-For;
Local File &MYFILE1, &MYFILE2;
Local string &STRING1, &STRING2;
Local array of array of string &BOTH;
/* code to load data into array would be here */
/* open files to be written to */
&MYFILE1 = GetFile("names.txt", "A");
&MYFILE2 = GetFile("numbers.txt", "A");
/* loop through array and write to files */
For &I = 1 To &BOTH.Len
&J = 1;
&STRING1 = &BOTH[&I][&J];
&MYFILE1.writeline(&STRING1);
&J = &J + 1;
&STRING2 = &BOTH[&I][&J];
&MYFILE2.writeline(&STRING2);
End-For;
&MYFILE1.Close();
&MYFILE2.Close();
The following example populates a multi-dimensional string array using SQL. This could be used for reading small tables. Component array of array of string &ArrRunStatus;
&ArrRunStatus = CreateArrayRept(CreateArrayRept("", 0), 0);
&ArrRunStatusDescr = CreateArrayRept("", 0);
&SQL = CreateSQL("SELECT FIELDVALUE, XLATSHORTNAME FROM XLATTABLE WHERE FIELDNAME = 'RUNSTATUS'");
&LineNo = 1;
While &SQL.Fetch(&FieldValue, &XlatShortName)
&ArrRunStatus.Push(&FieldValue);
&ArrRunStatus[&LineNo].Push(&XlatShortName);
&LineNo = &LineNo + 1;
End-While;
To search for a particular element in this array, use the following:
&iIndex = &ArrRunStatus.Find(&RunStatusToGet);
&RunStatusDescr = &ArrRunStatus[&iIndex][2];
The following example shows how to create a two-dimension array using CreateArrayRept and Push. In addition, it shows how to randomly assigns values to the cells in a two-dimension array.
Local array of array of string &ValueArray;
&Dim1 = 10;
&Dim2 = 5;
&ValueArray = CreateArrayRept(CreateArrayRept("", 0), 0);
For &I = 1 To &Dim1
&ValueArray.Push(CreateArrayRept("", &Dim2));
End-For;
&ValueArray[1][1] = "V11";
&ValueArray[2][1] = "V21";
WinMessage("&ValueArray[1][1] = " &ValueArray[1][1] " " "&ValueArray[2][1] = " &ValueArray[2][1], 0);
Integration Broker Web Service Discovery Class
Use the Web Service Discovery class to:
- Find web services currently offered by the Integration Broker.
- Retrieve the web services description language (WSDL) for a given web service.
The methods in this class are intended to be used in pairs. First, use one of the "Find" methods to get the list of web services, then use one of the "Get" methods to retrieve the WSDL for the given service.
The PeopleSoft Integration Broker Web Service Discovery objects are declared as type
WebServiceDiscovery. For example,
Local WebServiceDiscovery &theDiscovery;
&theDiscovery = create WebServiceDiscovery();
A Web Service Discovery object can be instantiated from PeopleCode, from a Visual Basic program, from Java, COM and C/C++. This object can be used anywhere you have PeopleCode, that is, in an application class, Application Engine PeopleCode, record field PeopleCode, and so on.
The Integration Broker Web Service Discovery class is not a built-in class, like rowset, field, record, and so on. It is an application class. Before you can use this class in your PeopleCode program, you must import it to your program.
An import statement names either all the classes in a package or one particular application class. For importing the Integration Broker Web Service Discovery class, PeopleSoft recommends that you import all the classes in the application package, although you won't be using most of the classes in these application packages.
The import statements you should use are as follows:
import WEBSERVICES:*;
Integration Broker Web Service Discovery Class Constructor
import SOAPTOCI:*;
import WEBSERVICES:*;
Local WebServiceDiscovery &theDiscovery;
&theDiscovery = create WebServiceDiscovery();
Integration Broker Web Service Discovery Class Methods
- FindCIWebServices(CI_Name, Request_Node_Name, Descr)
Use the FindCIWebServices method, to get only the web services based on component interfaces available in the system Use GetCIWebServiceWSDL to get the WSDL for each web service found by this method. If you specify blank strings for all three parameters, the method tries to return all component interface based web services.
- FindMsgWebServices(Msg_Name, Node_Name)
Use the FindMsgWebServices method, to get only the message-based web services available on the system. Use the GetMsgWebServiceWSDL method to get the WSDL for each web service returned by this method.
- FindWebServices()
Use the FindWebServices methodto get all web services, both component interface and message. Use the method GetWSDL to get the WSDL for each web service returned by this method.
- GetCIWebServiceWSDL(Service_Descr)
Use the GetCIWebServiceWSDL method, in conjunction with the FindCIWebServices method, to get the WSDL for a given web service.
- GetMsgWebServiceWSDL(Service_Descr)
Use the GetMsgWebServiceWSDL method, in conjunction with the FindMsgWebServices method, to get the WSDL for a given message based web service
- GetWSDL(Service_Descr)
Use the GetWSDL method, in conjunction with the FindWebServices method, to get the WSDL for a given web service.
Friday, September 18, 2009
Process Schedule WalkThrough
PeopleSoft Process Scheduler (PSPRCSRV) is a centralized tool that enables application developers, system administrators, and application users to manage PeopleSoft batch processes. Using PeopleSoft Pure Internet Architecture, you can access a list of processes through a web browser and queue and run a process request. Process requests using PeopleSoft Pure Internet Architecture have the added functionality of new distribution options that enable you to distribute output through the web in different formats (HTML, PDF, Excel, and so on) to other users based on their user or role ID
The primary role of Process Scheduler is to support the PeopleSoft application environment. With a PeopleSoft application, you might want to perform certain processes (such as running programs, batch programs, reports, and so on) in the background of the online system. Running reports, posting journal entries, loading benefit enrollment forms, and calculating payroll deductions are all examples of processes that you might want to perform independently of the PeopleSoft application.
Using PeopleSoft Process Scheduler can streamline your business practices by enabling you to take advantage of the distributed computing environment at your site, whereby you can schedule performance-sensitive jobs to run on a powerful server while the online system is still available to end users.
The application server runs the appropriate SQL against the database to add a row to the Process Request table (PSPRCSRQST) for the submitted process request. Process Monitor also uses SQL to fetch the process status from the Process Request table.
PeopleSoft Process Scheduler Server Agent
The PeopleSoft Process Scheduler Server Agent is the component that resides on a server and runs as a process; that is, after it is initiated, it runs continuously in the background and requires no user interaction until it receives a request to shut down. Although the PeopleSoft Process Scheduler Server can run on the application server machine, it can also run on any supported batch server or database server
The database server houses the Process Request tables that contain a variety of data that are related to the requests, such as command line parameters, output options, and process status.
For the Distribution Agent to pass authentication, you must ensure that the following rules are enforced:
- The User ID that you use to start the Process Scheduler server must include the
ProcessSchedulerAdmin role.
Report distribution in the PeopleSoft system is closely associated with PeopleSoft Process Scheduler. Process Scheduler uses the PeopleSoft Process Scheduler Server Agent to run the reports and log files that you submit using a process request. When they have finished, the Distribution Agent transfers these reports and log files to the Report Repository where you can view them from a web browser using PeopleSoft Pure Internet Architecture. You can transfer the following files to the Report Repository:
- Reports
- Logs
- Trace files
Run Control ID's
To run a report, you must tell the system when and where you want the report to run. For example, you might tell the system to run the report on the database server at midnight or on a Microsoft Windows server every Sunday afternoon, or you might tell it to run the report immediately. For most reports, you must also set parameters that determine the content of the report, such as the business unit or time period on which to report.
A run control is a database record that provides values for these settings. Instead of entering the same values each time you run a report, you create and save a run control with those settings. The next time that you run the report, you select the run control, and the system completes the settings.
You can create run controls that apply to several related reports. For example, suppose that all of the reports that you run at the end of a month require the same parameters: business unit, department, and from and to dates. You can create a single run control that provides values for these parameters and use it for every report.
A run control ID is used as a key (with a user ID) for records that contain the parameters that a process needs at runtime. Storing the parameters in a table that the process can query using the run control ID and user ID enables the process to run without user intervention. Run control IDs are stored in a minimum of two tables: an application run control table and the Tools Run Control table (PSPRCSRQST). You can examine the PS_PRCSRUNCNTL table as a sample application run control table.
The PeopleTools Run Control table stores information that is required by PeopleSoft Process Scheduler, such as output type, format, distribution, file dependency, and destination. The application run control table stores information that is required to run a process, such as the from date, department ID, employee ID, and so on. All application run control tables are keyed by user ID and run control ID.
Process Scheduler configuration file (psprcs.cfg)
When Process Scheduler submits a request, the system creates a new subdirectory to store the log, trace, and reports that were generated by the request. This subdirectory is created in the directory that is specified in the Log/Output Directory parameter in the Process Scheduler configuration file psprcs.cfg. When a high volume of requests is being processed by the Process Scheduler server, limitations imposed by the operating system can prevent additional directories from being generated for the new requests. For instance, certain UNIX flavors only allocate 32K Inodes for a directory.
Process Moniter
After you submit a job using the Process Scheduler Request page, use Process Monitor to review the status of scheduled or running processes. You can view all processes to see the status of any job in the queue and control processes that you initiated. Process Monitor consists of two pages: the Process List page and the Server List page.
Use the Process List page to monitor the process requests that you submit. If a process encounters an error, or if a server is down, you can find out almost immediately. You can also see what processes are queued to run in the future.
Use the Server List page to view information about each of the PeopleSoft Process Scheduler Server Agents that are defined in the system.
Report Manager
Any user who maintains the content of Report Manager must be assigned a Report Manager administrator role in PeopleSoft Security. With this administrator role, the user can:
- Change the distribution list by adding or deleting a user or role ID.
- Delete a report from Report Manager.
- Alter the report's expiration date.
A super user role is also available that allows you to delete and update all report output in Report Manager. Super users are allowed to delete the report entry and update the distribution list or expiration date of report entries.
The difference between the administrator (ReportDistAdmin) and super user (ReportSuperUser) roles is that the administrator role can access and update any report in the Report Manager. The super user role can update only reports that they are authorized to view.
Report Purge Process
When PeopleSoft Process Scheduler is set to perform a periodic purge on the System Purge tab in the system settings, it triggers the Application Engine program PRCSYSPURGE. This program purges both the Process Request and Report Manager tables. As part of the Report Manager cleanup, it also purges the reports from the Report Repository and archives the data into the Report Archive table.
If multiple Process Schedulers are running against the same database, and each has its own Report Repository, PRCSYSPURGE is initially responsible for the purge process. It will remove all entries from the PS_CDM_LIST table and then purge all reports that match its server name or report node from its report repository. The PRCSYSPURGE program then inserts entries to the PS_CDM_LIST_PURGE table where neither the server name nor the report node name matches. If the PRCSYSPURGE program detects that more than one Process Scheduler is active, it schedules the Application Engine PRCSRVCLN program to run on all the other active Process Scheduler servers. The PRCSRVCLN program checks whether the server uses its own Report Repository and if so, the program deletes reports from the report Repository that is used by the server.
Report Nodes
The report distribution node defines how your reports are moved to the Report Repository, where you can view them from Report Manager. Reports are moved using XCOPY, FTP, or HTTP and HTTPS, depending on the type of server that you are using.
Batch Timings
Batch Timings reports are provided so that you can monitor the performance of your application engine programs. The Process Scheduler - Batch Timings page applies to the Statement Timings data that is stored in the (table) option.
For the Batch Timings feature to record data, you must enable it using the Configuration Manager Trace tab. In the Application Engine group, select the Statement Timings (table) option.
Job and Jobsets
PeopleSoft Process Scheduler enables you to schedule one or more processes as a group. In this context, job describes this type of process group.
A process is a single task, program, or routine, such as a Structured Query Report (SQR) report or COBOL program that runs either on the client or on a server. A job consists of one or more processes of the same or different types that are submitted as a unit and can run either in series or parallel. They require the scheduling support that only a server environment can offer and all processes must be API-aware.
Scheduled JobSets enable you to schedule a recurring job using a schedule JobSet definition. Each process within a job can be altered to set up its own output destination options or set the operating system where the process is to be scheduled.
Using PSADMIN utility
Use the PSADMIN utility to configure and administer the PeopleSoft Process Scheduler Server Agent. PSADMIN is supported on only Windows 2000 and UNIX. However, in some cases, you can run the PSADMIN utility on operating systems that are not supported application servers.
Configuring a PeopleSoft Process Scheduler server is similar to configuring application servers and web servers. From the PeopleSoft Process Scheduler Administration menu, you invoke a text-driven interface that prompts you for parameter values. All of the PeopleSoft Process Scheduler server configuration information for a specific database is contained in the PSPRCS.CFG configuration file, and the PSADMIN provides an interface to edit this file.
PeopleSoft automatically archives the Process Scheduler configuration file whenever it is changed. The older version is archived as PSPRCS_<Time Stamp>.CFG, and the current version becomes psprcs.cfg. The archive directory path is <PS_Home>\Appserv\prcs\<database>\Archive\. (for example, c:\pt844\Appserv\prcs\fin844\Archive\).
Posting non-process scheduler reports to the report repository
The process of posting reports and files to the Report Repository is performed by the Distribution Agent server. When using PeopleSoft Process Scheduler, the transfer is triggered by the Process Scheduler server when it detects that a process request, such as SQR or Crystal, has generated a report and is ready to be posted.
Reports that were generated outside of the PeopleSoft Process Scheduler either by being run manually or by a third-party scheduler, can be posted to the Report Repository using the PostReport PeopleCode class object. The PostReport PeopleCode class updates the Report Manager with the information for the new report, including the list of users and roles authorized to view the report. The request is sent to the Distribution Agent that is identified by the ServerName of the process scheduler server specified in the request.
Using the PostReport PeopleCode class object implies that a PeopleCode function has been written using this class and is invoked either from an Application Engine or an Application Server.
Sending a single request through an Application Engine can incur a large overhead; therefore, PeopleSoft recommend running the program from PSDAEMON using the POSTRPT_DMN Application Engine program.
The POSTRPT_DMN program monitors for any requests to post by searching for new XML files in a designated directory. The XML file contains all the parameters required by the PostReport PeopleCode class object to post the request to the Report Repository. The program reads the parameters using the POST_REPORT_XML file layout