Closed migzzi closed 8 months ago
@CacheControl I need your review on this if you got some time.
i think this feature is out of the scope of rule engine. it is nice to have.... but it will break the pure rule engine concept. pipes will move as to the STATE MACHINE zone
re-opening for visibility and to hear more opinions on this feature; I can see it being valuable for certain situations.
@CacheControl my thought on this is that we could make the Condition
constructor pluggable, so that it's easy to drop in custom condition classes. Additionally a way to plug in custom Almanacs
could fill this role.
Over all what I think we should focus on for improvements is less new features and more ways to plug in new features by providing points at which other code can step in.
@CacheControl see #356 for part of the work to support something like this. The ability to plug in custom condition classes in order to add arbitrary logic. In this case the support for pipes would need to live in the condition.
in my work place we was need to add some changes in the source code in order to get data on array conditions - to know the index inside the array that fail the condition check. so we pass and expose the "this" of the inner rule object .. so it is needed for better data type "Array" results.
Add support for pipes to manipulate fact values.
Here is an example of using a pipe to transform the balance currency from euros to USD and another one for applying a discount to the product.