Discussion
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Tata Consultancy Services
IN
Last activity: 13 Mar 2015 11:38 EDT
How to configure the Obj methods to access the external DB
How to configure the Obj methods to access the external DB
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689977000/82e93177-3fd9-42a0-91c7-73697a6a3024.jpg?itok=8Yq6mR5q)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689977000/82e93177-3fd9-42a0-91c7-73697a6a3024.jpg?itok=8Yq6mR5q)
Pegasystems Inc.
IN
Hi Ram,
Id I understood your question correctly, please find below the detailed configuration step for using the OBJ-Browse method in an activity.
Obj-Browse method |
|
Use the Obj-Browse method to search instances of one class and copy the entire instances, or specified properties, to the clipboard as an array of embedded pages.
Only properties exposed as columns can be used as selection criteria. However, values of properties that are not exposed as columns, including embedded properties, can be returned.
Use the Obj-Browse method optionally followed by the Obj-Filter method to create a list of search results. The Obj-Browse method selects instances based on values of properties exposed as a column. The Obj-Filter method qualifies and filters list results based on all property values, exposed or not. Together these two methods provide greater control over which properties are returned, and better performance, than the Obj-List method.
Hi Ram,
Id I understood your question correctly, please find below the detailed configuration step for using the OBJ-Browse method in an activity.
Obj-Browse method |
|
Use the Obj-Browse method to search instances of one class and copy the entire instances, or specified properties, to the clipboard as an array of embedded pages.
Only properties exposed as columns can be used as selection criteria. However, values of properties that are not exposed as columns, including embedded properties, can be returned.
Use the Obj-Browse method optionally followed by the Obj-Filter method to create a list of search results. The Obj-Browse method selects instances based on values of properties exposed as a column. The Obj-Filter method qualifies and filters list results based on all property values, exposed or not. Together these two methods provide greater control over which properties are returned, and better performance, than the Obj-List method.
Parameters
The Obj-Browse method has five base parameters and an optional array of selection criteria.
Parameter |
Description |
PageName |
Enter the name of the destination page to contain search results. The system uses Code-Pega-List as the class of this page. |
ObjClass |
|
MaxRecords |
Optional. Enter the maximum number of instances you want returned in the list at runtime. If left blank, the default value is 10,000.
|
GetRowKey |
Select to include the primary key in the set of property values returned. Clear to exclude the primary key. (Selected by default.) |
RowKey |
Optional. Leave blank unless the class in the ObjClass parameter corresponds to an external table. Enter the name of a property in the external table, or an expression involving one or more property names, that specifies the unique key of rows of the external table. |
ReadOnly |
Select to mark the embedded pages for the selected instances as read-only, meaning that later processing by the requestor cannot update or delete data in the page. Leave unselected if you plan to update the embedded pages.
|
Logic |
Optional. Enter a boolean statement that defines how the rows of the parameter array are to be combined. Identify rows by the Label field. You can use the operators AND and OR in this statement, and parentheses for grouping. For example, A AND (B OR C OR (E AND F)). If you leave this blank, the system assumes the AND operation applies to all rows of the array. |
|
For an external class, complete at least one row of the array. |
Label |
Enter a unique letter or identifier for this row, referenced in the Logic field. |
Select |
Select to return the value of this property on each embedded page. In the resulting SQL statement at runtime, this property is listed in the SELECT list (as well as the WHERE condition). |
Field |
You can return any property — exposed as a column or not — in the results by setting the Condition field to Click the pencil button ( To restrict the search to specific values of a property, enter a property reference that is exposed as a database column. You can review the database schema to determine which properties are exposed for a class. Consult your database administrator for information on the current database schema, or use the Modify Schema facility. See How to expose a property as a database column. |
Condition |
If the property is not exposed as a database column, select |
Value |
Click the pencil button (
For example, if the Field field contains a But if the Value field contains a second property RenewalDateTime, then the system compares the value of the two properties ExpireDateTime and RenewalDateTime for each instance of the class. |
Sort |
Select If the Condition is |
Results
At runtime, the system converts the parameters to an SQL query statement, creating a SELECT WHERE and ORDER BY query based on the parameters, and sends the query to the PegaRULES database.
This method operates on the database response to create a results page containing one embedded page for each instance retrieved. See Standard properties in the Code-Pega-List class.
If the Field parameters identify only Single Value
properties exposed as columns, each embedded page in the results contains only those properties. However, if one or more of the Field parameters identifies a property that is not an exposed column, the entire pzPVStream column, also known as the Storage Stream or Blob column, is also returned.
The Obj-Browse method returns the data either to a previously created step page — which is cleared and reused — or to a new page of that this method creates of class Code-Pega-List. The system writes search results in the specified step page, along with information that controlled the search.
This method also adds or updates these properties in the step page:
- pxResultCount — A count of the instances retrieved by this search.
- pxMore — Indicates whether there are more instances in the database that were not returned. Values are
true
orfalse
. - pxNextKey — Indicates the key of the first row (instance) not returned, if pxMore is
true
. - pxElapsedTime — Seconds of elapsed time spent executing the request.
Execution of this method does not trigger declarative rule processing that depends on change tracking. Even when a property retrieved by the Obj-Browse method is involved in a Declare Expression, Declare Constraint or other declarative rule, retrieval does not cause the declarative rule to re-evaluate.
Performance
This method can return thousands of database rows and create large clipboard pages. Use care to retrieve only the rows (instances) and columns (properties) you truly need. Similarly, specify sorting only when needed.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689981000/41df843b-03a2-421f-b0fd-4623034905c5.png?itok=qHTdX9CV)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689981000/41df843b-03a2-421f-b0fd-4623034905c5.png?itok=qHTdX9CV)
Alter Domus
IE
Hi,
The first step for this is that you need to create the DB instance to give authorization to pega to access the external DB.
For each table in the external DB, you may need to run the Connector and Meta data accelerator, below link gives you sufficient information.
https://community.pega.com/sites/default/files/help_v717/procomhelpmain.htm
Or you can create the classes, properties, Data-Admin-DB-Table instances manually for each table in your external DB.
After creating all these classes, you can use these classes normally in Obj- Methods as you do for the Pega internal tables except you may not have the default columns like pzInsKey, pxCreateDateTime etc.