Call a rule by his name (text)

I need to create a rule containing other rules and execute them based on input.

To make it generic and durable, the intention is to never have to modify the upper rule and only create the new rules that arise according to the needs.

Perhaps now the list of possible rules to execute is 10 and every month one more rule should be added for example.

My question is if there is any way to print all the calls to the "internal" rules in my superior rule? As for example having a table in DB with a column that contains the name of the rules, print that column in my general rule so that when I add in the table a row with a new name of a rule, it can be called from the general rule.

I have seen the possibility of using the doforeach function, but it is deprecated.

Do you know of any similar current functionality or can you think of a way to attack this problem?

Thank you very much

  Discussion posts and replies are publicly visible

Parents
  • Maybe I didn't explain well.


    I copy here the development that achieves my objective.

    a!localVariables(

      local!rulesArray: rule!getRulesFromDB(),


      {
        a!forEach(
          items: local!rulesArray,
          expresion: if(
            contains(ri!conditions, fv!item),
            doforeach(fv!item,{ri!inputs}),
            null)
        )
      }
    )

    doforeach function is deprecated, can you think of alternatives? THANK YOU!!


    In DB I have the names of the rules that I want to execute and when new rules appear to cover new needs, their names are added to that DB table.

Reply
  • Maybe I didn't explain well.


    I copy here the development that achieves my objective.

    a!localVariables(

      local!rulesArray: rule!getRulesFromDB(),


      {
        a!forEach(
          items: local!rulesArray,
          expresion: if(
            contains(ri!conditions, fv!item),
            doforeach(fv!item,{ri!inputs}),
            null)
        )
      }
    )

    doforeach function is deprecated, can you think of alternatives? THANK YOU!!


    In DB I have the names of the rules that I want to execute and when new rules appear to cover new needs, their names are added to that DB table.

Children
No Data