Skip to Content

Do you hardcode values into business rules?

I'm trying to break into the BRFplus space but I feel that my ABAP experience might steer me into a wrong implementation pattern.

We try not to hardcode any values when implementing a business logic in ABAP, rather we code something like a function and populate inputs of the function with transactional and configuration values, where the configuration values can come from standard or custom tables. The function then produce an output.

Would this approach also apply when a business rule (a function) is implemented with BRFplus? Should a rule hold hardcoded values like material or customer number?

I did some reading and found A Business Rules Engine should not replace Z-Tables… blog but Glen is addressing different point, BRFplus should not be used only as a container for rule data but it needs to contain a rule definition.

Does it make sense to use custom configuration table in a business rule? Is this a common scenario?

I would love to hear form anyone but would appreciate if Tobias Trapp, Carsten Ziegler, Christian Lechner could share their experience.

Thanks for your feedback,
Lukas

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Feb 18 at 06:09 PM

    Hi Lukas,

    you will have to have these "hardcoded" values in BRFplus as BRFplus comprises business configuration i.e. business rules. However, there are certainly some things you want to avoid:

    • Hardcoding all over the place: If you have a fixed value that you want to use in BRFplus I would go for a constant expression to hold it and use the expression in the rules and expressions. This way you can give it a reasonable name and can change it in one place
    • Mixing responsibilities: probably there are some values that you want to compare against that origin from customizing in your system. Do not try to duplicate the customizing in BRFplus but hand over the values from outside (as context parameters) or fetch them from the backend via a procedure call

    Hope that helps

    Best regards,

    Christian

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 18 at 07:22 AM

    Do your values form part of the rule or part of the data?

    I read "populate inputs of the function with transactional and configuration values", and don't agree with the second part. To me configuration is part of the rule, otherwise what's the point in using BRFplus?

    There are of course exceptions. But in principle if it's business relevant and/or relevant for those maintaining the rule then it should be there.

    Add comment
    10|10000 characters needed characters exceeded