Ejemplo n.º 1
0
    def __init__(self, rule_config: Optional[Dict[str, Any]] = None, pack_id: str = ""):
        super().__init__()
        if rule_config is None:
            rule_config = get_schema_default_config(self.schema())

        self.id = rule_config["id"]
        self.pack_id = pack_id
        self._params = BIParams(rule_config["params"])

        # The raw configuration is kept. It is re-used by the generated BI Branches
        self._properties_config = rule_config["properties"]

        self.aggregation_function = bi_aggregation_function_registry.instantiate(
            rule_config["aggregation_function"])
        self.computation_options = BIRuleComputationOptions(rule_config["computation_options"])
        self.node_visualization = rule_config["node_visualization"]
        self._properties = BIRuleProperties(rule_config["properties"])

        self.nodes = [BINodeGenerator(x) for x in rule_config["nodes"]]
        bi_rule_id_registry.register(self)
Ejemplo n.º 2
0
 def __init__(self, action_config: Dict[str, Any]):
     super().__init__(action_config)
     self.rule_id = action_config["rule_id"]
     self.params = BIParams(action_config["params"])