Rollbase Business Entity private cloud - complex filter and sorting - Forum - Rollbase - Progress Community

Rollbase Business Entity private cloud - complex filter and sorting

 Forum

Rollbase Business Entity private cloud - complex filter and sorting

This question is not answered

Hello All,

We're running RB private cloud 3.0.4 using OpenEdge Service JSDO 11.4.

I'm following the RB User Guide on enabling "Service Object supports complex filter and sorting" on page 330 and also enabled the check box in the object definition.

However when I run the main record listing in both RB and Portal, it retrieves every record for that table.  This chews up a significant amount of ram.

In the Rest Broker log file, it does not appear to be sending any JSON filter parameter down.

03.816+2700] P-002504 T-003272 1 AS -- (Procedure: 'ReadDsABC_code DsABC_code' Line:146) DEBUG: ?
[14/10/27@10:46:03.817+2700] P-002504 T-003272 1 AS -- (Procedure: 'ReadDsABC_code DsABC_code' Line:197) DEBUG: cWhere: WHERE
[14/10/27@10:46:03.817+2700] P-002504 T-003272 1 AS -- (Procedure: 'ReadDsABC_code DsABC_code' Line:198) DEBUG: cOrderBy:

Is a default JSON parameter suppose to be pass down when sending a read request or I'm missing something?

All Replies
  • Rollbase hold be passing down a query in the "filter" parameter for the OpenEdge REST. I have not done it on a Portal page, but i have done it on the normal Views in Rollbase - of course you need to set a View filter.

    Can you debug and see what the http request is that has been sent from Rollbase ? You are debugging and showing the WHERE and orderby variables, but does the "filter" query string parameter look like a JSON structure with ablFilter and orderby fields?
  • On a related question, what is the default Filter you are setting in Rollbase.  Below is the Filter in the main window, but yyou can also set this on the Object Defintion (for the Views).

  • Hi,

    Thanks for the reply.  I currently have no filter set so when the read request is sent to OE broker, the filter parameter is "?".  This results in retrieving all records and returning a dataset with 1000+ records.

    Is there a setting in RB to set the JSON parameter  to pass "top" and "skip" fields so it only sends a subset for viewing and pagination?

    The example is the documentation shows {"ablFilter": "CustNum < 50", "top": "20", "skip": 5, "orderBy": "CustNum" } but i'm unable to get a filter parameter similar to this.  I've tried setting the filter which when debuging looks like this {"ablFilter":"abc_code BEGINS '3'", "orderBy":"abc_code"}.  This however still sends hundred of records.  The Portal has a setting called "Number of Rows" but that also is unaffected.

    Looking at the RB cmd window, it says - Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.  After the query runs a few times all available RAM is used up.  It doesn't appear to flush the memory.  I had to restart RB is clear it.

  • Hi,
    JSON Filter functionality to be implemented in the Business logic of the Read method i.e. Business Entity.
    We also need a method property i.e. @openapi.openedge.method.property (name="capabilities", value="top,skip,id,orderBy").
     
    Please refer the attached sample code in cls file and generated JSON file.
     
    Hope this helps.
     
    Regards,
    Ganesh
     
    From: bingo [mailto:bounce-bingo@community.progress.com]
    Sent: Tuesday, October 28, 2014 11:55 AM
    To: TU.Rollbase@community.progress.com
    Subject: RE: [Technical Users - Rollbase] Rollbase Business Entity private cloud - complex filter and sorting
     
    Reply by bingo

    Hi,

    Thanks for the reply.  I currently have no filter set so when the read request is sent to OE broker, the filter parameter is "?".  This results in retrieving all records and returning a dataset with 1000+ records.

    Is there a setting in RB to set the JSON parameter  to pass "top" and "skip" fields so it only sends a subset for viewing and pagination?

    The example is the documentation shows {"ablFilter": "CustNum < 50", "top": "20", "skip": 5, "orderBy": "CustNum" } but i'm unable to get a filter parameter similar to this.  I've tried setting the filter which when debuging looks like this {"ablFilter":"abc_code BEGINS '3'", "orderBy":"abc_code"}.  This however still sends hundred of records.  The Portal has a setting called "Number of Rows" but that also is unaffected.

    Looking at the RB cmd window, it says - Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.  After the query runs a few times all available RAM is used up.  It doesn't appear to flush the memory.  I had to restart RB is clear it.

    Stop receiving emails on this subject.

    Flag this post as spam/abuse.

  • Thanks, Ganesh.   I was not aware that Rollbase allowed a way to set the maximum number of records returned, however. To limit the number of records to 100, you would set {"top": 100, "skip": 0} So with respect to:

    >>> We also need a method property i.e. @openapi.openedge.method.property
    >>> (name="capabilities", value="top,skip,id,orderBy").

    How would you configure Rollbase to set JSON parameter  to pass "top" and "skip" fields so it only sends a subset for viewing and pagination?  I did not think that was implemented by Rollbase (regardless of the setting in OpenEdge Business Entities.)

  • Hi,

    The method property as said above was added the the readDS method when I was testing.  In the JSON catalog file under operations this is shown:

                       {

                           "path": "?filter={filter}",

                           "useBeforeImage": true,

                           "type": "read",

                           "verb": "get",

                           "capabilities": "top,skip,id,orderBy",

                           "params": []

                       },

    I would of thought RB sends the id, top and skip filters to the REST service.  Could someone please confirm this?

    If in the case RB does send this filter down, how does RB determine how many records to retrieve back for paging?

  • The query string parameter "filter" maps to the p_filter ABL parameter.

    By convention, this can be a simple WHERE clause or it can be a JSON construct with elements ablFilter, orderby, skip, top or id.

    These are not separate query string parameters, so the catalog is correct as shown. =
  • On the second question:

    > how does RB determine how many records to retrieve back for paging?

    Rollbase always asks for all the records. It does not page in the current release -- this is independent of the fact that the OpenEdge resource may or may not support it. (Other clients of the resource specified in the Catalog can use this capability.).

    Regardless, the Catalog does look correct. =