Uses of Class
cloud.opencode.base.rules.RuleContext
Packages that use RuleContext
Package
Description
OpenCode Base Rules - Lightweight Rule Engine for Java
OpenCode基础规则 - Java轻量级规则引擎
Rule Actions - Action Implementations
规则动作 - 动作实现
Rule Conditions - Condition Implementations
规则条件 - 条件实现
Decision Tables - Table-Based Rule Definition
决策表 - 基于表格的规则定义
Rule DSL - Fluent API for Rule Construction
规则DSL - 规则构建的流式API
Rule Engine - Default Implementations
规则引擎 - 默认实现
Rule Listeners - Execution Monitoring
规则监听器 - 执行监控
Rule Model - Core Model Classes for Rules
规则模型 - 规则的核心模型类
-
Uses of RuleContext in cloud.opencode.base.rules
Methods in cloud.opencode.base.rules that return RuleContextModifier and TypeMethodDescriptionAdds a fact object to the context 向上下文添加事实对象Adds a named fact object to the context 向上下文添加命名的事实对象RuleContext.clearResults()Clears all results 清除所有结果RuleContext.clearVariables()Clears all variables 清除所有变量static RuleContextOpenRules.context()Creates a new empty rule context 创建新的空规则上下文static RuleContextCreates a rule context with initial facts 使用初始事实创建规则上下文static RuleContextRuleContext.create()Creates an empty rule context 创建空的规则上下文static RuleContextCreates a context from alternating key-value pairs 从交替的键值对创建上下文static RuleContextCreates a context from a map of values 从值的Map创建上下文<T> RuleContextPuts a typed value by typed key into variables 通过类型化键将类型化值放入变量中Sets a variable value in the context 在上下文中设置变量值Sets a result value 设置结果值static RuleContextCreates a context with fact objects 使用事实对象创建上下文Methods in cloud.opencode.base.rules with parameters of type RuleContextModifier and TypeMethodDescriptionbooleanRule.evaluate(RuleContext context) Evaluates the rule condition against the given context 根据给定上下文评估规则条件voidRule.execute(RuleContext context) Executes the rule action with the given context 使用给定上下文执行规则动作RuleEngine.fire(RuleContext context) Fires all matching rules 触发所有匹配的规则RuleEngine.fire(RuleContext context, String group) Fires all matching rules in a specific group 触发特定分组中所有匹配的规则default ExecutionTraceRuleEngine.fireAndTrace(RuleContext context) Fires all matching rules and returns an execution trace 触发所有匹配规则并返回执行轨迹RuleEngine.fireFirst(RuleContext context) Fires only the first matching rule 只触发第一个匹配的规则RuleEngine.fireUntilHalt(RuleContext context) Fires rules until no more rules can fire (for inference) 触发规则直到没有更多规则可以触发(用于推理)Method parameters in cloud.opencode.base.rules with type arguments of type RuleContextModifier and TypeMethodDescriptionstatic ActionOpenRules.action(Consumer<RuleContext> consumer) Creates an action from a consumer 从消费者创建动作static ConditionOpenRules.condition(Predicate<RuleContext> predicate) Creates a condition from a predicate 从谓词创建条件 -
Uses of RuleContext in cloud.opencode.base.rules.action
Methods in cloud.opencode.base.rules.action with parameters of type RuleContextModifier and TypeMethodDescriptionvoidCompositeAction.execute(RuleContext context) voidConsumerAction.execute(RuleContext context) Method parameters in cloud.opencode.base.rules.action with type arguments of type RuleContextModifier and TypeMethodDescriptionstatic ConsumerActionConsumerAction.of(Consumer<RuleContext> consumer) Creates a consumer action from a consumer 从消费者创建消费者动作Constructor parameters in cloud.opencode.base.rules.action with type arguments of type RuleContextModifierConstructorDescriptionConsumerAction(Consumer<RuleContext> consumer) Creates a consumer action 创建消费者动作 -
Uses of RuleContext in cloud.opencode.base.rules.condition
Methods in cloud.opencode.base.rules.condition with parameters of type RuleContextModifier and TypeMethodDescriptionbooleanCompositeCondition.evaluate(RuleContext context) booleanPredicateCondition.evaluate(RuleContext context) Method parameters in cloud.opencode.base.rules.condition with type arguments of type RuleContextModifier and TypeMethodDescriptionstatic PredicateConditionPredicateCondition.of(Predicate<RuleContext> predicate) Creates a predicate condition from a predicate 从谓词创建谓词条件Constructor parameters in cloud.opencode.base.rules.condition with type arguments of type RuleContextModifierConstructorDescriptionPredicateCondition(Predicate<RuleContext> predicate) Creates a predicate condition 创建谓词条件 -
Uses of RuleContext in cloud.opencode.base.rules.decision
Methods in cloud.opencode.base.rules.decision with parameters of type RuleContextModifier and TypeMethodDescriptionDecisionTable.evaluate(RuleContext context) Evaluates the decision table against the given context 针对给定上下文评估决策表SimpleDecisionTable.evaluate(RuleContext context) -
Uses of RuleContext in cloud.opencode.base.rules.dsl
Method parameters in cloud.opencode.base.rules.dsl with type arguments of type RuleContextModifier and TypeMethodDescriptionRuleBuilder.and(Predicate<RuleContext> predicate) Adds an additional AND condition 添加额外的AND条件RuleBuilder.andThen(Consumer<RuleContext> action) Adds an additional action 添加额外的动作RuleEngineBuilder.haltWhen(Predicate<RuleContext> haltCondition) Sets a halt condition that stops rule execution when satisfied 设置停止条件,当满足时停止规则执行RuleBuilder.then(Consumer<RuleContext> action) Adds an action using a consumer 使用消费者添加动作RuleBuilder.when(Predicate<RuleContext> predicate) Adds a condition using a predicate 使用谓词添加条件 -
Uses of RuleContext in cloud.opencode.base.rules.engine
Methods in cloud.opencode.base.rules.engine with parameters of type RuleContextModifier and TypeMethodDescriptionbooleanDefaultRule.evaluate(RuleContext context) voidDefaultRule.execute(RuleContext context) DefaultRuleEngine.fire(RuleContext context) DefaultRuleEngine.fire(RuleContext context, String group) DefaultRuleEngine.fireFirst(RuleContext context) DefaultRuleEngine.fireUntilHalt(RuleContext context) Method parameters in cloud.opencode.base.rules.engine with type arguments of type RuleContextModifier and TypeMethodDescriptionvoidDefaultRuleEngine.setHaltCondition(Predicate<RuleContext> haltCondition) Sets the halt condition for the engine 设置引擎的停止条件 -
Uses of RuleContext in cloud.opencode.base.rules.listener
Methods in cloud.opencode.base.rules.listener with parameters of type RuleContextModifier and TypeMethodDescriptionvoidLoggingRuleListener.afterEvaluate(Rule rule, RuleContext context, boolean satisfied) default voidRuleListener.afterEvaluate(Rule rule, RuleContext context, boolean satisfied) Called after a rule is evaluated 在规则评估后调用voidLoggingRuleListener.afterExecute(Rule rule, RuleContext context) default voidRuleListener.afterExecute(Rule rule, RuleContext context) Called after a rule is executed successfully 在规则成功执行后调用voidLoggingRuleListener.beforeEvaluate(Rule rule, RuleContext context) default voidRuleListener.beforeEvaluate(Rule rule, RuleContext context) Called before a rule is evaluated 在规则评估前调用voidLoggingRuleListener.beforeExecute(Rule rule, RuleContext context) default voidRuleListener.beforeExecute(Rule rule, RuleContext context) Called before a rule is executed 在规则执行前调用voidLoggingRuleListener.onFailure(Rule rule, RuleContext context, Exception exception) default voidRuleListener.onFailure(Rule rule, RuleContext context, Exception exception) Called when a rule execution fails 当规则执行失败时调用voidLoggingRuleListener.onFinish(RuleContext context, int firedCount, long elapsedMillis) default voidRuleListener.onFinish(RuleContext context, int firedCount, long elapsedMillis) Called when rule engine finishes firing 当规则引擎完成触发时调用voidLoggingRuleListener.onStart(RuleContext context) default voidRuleListener.onStart(RuleContext context) Called when rule engine starts firing 当规则引擎开始触发时调用 -
Uses of RuleContext in cloud.opencode.base.rules.metric
Methods in cloud.opencode.base.rules.metric with parameters of type RuleContextModifier and TypeMethodDescriptionvoidMetricsListener.afterEvaluate(Rule rule, RuleContext context, boolean satisfied) Computes duration and records the evaluation metric 计算持续时间并记录评估指标voidMetricsListener.beforeEvaluate(Rule rule, RuleContext context) Records the start time before rule evaluation 在规则评估前记录开始时间voidMetricsListener.onFailure(Rule rule, RuleContext context, Exception exception) Records a rule failure 记录规则失败voidMetricsListener.onFinish(RuleContext context, int firedCount, long elapsedMillis) Cleans up ThreadLocal state when execution finishes 执行完成时清理ThreadLocal状态 -
Uses of RuleContext in cloud.opencode.base.rules.model
Methods in cloud.opencode.base.rules.model with parameters of type RuleContextModifier and TypeMethodDescriptionbooleanCondition.evaluate(RuleContext context) Evaluates this condition against the given context 针对给定上下文评估此条件voidAction.execute(RuleContext context) Executes this action with the given context 使用给定上下文执行此动作 -
Uses of RuleContext in cloud.opencode.base.rules.score
Methods in cloud.opencode.base.rules.score with parameters of type RuleContextModifier and TypeMethodDescriptionstatic ScoreResultScoringEngine.score(RuleContext context, Collection<ScoringRule> rules, AggregationStrategy strategy) Scores a collection of rules against a context using the given strategy 使用给定策略针对上下文对一组规则进行评分doubleScoringRule.score(RuleContext context) Computes the score for this rule in the given context 在给定上下文中计算此规则的分数 -
Uses of RuleContext in cloud.opencode.base.rules.trace
Methods in cloud.opencode.base.rules.trace with parameters of type RuleContextModifier and TypeMethodDescriptionvoidTracingRuleListener.afterEvaluate(Rule rule, RuleContext context, boolean satisfied) voidTracingRuleListener.afterExecute(Rule rule, RuleContext context) voidTracingRuleListener.beforeEvaluate(Rule rule, RuleContext context) voidTracingRuleListener.onFailure(Rule rule, RuleContext context, Exception exception) voidTracingRuleListener.onFinish(RuleContext context, int firedCount, long elapsedMillis) voidTracingRuleListener.onStart(RuleContext context)