Question
Blue Rose Technology
GB
Last activity: 14 Oct 2015 0:16 EDT
How to save a pagelist data through procedure.
We have a requirement to save the pyWorkPage through procedure in another daa base.
I can pass he single value as a parameter in the procedure. I have also some pagelist and value list property under the pyWorkPage.
Can you please let me know how can i pass his property.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
US
Ajay,
Are you trying to pass it as a single object or do you want to break each page in the list into separate rows in the database? We store the full contents of pyWorkPage in the database as a blob, with select values replicated in exposed columns. You could do that, or copy off the page as an XML structure without much effort. If you want every value in this other database exposed, you'll need to do a fair amount of work since, as you point out, things like lists and groups aren't scalar and can't just be dropped into a column. In the end, it comes down to the business problem you are trying to solve by using that other database. There may be an easier way to solve that problem.
Thanks,
Mike
Pegasystems Inc.
IN
We have a similar requirement where in the user performs an update in Pega for addresses (assume each person can have multiple addresses), for example
P1-Address1-PostCode1
P1-Address2-PostCode2
P1-Address3-PostCode3
I want to push this to a stored procedure and in the stored procedure the customer will then take the data and apply some updates..
We want to manage this as a single operation - so what are the options of passing this pagelist to the stored procedure
Blue Rose Technology
GB
Hi Salil,
Please assign all the values in a single property with a delimiter like we have used '|' in the procedure, we can insert it into multiple row.
Pegasystems Inc.
IN
Thanks. The question is if our pagelist structure is nested then it may become a challenge creating a delimiter string. Not sure whether you considered constructing a XML from a page list and then passing over
Updated: 13 Oct 2015 18:00 EDT
Pegasystems Inc.
GB
Perhaps just passing the whole page in XML representation might suit your requirements here ? You can get the XML of a page using a Java API call:
xmlData=myStepPage.getXML();
So for example the following activity will create a complex Page (just fetches the Operators from the system) , turn this into a string of XML elements and display it to the browser:
Perhaps just passing the whole page in XML representation might suit your requirements here ? You can get the XML of a page using a Java API call:
xmlData=myStepPage.getXML();
So for example the following activity will create a complex Page (just fetches the Operators from the system) , turn this into a string of XML elements and display it to the browser:
So the XML looks like this (abridged):
<?xml version="1.0"?> <pagedata> <pxResultCount>17</pxResultCount> <pyMaxRecords>10000</pyMaxRecords> <pxTotalResultCount>0</pxTotalResultCount> <pxSQLStatementPost>SELECT PZPVSTREAM AS "pzPVStream", PZINSKEY as "pxInsHandle" from PRPC_719.pr_operators WHERE pxObjClass = ? </pxSQLStatementPost> <pxPageCount>0</pxPageCount> <pxObjClass>Code-Pega-List</pxObjClass> <pxMore>false</pxMore> <pyObjClass>Data-Admin-Operator-ID</pyObjClass> <pxQueryTimeStamp>20151013T214954.029 GMT</pxQueryTimeStamp> <pxSQLStatementPre>SELECT PZPVSTREAM AS "pzPVStream", PZINSKEY as "pxInsHandle" from {CLASS:Data-Admin-Operator-ID} WHERE pxObjClass = {pyReportParameters_temp.pyPreparedValues(1)} </pxSQLStatementPre> <pzStatus>valid</pzStatus> <pxResults REPEATINGTYPE="PageList"> <rowdata REPEATINGINDEX="1"> <pyImageFileName /> <pyTemplateDataField /> <pyTemporaryObject /> <pzRuleFormToolbar /> <pxMoveImportOperId>[email protected]</pxMoveImportOperId> <pyWorkGroup>Default</pyWorkGroup> <pyReloadForm>true</pyReloadForm> <pxLimitedAccess>Dev</pxLimitedAccess> <pyUserIdentifier>[email protected]</pyUserIdentifier> [...]
The format of the XML is a lower-level representation of the pagedata that you see in the Clipboard Viewer: a fact which you might need to take into consideration (depending on what you plan on doing with data on the other database).
You should probably consider creating a SERVICE in PRPC; and calling it to fetch the data in higher-level format; you could use (for instance) XML-Stream Rules to map your properties to an XML schema of your choice that way.....
EDIT: my statement above assumed that the other database you need to save data to is outside of PRPC's control ? If this is not the case; then you can actually configure PRPC to talk to more than one database.
You could consider using BIX to transmit data this way as well : where you essentially configure an Extract Rule which can be run in batches by BIX : which can output 'flat' CSV, XML - or just directly load data into another database.
Cheers
John
Pegasystems Inc.
IN
John - many thanks for a detailed response - much appreciated!