[JBoss JIRA] (DROOLS-2383) Heartbeat example seems broken
by Michael Anstis (JIRA)
[ https://issues.jboss.org/browse/DROOLS-2383?page=com.atlassian.jira.plugi... ]
Michael Anstis updated DROOLS-2383:
-----------------------------------
Component/s: (was: Examples (Workbench))
> Heartbeat example seems broken
> ------------------------------
>
> Key: DROOLS-2383
> URL: https://issues.jboss.org/browse/DROOLS-2383
> Project: Drools
> Issue Type: Bug
> Affects Versions: 7.6.0.Final
> Reporter: Jens Reimann
> Assignee: Mario Fusco
>
> To me it looks as if the common heartbeat example is broken:
> {code}
> import foo.bar.Heartbeat
> rule "Sound the alarm"
> when
> $h: Heartbeat( ) from entry-point "MonitoringStream"
> not( Heartbeat( this != $h, this after[0s,10s] $h ) from entry-point "MonitoringStream" )
> then
> System.out.println("Sound the alarm");
> end
> {code}
> When running the rule set with:
> {code:java}
> public class Application {
> public static void main(final String[] args) {
> final KieServices ks = KieServices.Factory.get();
> final KieBaseConfiguration config = ks.newKieBaseConfiguration();
> config.setOption(EventProcessingOption.STREAM);
> final KieContainer kContainer = ks.getKieClasspathContainer();
> final KieBase kBase = kContainer.getKieBase("rules");
> final KieSession kSession = kBase.newKieSession();
> kSession.getEntryPoint("MonitoringStream").insert(new Heartbeat());
> kSession.fireUntilHalt();
> }
> }
> {code}
> Results in:
> {code}
> 11:55:55.092 [main] DEBUG org.drools.compiler.kie.builder.impl.ClasspathKieProject - Found and used pom.properties /home/jreimann/Development/iot-kura-develop-oxygen/ws/drools-test-1/target/classes/META-INF/maven/de.dentrassi.test/drools-test-1/pom.properties
> 11:55:55.095 [main] DEBUG org.drools.compiler.kie.builder.impl.ClasspathKieProject - Discovered classpath module de.dentrassi.test:drools-test-1:0.0.1-SNAPSHOT
> 11:55:55.098 [main] INFO org.drools.compiler.kie.builder.impl.KieRepositoryImpl - KieModule was added: FileKieModule[releaseId=de.dentrassi.test:drools-test-1:0.0.1-SNAPSHOT,file=/home/jreimann/Development/iot-kura-develop-oxygen/ws/drools-test-1/target/classes]
> 11:55:55.820 [main] DEBUG org.drools.core.common.DefaultAgenda - State was INACTIVE is now FIRING_UNTIL_HALT
> Sound the alarm
> 11:55:55.850 [main] DEBUG org.drools.core.common.DefaultAgenda - State was FIRING_UNTIL_HALT is now INACTIVE_ON_FIRING_UNTIL_HALT
> {code}
> Which looks to me as if the alarm gets activated right away instead of 10 seconds after.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years, 3 months
[JBoss JIRA] (DROOLS-2383) Heartbeat example seems broken
by Michael Anstis (JIRA)
[ https://issues.jboss.org/browse/DROOLS-2383?page=com.atlassian.jira.plugi... ]
Michael Anstis reassigned DROOLS-2383:
--------------------------------------
Assignee: Mario Fusco (was: Michael Anstis)
> Heartbeat example seems broken
> ------------------------------
>
> Key: DROOLS-2383
> URL: https://issues.jboss.org/browse/DROOLS-2383
> Project: Drools
> Issue Type: Bug
> Components: Examples (Workbench)
> Affects Versions: 7.6.0.Final
> Reporter: Jens Reimann
> Assignee: Mario Fusco
>
> To me it looks as if the common heartbeat example is broken:
> {code}
> import foo.bar.Heartbeat
> rule "Sound the alarm"
> when
> $h: Heartbeat( ) from entry-point "MonitoringStream"
> not( Heartbeat( this != $h, this after[0s,10s] $h ) from entry-point "MonitoringStream" )
> then
> System.out.println("Sound the alarm");
> end
> {code}
> When running the rule set with:
> {code:java}
> public class Application {
> public static void main(final String[] args) {
> final KieServices ks = KieServices.Factory.get();
> final KieBaseConfiguration config = ks.newKieBaseConfiguration();
> config.setOption(EventProcessingOption.STREAM);
> final KieContainer kContainer = ks.getKieClasspathContainer();
> final KieBase kBase = kContainer.getKieBase("rules");
> final KieSession kSession = kBase.newKieSession();
> kSession.getEntryPoint("MonitoringStream").insert(new Heartbeat());
> kSession.fireUntilHalt();
> }
> }
> {code}
> Results in:
> {code}
> 11:55:55.092 [main] DEBUG org.drools.compiler.kie.builder.impl.ClasspathKieProject - Found and used pom.properties /home/jreimann/Development/iot-kura-develop-oxygen/ws/drools-test-1/target/classes/META-INF/maven/de.dentrassi.test/drools-test-1/pom.properties
> 11:55:55.095 [main] DEBUG org.drools.compiler.kie.builder.impl.ClasspathKieProject - Discovered classpath module de.dentrassi.test:drools-test-1:0.0.1-SNAPSHOT
> 11:55:55.098 [main] INFO org.drools.compiler.kie.builder.impl.KieRepositoryImpl - KieModule was added: FileKieModule[releaseId=de.dentrassi.test:drools-test-1:0.0.1-SNAPSHOT,file=/home/jreimann/Development/iot-kura-develop-oxygen/ws/drools-test-1/target/classes]
> 11:55:55.820 [main] DEBUG org.drools.core.common.DefaultAgenda - State was INACTIVE is now FIRING_UNTIL_HALT
> Sound the alarm
> 11:55:55.850 [main] DEBUG org.drools.core.common.DefaultAgenda - State was FIRING_UNTIL_HALT is now INACTIVE_ON_FIRING_UNTIL_HALT
> {code}
> Which looks to me as if the alarm gets activated right away instead of 10 seconds after.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years, 3 months
[JBoss JIRA] (DROOLS-2383) Heartbeat example seems broken
by Jens Reimann (JIRA)
Jens Reimann created DROOLS-2383:
------------------------------------
Summary: Heartbeat example seems broken
Key: DROOLS-2383
URL: https://issues.jboss.org/browse/DROOLS-2383
Project: Drools
Issue Type: Bug
Components: Examples (Workbench)
Affects Versions: 7.6.0.Final
Reporter: Jens Reimann
Assignee: Michael Anstis
To me it looks as if the common heartbeat example is broken:
{code}
import foo.bar.Heartbeat
rule "Sound the alarm"
when
$h: Heartbeat( ) from entry-point "MonitoringStream"
not( Heartbeat( this != $h, this after[0s,10s] $h ) from entry-point "MonitoringStream" )
then
System.out.println("Sound the alarm");
end
{code}
When running the rule set with:
{code:java}
public class Application {
public static void main(final String[] args) {
final KieServices ks = KieServices.Factory.get();
final KieBaseConfiguration config = ks.newKieBaseConfiguration();
config.setOption(EventProcessingOption.STREAM);
final KieContainer kContainer = ks.getKieClasspathContainer();
final KieBase kBase = kContainer.getKieBase("rules");
final KieSession kSession = kBase.newKieSession();
kSession.getEntryPoint("MonitoringStream").insert(new Heartbeat());
kSession.fireUntilHalt();
}
}
{code}
Results in:
{code}
11:55:55.092 [main] DEBUG org.drools.compiler.kie.builder.impl.ClasspathKieProject - Found and used pom.properties /home/jreimann/Development/iot-kura-develop-oxygen/ws/drools-test-1/target/classes/META-INF/maven/de.dentrassi.test/drools-test-1/pom.properties
11:55:55.095 [main] DEBUG org.drools.compiler.kie.builder.impl.ClasspathKieProject - Discovered classpath module de.dentrassi.test:drools-test-1:0.0.1-SNAPSHOT
11:55:55.098 [main] INFO org.drools.compiler.kie.builder.impl.KieRepositoryImpl - KieModule was added: FileKieModule[releaseId=de.dentrassi.test:drools-test-1:0.0.1-SNAPSHOT,file=/home/jreimann/Development/iot-kura-develop-oxygen/ws/drools-test-1/target/classes]
11:55:55.820 [main] DEBUG org.drools.core.common.DefaultAgenda - State was INACTIVE is now FIRING_UNTIL_HALT
Sound the alarm
11:55:55.850 [main] DEBUG org.drools.core.common.DefaultAgenda - State was FIRING_UNTIL_HALT is now INACTIVE_ON_FIRING_UNTIL_HALT
{code}
Which looks to me as if the alarm gets activated right away instead of 10 seconds after.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years, 3 months