101
Views
4
Comments
Rule Engine and Calculated Fields

I am looking for a way to define business rules through UI. Later, when we apply rules it will make calculations and save in other atributes in the same entity.

Here is the scenario:-

  • There is an entity with attributes like RegCode, RegCount, RegType, Fee1, Fee2
  • Rule 1: Fee1 = RegCount * 2
  • Rule 2: Fee2 = If RegType = 'A' Then Fee2 = 100 Else Fee2 = 200

Please guide me if you have implemented something similar in OuSystems.

2023-07-31 05-30-45
Siddharth Mukherji

You can store only the required attributes in the Entity, for calculated attributes you can use aggregate's ( Query)  calculated attributes. If you want to save all required attributes in entity, then you can apply your logic for calculated attributes while  performing CREATE/UPDATE operation in your entity.

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Your solution is not a rules engine. The idea of a rules engine is you can configure the rules runtime and let the engine evaluate them to a result.

2023-03-21 09-05-05
m.irfan.azam

Using aggregates will not serve the purpose. 

Daniël Kuhlmann is right about it.




Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.