Question
Accenture
IN
Last activity: 7 Mar 2017 4:42 EST
Using Obj-Sort method
Can we use Obj-Sort method on a pagelist which we have declared ourselves in Pages and Classes but not created a PageList type property? If not, how can we sort the results in such case?
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
US
Obj sort typically needs to know what kind of objects it is sorting because you need to tell it which properties you are sorting on. If you have multiple types of objects in the list, then identify a common ancestor for your .pxresults (assuming you are sorting code-Pega-list). If you are working with an embedded page list in a parent class already defined, then an additional pages and classes reference would not be required. Remember that if you have multiple object types in your list, you should only be able to sort on properties that they have in common and get from a common ancestor which is either identified in your pages and classes or is identified in the parent (container) class.
If you don't provide sort properties or if your embedded classes don't inherit from a common ancestor with those properties, you can expect errors.
Pegasystems
IN
Please clarify my understand that you do not have a property definition (Rule-Obj-Property instance) for a page list property but have created one in clipboard and want to sort on it.
Accenture
IN
Yes Rajiv. I do not have any property definition and have created on clipboard and want to use it.
Pegasystems
IN
Ok. I have never tried doing this. Are there any issues when you tried?
Accenture
IN
It allowed me to save but at runtime, it is throwing exception:
com.pega.pegarules.pub.clipboard.InvalidParameterException: must have mode Page List. Details: Invalid value for aPageList passed to com.pega.pegarules.data.internal.clipboard.Sorter.sortPageList(ClipboardProperty, String[], boolean[], String[])
Virtusa Corporation
US
Hi Nistr,
There is a pega activity "CPMGetIntentTasksByCategory" which gets list of intent tasks. So, after getting all Intent tasks on PageList Obj-Sort is being used.
TaskOrder (Interger) as sort property. Not all intent tasks are being sorted.
Pegasystems
US
The pages-and-classes tab only clarifies the classes for items, it never creates the items for you. You still need to have or create existing items to work with. /Eric
Accepted Solution
Pegasystems Inc.
US
Obj sort typically needs to know what kind of objects it is sorting because you need to tell it which properties you are sorting on. If you have multiple types of objects in the list, then identify a common ancestor for your .pxresults (assuming you are sorting code-Pega-list). If you are working with an embedded page list in a parent class already defined, then an additional pages and classes reference would not be required. Remember that if you have multiple object types in your list, you should only be able to sort on properties that they have in common and get from a common ancestor which is either identified in your pages and classes or is identified in the parent (container) class.
If you don't provide sort properties or if your embedded classes don't inherit from a common ancestor with those properties, you can expect errors.