Design Advice - Forum - Rollbase - Progress Community

Design Advice

 Forum

Design Advice

This question is answered

I would like some direction on how best to implement the following requirement in Rollbase. 

I have a list of rules that are defined by the user in a Rollbase file. Each entry will hold a rule for each field in the rollbase database. Typically the user can then enter the field name, the upper and lower limits acceptable e.g Income is greater than or less than set values.

I then need my logic to loop through the entire rule set, validating each field value and checking if the rule applies i.e. the held value for income is greater than or less than the upper and lower values held in the rule file e.g.

For the Rollbase income field holding a value of $5,500, a check will be required against the minimum value (say $8,000) and the maximum value (say $10,000).

For each case I would then like to create an outcome record - this will be a simple text message e.g. 'Income is Below minimum acceptable amount of $8,000'

I am wondering how best to implement this in Rollbase - is triggers the best approach, or maybe some custom SQL code on a trigger.

I want to avoid custom programming and keep the solution in Rollbase as long as it can perform satisfactorily. 

FYI - we may have say 100-200 of these rules that need to be run concurrently.

Thanks in advance. Any help much appreciated 

PS - While reasonably proficient in Rollbase, I am a non-technical user in relation to script etc.

Verified Answer
  • Rob,

    Well, then a server side trigger (on update any field) could be used to run the set of rules.  Rules could easily be written in JavaScript.  You would use server side API to create a message object.

    Thierry.

All Replies
  • This sounds like a perfect use case for the Corticon Decision Service trigger. You can create all of your rules in the rules engine, then map the Rollbase record as input. I think it will make the whole process of managing (and executing) the rules a ton easier...but you'd need access to Corticon, of course. :)

    Here's more information, if you're interested in that approach: documentation.progress.com/.../index.html

  • You have several solutions depending on your rules:

    1) You can configure object fields with various constraints, for example income field can be constrained to a min and max value.  Here is how it renders in the ui:

    The advantage is that you have client side validation.  That is user receives immediate feedback when entering data on the field.

    2) When the constraints is more complex or require evaluating multiple fields, you can use validation link on the field definition.  This will let you write your custom rule.  The difference is that this rule is evaluated on the server side so user will only be notified when clicking save.

    For example, here is the same rule written with server side validation:

    if ( {!CurrencyField#value} > 10000 || {!CurrencyField#value} < 5000 )
    return "Currency field needs a value between 5000 and 10000";

    Which will result in this message in UI:

    See http://documentation.progress.com/output/rb/doc/#page/rb%2Ffield-validation.html for details

    3) You can write custom javascript to execute client side that would implement all your rules.

    Thierry.

  • Just to clarify a few points - I need a low cost solution so Corticon is discounted.

    As for your suggestion Thiery, I should clarify that

    1. The data will need tio be enetred without validation into the database

    2. Once enetreed, we run the rules to then see how close the enetred case is to matching the 100-2000 rule set.

    3. The messages need to be stored so we have an audit and can present them for viewing to the case officer.

    Hope this makes sense and value further options and opinions.

    Rob

  • Rob,

    Well, then a server side trigger (on update any field) could be used to run the set of rules.  Rules could easily be written in JavaScript.  You would use server side API to create a message object.

    Thierry.