Question
ASB Limited
NZ
Last activity: 23 Mar 2016 23:13 EDT
Activity - Code-.RecreateIndexesForClass use?
Hello Team,
we have some rows left our being indexed in Child classes (ex ABC-app1-work-child1), we have to index it to our reporting table.
we have an declare index rule been generated for indexing (copies work table instances to Index-Work table (reporting alone)). it is been working fine on work class and it sub classes as well.
since it is not adviced to use property-set, or other methods on Index- classes,
---> Do not use Property-Set or Obj-Save methods on instances in a class derived from the Index- base class. Use only Declare Index rules to change these properties and instances.
Can i please get to know how the activity Code-.RecreateIndexesForClass will help out?
how we can proceed with indexing more than 1 Lakh records using this activities?
Please let me know for any clarifications on this, and correct me if anything.
Thanks,
Mathan
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 23 Dec 2015 2:04 EST
Pegasystems Inc.
JP
I remember that if you simply run the activity for Work objects, the execution will end up with errors something like below,
com.pega.pegarules.pub.database.LockGoneException: Save, Delete or Commit has failed because lock "Your-Work W-1" is not held.
As a work around, you can private checkout activity:RecreateIndexesForInstance, modify it to obj-open and lock the work object first then save it without any change.
Pegasystems Inc.
US
Just run the activity and provide the class name as the input. See one example here:https://community.pega.com/support/support-articles/optimized-properties-display-truncated-values. CPM installation process uses this activity extensively.
ASB Limited
NZ
Hi Kevin, I had run this activity by passing class name. But Declare Index has not run for those instances in that class.
We need to trigger the Declare Index for all instances in this class, so we can have its instances copied into Index- class (for reporting).
as i know the only way to trigger index is update the instance(cases) from front end, in this case it has 300+ instances so updating will take more time.
Please advice how it could be done.
Thanks for your guidance.
Thanks,
Mathan
Pegasystems Inc.
IN
would delegating the re-index task for 300+ wo's to agent running at non-business hour works?
ASB Limited
NZ
Thanks Phani Sahukaru
shall we call an Declare Index in Activity, is it possible?
if yes we can have agent to run at non business hours else we have only choice to update each instances of that class manually from front end.
Pegasystems Inc.
IN
as Chunzhi said, we need to set .pzReindex to true. Activity RecreateIndexesForInstance does it.
again - would re-indexing all work from System --> Settings --> Search landing page helps?
ASB Limited
NZ
I did not do any reindexing on Search landing page. we just use the RecreateIndexesForInstance activity in our activity and it has successfully triggered the Declare Index..
Thanks for your awesome support and helpful tips.
Accepted Solution
Updated: 23 Dec 2015 2:04 EST
Pegasystems Inc.
JP
I remember that if you simply run the activity for Work objects, the execution will end up with errors something like below,
com.pega.pegarules.pub.database.LockGoneException: Save, Delete or Commit has failed because lock "Your-Work W-1" is not held.
As a work around, you can private checkout activity:RecreateIndexesForInstance, modify it to obj-open and lock the work object first then save it without any change.
ASB Limited
NZ
Thank you very much Chunzhi, we have created a activity to open particular class instance on certain conditions, then used the activity RecreateIndexesForInstance and saved the instance. Now the Declare index been triggered for all the instances those met the conditions.
thanks for you Awesome Clarifications and wonderful support !!
Tech Mahindra
IN
Hi,
I have some 500 cases in production. I have created a Index/DeclareIndex on a page list of work object. Say WorkObject.Leads() . Declare Index is getting triggered when a new record added to Leads() pagelist . But, how do I give index to existing Leads values?
Tech Mahindra
IN
Hi ,
I have some 500 cases in production. I have created a Index/DeclareIndex on a page list of work object. Say WorkObject.Leads() . Declare Index is getting triggered when a new record added to Leads() pagelist . But, how do I give index to existing Leads values?
Best regards,
Satya
Virtusa IT Consulting
AE
Hi Satya,
You can use 'Column populator' utility to populate the old/existing work objects in the index table in DB.
Thanks,
Habeeb Baig
Updated: 2 Feb 2016 3:10 EST
Pegasystems Inc.
JP
If you are allowed to run script on prod, give it a try to column population utility
By the way, it seems that re-running optimizer wizard doesn't work well with declare indexs
Tech Mahindra
IN
setting .pzReindex=true on work page also recaiculating my page list indexes. So issue is resolved. Do we need to reset .pzReindex on work page after this. Will it causes any issues. any idea?
Updated: 23 Mar 2016 6:56 EDT
>>> Recently two declare indexes have been introduced in my application, one for product list and other one for Approvers list . Now customer asked for a report on products information for all existing objects ,
so we need to recreate the indexes only for product details for all work objects,but not for Approvers list.Can it be accomplished by running the Code-.RecreateIndexesForClass activity?.-------------only for specific declare index instance.
We are planning to open each work object instance,modify the product list records and save the WO instances. Please advice me if we have any better solution for this requirement.
>>> Can we keep a condition to validate the index instances before written to DB ? Here , the business use case is like plenty of products are being displayed on screen but only selected products to be written into DB.
Pegasystems Inc.
JP
>Can it be accomplished by running the Code-.RecreateIndexesForClass activity?.-------------only for specific declare index instance.
No, you can not specify which declare index to be populate column values in the database, ALL available declare index rule will be executed when a work object get saved. If you have not migrated declare index rule for Approvers list to the production, then you don't have any problem, however if you have already migrated declare index rule to the production, you have to make the declare index rule unavailable some how as you recreate index for products information.
>the business use case is like plenty of products are being displayed on screen but only selected products to be written into DB.
All items in a list which is exposed by declare index will be written into index table.
If you want to retain a portion of list to be exposed, I guess you need another page list property which keeps those items.
Thanks Chunzhi for confirmation..Yes, we can't use Code-.RecreateIndexesForClass in this situation ,Hence we'll make a utility to open each work object instance and modify the product list (not approve list) to execute the declare index for products on saving of WO