I have a record with several child records on a page. I have a button on the page that triggers a report through XML Publisher via rowset. The problem I am having is the rowset I am passing to the report contains everything in the buffer -- I want only the current context to show on the report. What I have right now:
&rs_resp = CreateRowset(Record.AVZ_JD_RESP_TBL);
&rs_expr = CreateRowset(Record.AVZ_JD_EXPR_TBL);
&rs_skls = CreateRowset(Record.AVZ_JD_SKLS_TBL);
&rs_dtl = CreateRowset(Record.AVZ_JD_DTL_TBL, &rs_resp, &rs_expr, &rs_skls
&RS0 = GetLevel0().GetRow(1).GetRowset(Scroll.AVZ_JD_DTL_TBL);
&RS0.CopyTo(&rs_dtl);
Then I kick off the report:
&oReportDefn.SetRuntimeDataRowset(&rs_dtl);
&oReportDefn.ProcessReport(&MyTemplate, &LanguageCd, &AsOfDate, &OutFormat);
I was previously using a Rowset.Fill on each of the rowsets (parent and child), but I the copyto method somehow seemed "cleaner" (certainly less code :-) ). Is there a way to copy the current context only?
Thanks
In reviewing my statistics, I found that one common search was “basics steps to create an appengine in PeopleSoft”. I hope the person(s) found what they were looking for on my blog. Nonetheless, that gave me the idea to write a simple overview on creating a new Application Engine program.
This post can’t cover everythinkg but I do plan to cover:
Application Engine programs are definitions that are created and edited within Application Designer. So, open Application Designer and log in. Next, either use the File > New menu, press Ctrl + N, or click on the “New” icon on the toolbar.
File > New / Ctrl + N:
New icon on the toolbar:
After you do that, you should get a New dialog. There is where you tell Application Designer what type of new object you want to create. From here, you will want to choose the “App Engine Program” object type.
This should give you a new Application Engine program window:
You probably want to save your program as you go. You can use File > Save or Ctrl + S or the Save icon on the toolbar. The first save will prompt you for a name for your new program:
The first thing you need to do is set your properties. If nothing else, you need to check the “Disable Restart” button. So, click on the properties button on the toolbar.
On the first tab of the properties, you should enter a general description of your program. In the comments area, you want to describe in more detail what your program does. You should also enter the date, author, and description of changes to the program throughout it’s lifetime.
Read on for more information about State Records later, but the State Records tab is where you connect the state record with your program.
This is the most important property to set. On the fourth tab, make sure to check the disable restart option. In my opinion, this should be default. I don’t have room to go into all of the reasons, but let’s just say that in order to make a program restartable, you need to make several design decisions first. If you want your program restartable, get it running first, check that your design is restartable, and then, come back here and uncheck the disable restart option.
The first that you need to understand is what the parts mean and how it runs each piece. So, here are the parts:
The most important thing to understand is that the program starts at the first step in the “MAIN” section. It runs to the last step of the MAIN section in sequence. At the last step, the program is done. The other sections do not run unless they are explicitly called with a “Call Section” action.
Don’t let the names of the steps confuse you. The name can be anything. The step sequence number (circled below) is what controls the order of the steps. If you’re not careful, the step names can confuse you. In the following example, step02 runs first before step01.
Also, you can’t control the order of the actions. You should have only one action per step unless you are doing looping. If you do insert two actions into the same step, you can hit the refresh button on the toolbar and it will rearrange the actions in the order in which they will execute.
These three buttons on the toolbar insert new sections, steps, and actions (respectively). You can also use the insert menu.
The part of the program you have selected is significant when inserting a new part. When inserting a section, you used to have to select the previous section. Also, the order of the sections does not matter, so once you hit the Refresh button it will alphabetize them by their name. (Remember sections run in the order they are called from MAIN.)
To insert a step, select the step before, and it will insert the new step after what you have selected. The program will never change the order of the steps. If you want to reorder them, you have to cut and paste them in the new location.
To insert an action, select the action or step before, and it will insert the new action afterward. Again, remember that you can’t control the order of the actions. After you insert the action, you will need to change the type in the drop down:
For most of the actions, you will want to double click on the grey area of the action and open the PeopleCode or SQL editor. This is what defines exactly what the action does.
Complex logic is best done inside of PeopleCode steps. Note that you can have an App Engine program with a single PeopleCode step/action. The PeopleCode can do all of the work for you.
That being said, you can do some logic flow with looping and such in the App Engine itself. This is accomplished with the following action types:
Next, the Do While loop will go until no rows are returned. It is similar to the Do Select except that it executes the SQL statement every iteration. The actions following it are executed when the SQL statement returns 1 or more rows. Also, note that the actions are executed once for each time the select statement is run no matter how many rows are returned.
Now, the Do When action is like an If statement. Basically, if the select statement returns a row, that’s true. If no rows result, it’s false. So, if the Do When select statement returns a row or more, it executes the action. If no rows are returned, it moves on to the next Step without running any more actions in the current step.
Finally, the Call Section action is simple: it just runs all the steps in the selected section and comes back to the next step.
Now, you have the program flow mastered, but you need to know how to pass information between the steps. The State Record is your tool. If you are familiar with COBOL, the state record is like the working storage area on a COBOL program. Or, you could say that the state record is the variables for the App Engine program.
So, to create a state record, you just need to create a new record with a name that ends with “AET”. You can create a new record the same way as you created the App Engine definition.
In your new record, you need to add at least three fields: PROCESS_INSTANCE, RUN_CNTRL_ID, and OPRID. You can use the Insert > Fields menu to add fields. The PROCESS_INSTANCE should be a key.
Next, on the record type tab, you should either select Derived/Work or you should select SQL Table. If you choose SQL Table, you will need to go through the Build process when you create and each time you change the record. If you use Derived/Work, you may loose the information in the state record when the program commits (which is no problem if the only commit you have is at the end).
Now, when you save it, make sure that you add the “AET” to the end of the name. You will not be able to select it on the State Record screen unless it is named appropriately.
Once you have the state record saved, you need to connect it to the App Engine program. To do so, open the App Engine properties and go to the State Record tab. Enter the name of the state record in the search box, click the “Get List” button, select the record in the “Record List”, and finally click the “Add” button.
Finally, we can use our state record in our program. With SQL statements, we can use two different meta-sql commands:
For example, the %Select in this statement will read the EMPLID returned by the select statement and place it in the state record. Because this is a Do Select, it will fetch each row and run the rest of the actions in the step for each row. When the action runs the first time, the EMPLID field in the state record will have the EMPLID from the first row as the actions run. The state record will have the EMPLID from row 2 as the actions run the second time, and so on.
This next example uses %Bind to pull the value from the state record and insert it into a staging table.
Also, in PeopleCode steps, you can refer to the state record with the Record.Field syntax. If you are familiar with PeopleCode on a page, you understand the buffer. The buffer for a PeopleCode program in App Engine is your state record, and you access them as if they were in the buffer.
The easiest, quickest way to test your new program is to run it from Application Designer. When you have the main App Engine window active, you can click the Run button. You can also use the Edit > Run Program… menu.
This opens the Run Dialog window. You want to make sure that you select Output Log to File. If you don’t, the window will close and you won’t be able to see any of the output. I also uncheck the Run Minimized option so that I can see the window open and close more easily. Pay attention to the Log File Name because the first thing you want to do when it is done is view the output.
You will eventually want to set most programs up to run online from a Run Control. Creating a run control is outside of the scope of this post, but here are some thoughts that might help you toward that direction:
As you create your program, you should be adding it to a project. This ensures that once you have it working, you can easily migrate it to your test environment and eventually to production. The catch is that the program has different parts that must be inserted individually. The program as a whole must be in the project. Each section must go into the project, as well as each individual SQL or PeopleCode program.
You run into problems when you miss a part. App Designer cannot migrate a child definition if the parent definition does not exist in the target. For example, you can’t migrate any sections if the parent App Engine program does not exist in your target environment. You can’t migrate a Do Select SQL statement if the section with the parent step/action does not exist in the target.
As you go, I recommend using the F7 key to insert everything your create or change as you do it. This ensures you don’t forget anything. When you create a new section, you can right click on the section and insert it into the project:
Assuming you want all of the program and its parts in your project, you can use the insert related definitions option. Remember, you only want to do this when you created the program by yourself. If you only modified some of the parts, you only want the parts in your project that you actually changed. To, use the option, press Ctrl + F7 or use the Insert > Definitions Into Project. Before you insert the program into the project, highlight all of the Related Definitions.
Here are some other articles that I have written that might be helpful:
Here are some other places you might want to look as well:
Have you heard of PeopleSoft Program Management? If not, you’re not alone.
Program Management is one of the lesser known applications within the PeopleSoft footprint. However, when utilized in conjunction with PeopleSoft Project Costing, Program Management can provide organizations a tremendous amount of value by consolidating project information into one neat repository.
Having all of the projects in one repository allows for a level of consistency amongst projects and empowers project managers to have common work plans, progress, project milestones and definitions. With a standard view of projects, an organization can have a better understanding of project or program profitability and an overall comparison of budgets and actual to forecasts across projects. Users utilize the Enterprise Program Tree to group like projects together to summarize data and create project dependencies. Similar projects can be templated which promotes the ability to compare similar project efforts.
It’s really an amazing piece of software for project-heavy organizations.
Here are a few snapshots of the features of PeopleSoft Program Management (click to enlarge):
Snapshot of the Enterprise Program Management Tree: All projects within a business unit, all projects rolling up into programs.
Consistent projects rolled up into programs allowing for a consistent view and analysis will better power your organization to successfully manage enterprise programs.
If you’re curious or interested in learning more, feel free to reach out to me and I’ll get in touch with you right away. No BS, no sales. Promise.
###
More links:
MIPRO Consulting main website.
Recently, I wrote about granting read only access to the database for developers. Tim Hall commented that my solution was insecure and granted too much, possibly allowing a loophole. At the same time, I recently wanted to provide public synonyms to users.
So, the following role, procedures, and trigger attempt to accomplish those two goals:
create role SKP_ReadOnly;
Now, I need a procedure that will both create synonyms and connect my role with a particular table. The goal of this procedure is to accomplish any task that needs to happen to all tables in the system. You could easily add extra roles or other tasks to this procedure as well.
The only parameter is the table that you want to “secure”. Note that this “objname” is the actual table name with the “PS_” in front of it as opposed to the record name.
The first execute immediate creates the public synonym. This allows any user to query the table without having to put the schema in front of it. Without the synonym, every user has to put “sysadm.” in front of all of the PeopleSoft tables.
The second execute immediate gives “select” access to the SKP_ReadOnly role. This attaches readonly access for that table to that role.
CREATE OR REPLACE PROCEDURE SKP_SecureTable (objname in varchar2) IS begin execute immediate 'create or replace public synonym ' || objname || ' for SYSADM.' || objname; execute immediate 'grant select on SYSADM.' || objname || ' to SKP_ReadOnly'; end; /
Next, I need to run the previous procedure against all of the existing tables. This is a one-time deal for the most part, but I went ahead and created a procedure for it. The procedure simply loops through all of the tables in the “SYSADM” schema and executes the previous procedure passing that table as the parameter.
create or replace procedure SKP_SecureAllTables is cursor tbls is select table_name from dba_tables where owner = 'SYSADM'; tbl tbls%ROWTYPE; begin open tbls; loop fetch tbls into tbl; exit when tbls%NOTFOUND; SKP_SecureTable(tbl.table_name); end loop; close tbls; end; /
Now, we just need to call the procedure. This works on all of the existing tables.
call UP_SecureAllTables();
Finally, we need to handle new tables. If you create any new records or even if you Alter any existing records, you will loose the synonym and the role connection. Remember that when you alter an existing table in App Designer, it creates a new table with the new structure, copies the data from the old one, drops the old one, and renames to new one to the original name. When it drops the table you loose your security.
So, this trigger fixes that problem. Basically, any time a new table is created, it runs our original procedure to grant that table to the role and create the synonym.
create or replace
TRIGGER SKP_TableCreated_Trig
AFTER create ON database
declare
jobnum number;
BEGIN
IF ORA_DICT_OBJ_OWNER='SYSADM' THEN
SYS.DBMS_JOB.SUBMIT (jobnum, 'SYS.SKP_SecureTable(''' || ORA_DICT_OBJ_NAME || ''');');
END IF;
END;
/
As always, if you have an issue with any of this, see anything incorrect, or know a better way, please comment!
Stop me if you heard something similar before. Ready?
Kentucky limits on debt issuance have hindered high-priority university construction/renovation projects. Detailing this is a great piece over at Inside Higher Ed, by Kevin Kiley. To wit:
Even though the university would fund its new debt through non-state revenues, lawmakers in the Kentucky state legislature, which wrapped up its budget process earlier this month, denied the state’s universities the authority to issue any bonds for the next two years, fearing that more debt by state institutions could hurt the state’s credit ratings.
Now the state’s universities will likely not be able to finance projects through debt until the legislature reconvenes in two years, and there is no guarantee that it lawmakers will approve bonds then. For the University of Kentucky, that means the university will put off several projects, and the already old infrastructure will continue to age, which administrators say could hinder student and faculty recruitment.
Clearly, the theme of the article is the challenges the University of Kentucky is facing with financing capital projects and expansion. But here’s the rub: it’s not just the University of Kentucky. It’s every state and nearly every institution, both private and public, that are being asked to do more with less. We hear it literally every week. It’s such a common constriction that it’s almost assumed at this point.
PeopleSoft presents solutions for Capital Planning along with Asset Lifecycle Management. Chances are, your role spans more than just figuring out how to get it done. You must also figure out how to keep it running, for a long time, at a reasonable cost. Construction is just a small piece of the puzzle and extending the life of an asset is just a small part of the answer. The reality is that you cannot allow your hands to be tied if you are going to succeed.
It’s fun to think it’s a workable constraint, but it’s not. Reality is reality.
We work with organizations every day that are forced to engage this dilemma head on. If you are curious and want to talk (or just vent), drop me an e-mail.
###
More links:
MIPRO Consulting main website.
by noreply@blogger.com (rakesh.parwal) at May 14, 2012 05:42 AM
I'm facing a problem with PeopleSoft queries (using Oracle backend database): when a rather complex query involving multiple records is set off by a user, PS does an enforced join of security records, thus producing SQL like this:
select .... from
ps_job a, PS_EMPL_SRCQRY a1, ps_table2 b, ps_sec_rcd2 b1, ps_table3 c, ps_sec_rcd3 c1
where (...security joins a->a1, b->b1, c->c1...) and (...joins of a, b and c...) and
a.setid_dept = 'XYZ';
(let's assume the last condition has a high selectivity and there is an index on the column)
Obviously, due to the arrangement of the conditions, first a huge join is created, written to the temp segment, and when the last condition is finally applied, only a small subset is selected. A query formulated in this way is very likely to hit the preset timeout of the APPSRV, and even of the QRYSRV. When writing the query manually, I would rather move the most selective condition to the start, thus limiting the amount of the data being handled, to a considerable level.
Any ideas on how to make PS behave like this? Actually, already rewriting "Oracle-styled" SQL to ANSI SQL seems to accelerate the queries - however, PS writes Oracle-style queries...
Thanks in advance
DBa
I have a report that I am building which uses a rowset with six child rowsets. I am generating this report via pplcode on a button. I declare the rowsets:
rs_resp = CreateRowset(Record.AVZ_JD_RESP_TBL);
&rs_expr = CreateRowset(Record.AVZ_JD_EXPR_TBL);
&rs_skls = CreateRowset(Record.AVZ_JD_SKLS_TBL);
&rs_educ = CreateRowset(Record.AVZ_JD_EDUC_TBL);
&rs_lic = CreateRowset(Record.AVZ_JD_LIC_TBL);
&rs_cond = CreateRowset(Record.AVZ_JD_COND_TBL);
&rs_dtl = CreateRowset(Record.AVZ_JD_DTL_VW, &rs_resp, &rs_expr, &rs_skls, &rs_educ, &rs_lic, &rs_cond);
Then I go through and fill the rowsets:
&rs_dtl.Fill("WHERE FILL.AVZ_JD_DESCRID = :1 AND EFFDT = %DATEIN(:2)", &jdDescrID, &effdt);
And so on.
On my report, I have some stuff from the parent rowset at the top, and then the child rowsets (with "section headers") following:
Child One: data from &rs_resp
Child Two: data from &rs_expr ... My problem is not all of the rowsets will have data & I want to exclude those sections from my report. I first attempted to use the @numrows in a conditional region on the RTF template, but was quickly reminded that even empty rowsets have at least 1 row...
The challenge seems to be getting the title as well as the data area to be affected by the condition...
Has anyone done this, or have any ideas?
Thanks!
Exactly one year after the previous PSOVM template on FSCM9.1 FP1 (Peopletools 8.51.x), there’s a new one, based on FSCM 9.1 Features Pack 2 and Peopletools 8.52.03. So, it looks particularly an interesting step forward.
As usual, it’s downloadable on https://edelivery.oracle.com/oraclevm
The documentation about this new template can be found here : http://docs.oracle.com/cd/E29416_01/psft/html/docset.html
Whether there’s nothing much new in the database template (the database seems to be stucked on Oracle 11.1.0.7), there’re several things we should take care of before going on. The questions prompted on the first Apps template instantiation must be clearly understood to avoid further problem and mistake.
1) Demo environment [y|n] : choose ‘y’ if you want the AppServer connect to a FSCM template, ‘n’ otherwise.
2) Configure a Decoupled Appl Home [y|n] : choose ‘y’ if you want to work on an Application database (here FSCM), ‘n’ otherwise (Peopletools only database).
Depending of the answers you are given, there’re some other questions prompted which are not totally clear yet, at least not documented.
Last and not least, the Apps/Batch/PIA template deployment suffers of a bug, there’s nothing about network configuration (IP address, Netmask, Gateway, DNS). So, it’s using DHCP, period. That’s certainly not what we want from a server, especially on a PIA server which must be reachable from any client in the network.
There’s a workaround though.
For the two aspects mentioned above, getting more explanation about the prompted questions and the workaround to make the template deployment successful, I only can advise you to read the following thread I’ve created in OTN Forum dedicated to Peoplesoft OVM, there’re very answers from Sheshi : About the template FSCM9.1 FP2 Peopletools 8.52.03 (v3)
That’s a pity, the lack of documentation and the deployment bug on Apps/Batch/PIA may refrain people to use PSOVMs even though they’re still good for those who want to build quick (but not dirty) environment.
Awaiting a new recut, I hope this help people trying to make it work,
Nicolas.
by Gasparotto Nicolas (noreply@blogger.com) at May 08, 2012 07:24 PM
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://xmlns.oracle.com/Enterprise/HCM/services">
<soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<wsse:Security soap:mustUnderstand="1"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken>
<wsse:Username>PS</wsse:Username>
<wsse:Password>PS</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<ser:SCC_UR_CREATEACCT_REQ>
<ser:SCC_USERNAME>JMTEST_USER_2</ser:SCC_USERNAME>
<ser:SCC_PASSWORD>password</ser:SCC_PASSWORD>
<ser:SCC_CONFIRMPWD>password</ser:SCC_CONFIRMPWD>
<ser:CONSTITUENT>
</ser:CONSTITUENT>
</ser:SCC_UR_CREATEACCT_REQ>
</soapenv:Body>
</soapenv:Envelope><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://xmlns.oracle.com/Enterprise/HCM/services">
<soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<wsse:Security soap:mustUnderstand="1"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken>
<wsse:Username>PS</wsse:Username>
<wsse:Password>PS</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<ser:SCC_UR_AUTHENTICATE_REQ>
<!--Optional:-->
<ser:SCC_ENTITY_INST_ID></ser:SCC_ENTITY_INST_ID>
<ser:SCC_USERNAME>JMTEST_USER</ser:SCC_USERNAME>
<ser:SCC_PASSWORD>password</ser:SCC_PASSWORD>
</ser:SCC_UR_AUTHENTICATE_REQ>
</soapenv:Body>
</soapenv:Envelope> by Jeromy McMahon (noreply@blogger.com) at May 08, 2012 09:53 AM
MostOracle users prefer Fusion in the cloudWe have an XML Publisher template that uses a query (built in query manager) as a data source. The query uses a custom view containing confidential data. The report is to be used by managers to view information on their direct reports - this is accomplished by setting parameters on the page. Since we have to make the record available to Query, any manager that also has permission to write queries can also see the record, and thus data on employees other than the ones that report to them. The Query also has to be public, so it too will be available to anyone that has access to run queries. We'd like to be able to:
Make the query available only via the page (I think I've got this one - the page will pass an additional parameter which will be compared to in the WHERE clause of the query)
Hide the custom record from anyone but the query/report
We cannot use typical row-level security as a general manager should only be able to see the people that report up to them.
Thanks
We have a PeopleSoft installation and I am building a separate web application that needs to pull data from the PeopleSoft database. The web application will be on a different server than PeopleSoft, but the same internal network.
What are the options, and I welcome any recommendations.
Hi all we are building a portal at work. When the user logs on to the portal he/she can press a button which will re-direct them to a peoplesoft webpage. This works fine however when the user only closes the tab in the peoplesoft webpage and doesn't sign out he/she has an issue re-visiting the peoplesoft page again. For example; user logs on to portal --> clicks button -->( (A)cmd=pslogin logs in if required) redirected to peoplesoft page -->closes tab (doesn't sign out)--> goes to tab with portal --> click button --> peoplesoft page doesn't load blank screen comes up. The blank screen that comes up is the same as the one from before (A) however nothing appears. I think the issue is that when the user closes the tab without logging out the session/cookies on the local machine are never removed. Thank you