Posted: 28 Dec 2016 5:28 EST Last activity: 13 Feb 2017 9:25 EST
how to use obj-filter method in an activity
Could you please advise on how to optimize an already existing activity? Pega PRPC 6.3 SP1.
In one of our strategies we filter out offers that have stock <= 0.
In order to get the stock value, our current implementation is:
List of propositions ( offers).Some of the properties are: inLife ( shows if the proposition is available or not in the current offer portfolio. Values Y or N),unique id of the proposition;
The above id is declared in an external application ( similar to a product catalog). Under this unique id are added some kid parameters. For each kid a stock is declared and maintained daily.
This stock is interrogated and retrieved in Pega PRPC application via a Web Service.
Currently we have an activity that has the following steps:
Get propositions (obj-browse method for the propositions class)
Get kid parameter for each unique offer id (obj-browse method – for a class belonging to an external table that contains the association unique id – kids)
Call activity for Web Service.
The main issue is that:
For step 1 all propositions are retrieved ( even the ones that are no longer in current portfolio)
For step 2 all kids are retrieved
For step 3 – we are getting stocks for propositions that are not in our interest and this causes a lot of “noise” in Pega.
What we would like to do is :
Step 1: get only those propositions that have inLife parameter set to Y( inLife property is exposed)
Step 2 : get from the external table only those kid parameters that meet the condition: uniqueId in Pega = unique id in table
Step 3 – query the WS only for the kids of the inLife propositions.
I think that we might use the obj-filter method in this activity. I have read the obj-filter related topics, but unfortunately I couldn’t work out how should I implement it the activity. Please note that I am not a technical person.
Could you please help me with step by step guidelines?
Obj-Browse : Gets list of data as embedded pages for one class type. It can be used to select the fields that are not exposed, but unexposed fields can't be used to set the criteria. It can also not filter on properties which are not optimized. But if you select a property that is not optimized, it will read the entire BLOB.
Obj-Filter : Used to remove the embedded pages from a list based on certain criteria given as When rule.
After obj-list-view, Obj-Filter can be used to filter the obtained list, even based on embedded properties.
Thank you for your answer. I still don't know what should i do in order to make the desired changes.
In step 1 - obj-browse method is used for the propositions class. Select .uniqueId, condition = value only. This means that now i have a list of embedded pages containing all .uniqueId properties, although my propositions have a lot of other properties ( name, inLife, startdate, etc). Is that correct?
First question: what should I do in order to select only those .uniqeId properties that meet the condition : select uniqueId where .inLife ==”Y” ?
Both .uniqeId and .inLife properties are exposed.
In step 2 – obj-browse method is used for external data table class.
-Table_Unique_id , condition = Value Only
-KidId , condition = Value Only
Question 2 : what should I do, after I got these data, in order to :
select kidId where .uniqueId (from propositions) = Table_Unique_id ?
Could you please explain based on this example, exactly the steps i need to follow ?
It seems i have resolved the first issue. Select only those .uniqeId properties that meet the condition : select uniqueId where .inLife ==”Y” , by extending selection criteria in obj-browse method.
Still searching for a solution for the second issue. Now that i have a list of 73 uniqueIds ( from more than 200 available) i must compare them with all .TABLE_UNIQUE_ID from the external table and get only the 73 ids that match and for these 73 ids i must get all KID_IDs from the external table.
>> I have a list of 73 uniqueIds ( from more than 200 available) i must compare them with all .TABLE_UNIQUE_ID from the external table and get only the 73 ids that match and for these 73 ids i must get all KID_IDs from the external table.
Since your table_unique_id is from external table, you cant use obj-browse. You need to use RDB-List
So do an RDB list to get the data from ext database to your cliboard in a temp page
Also Create a page list with the 73 unique filed data
Iterate thru each of the unique field data
and perform obj-browse
The filter condition for obj browse can be , where Table_unique_ID equals uniqueId
If matches then store in a new page list
Once the iteration is done, remove the temp page that holds the RDB List data
Note : This is not an efficient method. This might create some performance overhead on the thread.
The other option could be to use Connect-SQL and RDB-Open. Make sure to utilize "Run in Parallel "option while using RBD operations.