- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
现在,在我的 drools 项目中,我在单独的 DRL 文件中有两组规则,它们按议程组划分。对于议程组“preCheck”,我将该议程组中的每条规则的自动焦点设置为 true。示例:
rule "preCheckDuplicate"
agenda-group "preCheck"
auto-focus true
no-loop true
salience 50
when
$f : IngestFileMetadata(isDuplicate.equalsIgnoreCase("True"))
then
$f.setIsDuplicate("True");
end
对于其他议程组 - “defaultRules” - 规则没有设置自动焦点属性。示例:
rule "duplicate file default"
agenda-group "defaultRules"
activation-group "isDuplicate"
no-loop true
salience 0
when
$f : IngestFileMetadata(isDuplicate.equals("True"))
then
insert(createResponse($f));
end
通过其余 API 调用规则时,我还尝试通过 JSON 有效负载将焦点设置到“preCheck”议程组。示例:
{
"lookup": "defaultStatelessKieSession",
"set-focus": "preCheck",
"commands": [
{
"insert": {
"out-identifier": "IngestFileMetadata",
"return-object": "true",
"entry-point": "DEFAULT",
"object": {
"com.hms.ingestion.rules.IngestFileMetadata": {
* * * * * data attributes here * * * * *
}
}
}
},
{
"fire-all-rules": {"out-identifier": "fired"}
},
{
"query": {"name": "rulesResponses", "out-identifier": "rulesResponses"}
}
]
}
但是,当执行规则时,似乎首先评估“defaultRules”议程组中的规则。我不知道为什么。我对流口水还比较陌生,所以我完全有可能没有正确理解议程组的概念,但我确信这种设计将确保首先评估“预检查”规则。
任何人都可以提供任何关于为什么这种情况没有发生的见解吗?如果我需要提供更多详细信息,我可以。
提前致谢。
最佳答案
Agenda groups allow you to place rules into groups, and to place those groups onto a stack. The stack has push/pop behavior. Before going into how to use agenda group firstly, I want to say that configuring agenda group is depends on what type of
KieSession
you are using in your rule engine. For stateful Session, you can directly configure it by callingksession.getAgenda().getAgendaGroup( "preCheck" ).setFocus();
. For Stateless Session, you have to declare an explicit rule to set the focus of the session to the particularAgenda
. You can use the below rule to set agenda inStateless Session
:
rule "global"
salience 100
when
$f : IngestFileMetadata()
then
drools.setFocus($f.getAgenda());
end
Note : You have to find some way to get the agenda variable in your rule file. In the above example, getAgenda() is a method in your IngestFileMetadata class and it returns agenda value of String type
关于java - 议程组在 Drools 中未按预期工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49515918/
我有一个包含用户及其每周日历的 mysql 表。 每个用户都可以设置自己一周的空闲时间(早上、下午、晚上/周一到周六),并且不会经常更改,几乎永远不会更改。 想象一下,这些用户是健身房的私有(priv
我无法动态更改选定的日期。例如,我想在离开屏幕时将选定的日期更改为今天;我不想在今天以外的其他日期离开...我该怎么做?我正在使用议程。另外,我想在用户单击该屏幕中的某个按钮时更改选定的日期。如果我只
如何添加操作监听器,以便在单击议程上的约会时打开一个新窗口,其中包含有关该特定单击约会的更多详细信息。 最佳答案 Agenda 似乎没有相应的 api。您可以看到议程的来源:AbstractAppoi
我在使用带有议程 View 的全日历时遇到了一些问题。在周 View 中,网格内没有垂直边框,如您在这张图片中所见: http://cjoint.com/14av/DDlkmc7Kjgp.htm在基本
议程/cron 支持这种情况的重复吗?示例:在周一和周二每两周重复一次工作,我可以每两周重复一次工作,但不能在特定日期重复一次工作,如果是,时间间隔的表达式是什么。周和日都可以是动态的。谢谢 最佳答案
我想在每天 8:30 到 17:00 的日程 View 中只显示营业时间, 像下面这样: 最佳答案 您是在问如何隐藏营业时间以外的时间吗?如果是这样,请使用 minTime 和 maxTime 选项:
从议程 View 中,我想按一个键并从该 TODO 条目中删除 SCHEDULED: 行。 最佳答案 按 C-u C-c C-s 要重建议程缓冲区,请按 r 请参阅 The manual 中的议程命
使用 Agenda ,是否可以设置作业在失败后多次重试? 最佳答案 不直接支持重试作为选项,但通过将失败的作业 nextRunAt 设置为 future 时间,它有一个简单的解决方法。 引用这篇文章:
我已将 FullCalendar 版本从 v. 2.3.1 更新到 2.4.0,之前一切正常,但现在在 周 View 和 议程 View 中 我无法添加该事件。这件事很奇怪,因为在月 View 中我看
我希望 Org-mode 议程在我打开 Emacs 时自动显示我今天必须做的事情。 org-agenda 命令是交互式的,因此它似乎不适用于此目的。 有没有办法在 Emacs 启动时显示 Org-mo
最近,我开始使用来自以下 repo 的日历控件:https://github.com/wix/react-native-calendars最初日历控件正确对齐所有项目,但似乎有些东西完全破坏了对齐。
我通过表单从用户那里收集了 Activity 日期、标题、地点、参加者、开始和结束时间、位置和其他元数据,然后存储在 mysql 数据库表中。我想从数据库中检索事件并以 Google 日历样式列出它们
我正在使用来自 http://jfxtras.org/ 的 FXtras(版本 8.0-r5)议程,我在其中定义了两种类型的约会:个人(group1)和共享(group2)。用户可以编辑个人约会的时间
我想安排这样的任务: 安排 11 月 1 日开始的任务 之后每个月重复该任务 我不想在任务安排在 11 月 1 日才开始的那一刻运行它。 我正在使用 Agenda.js我需要确保我正确地执行了此操作,
我尝试使用以下 CSS 隐藏 kendo 调度程序议程 View 中的时间列。 .k-scheduler-timecolumn{ visibility:collapse !important;
我是一名优秀的程序员,十分优秀!