[JBoss JIRA] (WFCORE-2380) JBoss CLI is not able to connect to interface secured by Elytron SASL factories with PLAIN mechanism
by Jan Kalina (JIRA)
[ https://issues.jboss.org/browse/WFCORE-2380?page=com.atlassian.jira.plugi... ]
Jan Kalina commented on WFCORE-2380:
------------------------------------
Adding configurable-sasl-server-factory necessary, or individual mechanism exceeds 8 allowed authentication attemps:
{code:xml}
<configurable-sasl-server-factory name="elytronConfigurableSasl" sasl-server-factory="global">
<filters>
<filter>
<pattern-filter value="PLAIN"/>
</filter>
</filters>
</configurable-sasl-server-factory>
{code}
Only considerable improvement could be automatic filtering in sasl-authentication-factory by configured mechanisms - but mechanism name is optional here, so it would work only when it would be specified for all <mechanism>.
> JBoss CLI is not able to connect to interface secured by Elytron SASL factories with PLAIN mechanism
> ----------------------------------------------------------------------------------------------------
>
> Key: WFCORE-2380
> URL: https://issues.jboss.org/browse/WFCORE-2380
> Project: WildFly Core
> Issue Type: Bug
> Components: Security
> Reporter: Ondrej Lukas
> Assignee: Jan Kalina
> Priority: Blocker
>
> In case when PLAIN mechanism is used for Elytron SASL factories used by any of management-interfaces then JBoss CLI is not able to connect to the server. This issue happens with http-interface as well as native-interface. See Steps to Reproduce for more details.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
9 years, 1 month
[JBoss JIRA] (ELY-977) PLAIN mechanism does not work with WildFlyElytronProvider for AuthenticationConfiguration
by Jan Kalina (JIRA)
[ https://issues.jboss.org/browse/ELY-977?page=com.atlassian.jira.plugin.sy... ]
Jan Kalina commented on ELY-977:
--------------------------------
Adding *configurable-sasl-server-factory* necessary, or individual mechanism exceeds 8 allowed authentication attemps:
{code:xml}
<configurable-sasl-server-factory name="elytronConfigurableSasl" sasl-server-factory="global">
<filters>
<filter>
<pattern-filter value="PLAIN"/>
</filter>
</filters>
</configurable-sasl-server-factory>
{code}
Only considerable improvement could be automatic filtering in *sasl-authentication-factory* by configured mechanisms - but mechanism name is optional here, so it would work only when it would be specified for all <mechanism>.
> PLAIN mechanism does not work with WildFlyElytronProvider for AuthenticationConfiguration
> -----------------------------------------------------------------------------------------
>
> Key: ELY-977
> URL: https://issues.jboss.org/browse/ELY-977
> Project: WildFly Elytron
> Issue Type: Bug
> Affects Versions: 1.1.0.Beta25
> Reporter: Ondrej Lukas
> Assignee: Jan Kalina
> Priority: Blocker
>
> In case when WildFlyElytronProvider is set as provider for AuthenticationConfiguration then SASL PLAIN mechanism is stopped to work (see exception below). In case when WildFlyElytronProvider is removed then PLAIN mechanism works. It seems that Elytron does not implement SASL PLAIN mechanism correctly.
> Thrown Exception:
> {code}
> java.io.IOException: java.net.ConnectException: WFLYPRT0053: Could not connect to remote+http://127.0.0.1:9990. The connection failed
> at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:149)
> at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:75)
> at org.wildfly.security.elytron.SimpleClient$1.run(SimpleClient.java:67)
> at org.wildfly.common.context.Contextual.run(Contextual.java:71)
> at org.wildfly.security.elytron.SimpleClient.main(SimpleClient.java:48)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:497)
> at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: java.net.ConnectException: WFLYPRT0053: Could not connect to remote+http://127.0.0.1:9990. The connection failed
> at org.jboss.as.protocol.ProtocolConnectionUtils.connectSync(ProtocolConnectionUtils.java:119)
> at org.jboss.as.protocol.ProtocolConnectionManager$EstablishingConnection.connect(ProtocolConnectionManager.java:259)
> at org.jboss.as.protocol.ProtocolConnectionManager.connect(ProtocolConnectionManager.java:70)
> at org.jboss.as.protocol.mgmt.ManagementClientChannelStrategy$Establishing.getChannel(ManagementClientChannelStrategy.java:162)
> at org.jboss.as.controller.client.impl.RemotingModelControllerClient.getOrCreateChannel(RemotingModelControllerClient.java:135)
> at org.jboss.as.controller.client.impl.RemotingModelControllerClient$1.getChannel(RemotingModelControllerClient.java:59)
> at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:135)
> at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:110)
> at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeRequest(AbstractModelControllerClient.java:263)
> at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:168)
> at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:147)
> ... 10 more
> Caused by: java.io.IOException: JBREM000202: Abrupt close on Remoting connection 6900a112 to /127.0.0.1:9990 of endpoint "management-client" <7c9695fa>
> at org.jboss.remoting3.remote.ClientConnectionOpenListener$Authentication.handleEvent(ClientConnectionOpenListener.java:578)
> at org.jboss.remoting3.remote.ClientConnectionOpenListener$Authentication.handleEvent(ClientConnectionOpenListener.java:546)
> at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
> at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
> at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:89)
> at org.xnio.nio.WorkerThread.run(WorkerThread.java:567)
> at ...asynchronous invocation...(Unknown Source)
> at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:464)
> at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:426)
> at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:414)
> at org.jboss.as.protocol.ProtocolConnectionUtils.connect(ProtocolConnectionUtils.java:164)
> at org.jboss.as.protocol.ProtocolConnectionUtils.connectSync(ProtocolConnectionUtils.java:111)
> ... 20 more
> {code}
> We request blocker flag because this issue blocks RFE EAP7-530. PLAIN is widely used SASL mechanism.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
9 years, 1 month
[JBoss JIRA] (WFLY-8384) java.lang.ClassNotFoundException: org.wildfly.transaction.client.LocalTransactionContext from Module "org.jboss.as.webservices"
by Alessio Soldano (JIRA)
Alessio Soldano created WFLY-8384:
-------------------------------------
Summary: java.lang.ClassNotFoundException: org.wildfly.transaction.client.LocalTransactionContext from Module "org.jboss.as.webservices"
Key: WFLY-8384
URL: https://issues.jboss.org/browse/WFLY-8384
Project: WildFly
Issue Type: Task
Components: Web Services
Reporter: Alessio Soldano
Assignee: Alessio Soldano
Priority: Blocker
Fix For: 11.0.0.Alpha1
{noformat}java.lang.ClassNotFoundException: org.wildfly.transaction.client.LocalTransactionContext from [Module "org.jboss.as.webservices" from local module loader @282ba1e (finder: local module finder @13b6d03 (roots: /data/workspace/jbossws-hudson-5.2.0-SNAPSHOT/hudson-home/jobs/CXF-CORE-AS-11.0.0/workspace/jboss-as/modules,/data/workspace/jbossws-hudson-5.2.0-SNAPSHOT/hudson-home/jobs/CXF-CORE-AS-11.0.0/workspace/jboss-as/modules/system/layers/base))]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
... 65 more
{noformat}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
9 years, 1 month
[JBoss JIRA] (DROOLS-1478) Call ActivationUnMatchListener also when a rule rematches
by Geoffrey De Smet (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1478?page=com.atlassian.jira.plugi... ]
Geoffrey De Smet updated DROOLS-1478:
-------------------------------------
Description:
ActivationUnMatchListener is part of kie-internal, so its *not public API*.
*ActivationUnMatchListener is only used by OptaPlanner* (probably):
jBPM and downstream drools module don't use it:
https://github.com/search?q=org%3Akiegroup+ActivationUnMatchListener&type...
Community users probably don't use it either, because no one mentions it on StackOverflow:
https://www.google.be/search?q=%2BActivationUnMatchListener+site:stackove...
----
The current behaviour of ActivationUnMatchListener is a pain because it doesn't unmatch if a RHS fires again, causing an imbalance. OptaPlanner works around this through a hack (which fails for PLANNER-761).
For example, given this rule
{code}
global int score = 0;
rule R
when
Wine(age < 10, $age : age)
then
score += $age;
addUnmatchListener(() -> score -= $age);
end
{code}
This works for a normal match and unmatch event:
{code}
Wine w = new Wine(3);
insert(w);
fireAllRules(); => score = 7;
w.age = 50;
update(w);
fireAllRules(); => unmatch triggers => score = 0; // GOOD
{code}
So events are like this:
{code}
RHS
unmatch
{code}
However if we have a rematch:
{code}
Wine w = new Wine(3);
insert(w);
fireAllRules(); => score = 7;
w.age = 4;
update(w);
fireAllRules(); => no unmatch triggers => score = 13; // BAD Should be 6. Unmatch should have triggered.
w.age = 50;
update(w);
fireAllRules(); => unmatch triggers => score = 7; // Should be 0.
{code}
Because the events are unbalanced:
{code}
RHS
RHS
unmatch
{code}
I'd argue that anyone using the ActivationUnMatchListener would want to the have balanced events.
was:
ActivationUnMatchListener is part of kie-internal, so its *not public API*.
*ActivationUnMatchListener is only used by OptaPlanner* (probably):
jBPM and downstream drools module don't use it:
https://github.com/search?q=org%3Akiegroup+ActivationUnMatchListener&type...
Community users probably don't use it either, because no one mentions it on StackOverflow:
https://www.google.be/search?q=%2BActivationUnMatchListener+site:stackove...
----
The current behaviour of ActivationUnMatchListener is a pain because it doesn't unmatch if a RHS fires again, causing an imbalance. OptaPlanner works around this through a hack (which fails for PLANNER-761).
For example, given this rule
{code}
global int score = 0;
rule R
when
Wine(age < 10, $age : age)
then
score += $age;
addUnmatchListener(() -> score -= $age);
end
{code}
This works for a normal match and unmatch event:
{code}
Wine w = new Wine(3);
insert(w);
fireAllRules(); => score = 7;
w.age = 50;
update(w);
fireAllRules(); => unmatch triggers => score = 0; // GOOD
{code}
So events are like this:
{code}
RHS
unmatch
{code}
However if we have a rematch:
{code}
Wine w = new Wine(3);
insert(w);
fireAllRules(); => score = 7;
w.age = 4;
update(w);
fireAllRules(); => no unmatch triggers => score = 13; // BAD Should be 6. Unmatch should have triggered.
w.age = 50;
update(w);
fireAllRules(); => unmatch triggers => score = 7; // Should be 0.
{code}
Because the events are unbalanced:
{code}
RHS
RHS
unmatch
{code}
> Call ActivationUnMatchListener also when a rule rematches
> ---------------------------------------------------------
>
> Key: DROOLS-1478
> URL: https://issues.jboss.org/browse/DROOLS-1478
> Project: Drools
> Issue Type: Enhancement
> Components: core engine
> Reporter: Geoffrey De Smet
> Assignee: Mario Fusco
>
> ActivationUnMatchListener is part of kie-internal, so its *not public API*.
> *ActivationUnMatchListener is only used by OptaPlanner* (probably):
> jBPM and downstream drools module don't use it:
> https://github.com/search?q=org%3Akiegroup+ActivationUnMatchListener&type...
> Community users probably don't use it either, because no one mentions it on StackOverflow:
> https://www.google.be/search?q=%2BActivationUnMatchListener+site:stackove...
> ----
> The current behaviour of ActivationUnMatchListener is a pain because it doesn't unmatch if a RHS fires again, causing an imbalance. OptaPlanner works around this through a hack (which fails for PLANNER-761).
> For example, given this rule
> {code}
> global int score = 0;
> rule R
> when
> Wine(age < 10, $age : age)
> then
> score += $age;
> addUnmatchListener(() -> score -= $age);
> end
> {code}
> This works for a normal match and unmatch event:
> {code}
> Wine w = new Wine(3);
> insert(w);
> fireAllRules(); => score = 7;
> w.age = 50;
> update(w);
> fireAllRules(); => unmatch triggers => score = 0; // GOOD
> {code}
> So events are like this:
> {code}
> RHS
> unmatch
> {code}
> However if we have a rematch:
> {code}
> Wine w = new Wine(3);
> insert(w);
> fireAllRules(); => score = 7;
> w.age = 4;
> update(w);
> fireAllRules(); => no unmatch triggers => score = 13; // BAD Should be 6. Unmatch should have triggered.
> w.age = 50;
> update(w);
> fireAllRules(); => unmatch triggers => score = 7; // Should be 0.
> {code}
> Because the events are unbalanced:
> {code}
> RHS
> RHS
> unmatch
> {code}
> I'd argue that anyone using the ActivationUnMatchListener would want to the have balanced events.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
9 years, 1 month
[JBoss JIRA] (DROOLS-1478) Call ActivationUnMatchListener also when a rule rematches
by Geoffrey De Smet (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1478?page=com.atlassian.jira.plugi... ]
Geoffrey De Smet updated DROOLS-1478:
-------------------------------------
Description:
ActivationUnMatchListener is part of kie-internal, so its *not public API*.
*ActivationUnMatchListener is only used by OptaPlanner* (probably):
jBPM and downstream drools module don't use it:
https://github.com/search?q=org%3Akiegroup+ActivationUnMatchListener&type...
Community users probably don't use it either, because no one mentions it on StackOverflow:
https://www.google.be/search?q=%2BActivationUnMatchListener+site:stackove...
----
The current behaviour of ActivationUnMatchListener is a pain because it doesn't unmatch if a RHS fires again, causing an imbalance. OptaPlanner works around this through a hack (which fails for PLANNER-761).
For example, given this rule
{code}
global int score = 0;
rule R
when
Wine(age < 10, $age : age)
then
score += $age;
addUnmatchListener(() -> score -= $age);
end
{code}
This works for a normal match and unmatch event:
{code}
Wine w = new Wine(3);
insert(w);
fireAllRules(); => score = 7;
w.age = 50;
update(w);
fireAllRules(); => unmatch triggers => score = 0; // GOOD
{code}
So events are like this:
{code}
RHS
unmatch
{code}
However if we have a rematch:
{code}
Wine w = new Wine(3);
insert(w);
fireAllRules(); => score = 7;
w.age = 4;
update(w);
fireAllRules(); => no unmatch triggers => score = 13; // BAD Should be 6. Unmatch should have triggered.
w.age = 50;
update(w);
fireAllRules(); => unmatch triggers => score = 7; // Should be 0.
{code}
Because the events are unbalanced:
{code}
RHS
RHS
unmatch
{code}
was:
ActivationUnMatchListener is part of kie-internal, so its *not public API*.
*ActivationUnMatchListener is only used by OptaPlanner* (probably):
jBPM and downstream drools module don't use it:
https://github.com/search?q=org%3Akiegroup+ActivationUnMatchListener&type...
Community users probably don't use it either, because no one mentions it on StackOverflow:
https://www.google.be/search?q=%2BActivationUnMatchListener+site:stackove...
The current behaviour of ActivationUnMatchListener is a pain because it doesn't unmatch if a RHS fires again, causing an imbalance. OptaPlanner works around this through a hack (which fails for PLANNER-761).
For example, given this rule
{code}
global int score = 0;
rule R
when
Wine(age < 10, $age : age)
then
score += $age;
addUnmatchListener(() -> score -= $age);
end
{code}
This works for a normal match and unmatch event:
{code}
Wine w = new Wine(3);
insert(w);
fireAllRules(); => score = 7;
w.age = 50;
update(w);
fireAllRules(); => unmatch triggers => score = 0; // GOOD
{code}
So events are like this:
{code}
RHS
unmatch
{code}
However if we have a rematch:
{code}
Wine w = new Wine(3);
insert(w);
fireAllRules(); => score = 7;
w.age = 4;
update(w);
fireAllRules(); => no unmatch triggers => score = 13; // BAD Should be 6. Unmatch should have triggered.
w.age = 50;
update(w);
fireAllRules(); => unmatch triggers => score = 7; // Should be 0.
{code}
Because the events are unbalanced:
{code}
RHS
RHS
unmatch
{code}
> Call ActivationUnMatchListener also when a rule rematches
> ---------------------------------------------------------
>
> Key: DROOLS-1478
> URL: https://issues.jboss.org/browse/DROOLS-1478
> Project: Drools
> Issue Type: Enhancement
> Components: core engine
> Reporter: Geoffrey De Smet
> Assignee: Mario Fusco
>
> ActivationUnMatchListener is part of kie-internal, so its *not public API*.
> *ActivationUnMatchListener is only used by OptaPlanner* (probably):
> jBPM and downstream drools module don't use it:
> https://github.com/search?q=org%3Akiegroup+ActivationUnMatchListener&type...
> Community users probably don't use it either, because no one mentions it on StackOverflow:
> https://www.google.be/search?q=%2BActivationUnMatchListener+site:stackove...
> ----
> The current behaviour of ActivationUnMatchListener is a pain because it doesn't unmatch if a RHS fires again, causing an imbalance. OptaPlanner works around this through a hack (which fails for PLANNER-761).
> For example, given this rule
> {code}
> global int score = 0;
> rule R
> when
> Wine(age < 10, $age : age)
> then
> score += $age;
> addUnmatchListener(() -> score -= $age);
> end
> {code}
> This works for a normal match and unmatch event:
> {code}
> Wine w = new Wine(3);
> insert(w);
> fireAllRules(); => score = 7;
> w.age = 50;
> update(w);
> fireAllRules(); => unmatch triggers => score = 0; // GOOD
> {code}
> So events are like this:
> {code}
> RHS
> unmatch
> {code}
> However if we have a rematch:
> {code}
> Wine w = new Wine(3);
> insert(w);
> fireAllRules(); => score = 7;
> w.age = 4;
> update(w);
> fireAllRules(); => no unmatch triggers => score = 13; // BAD Should be 6. Unmatch should have triggered.
> w.age = 50;
> update(w);
> fireAllRules(); => unmatch triggers => score = 7; // Should be 0.
> {code}
> Because the events are unbalanced:
> {code}
> RHS
> RHS
> unmatch
> {code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
9 years, 1 month
[JBoss JIRA] (DROOLS-1478) Call ActivationUnMatchListener also when a rule rematches
by Geoffrey De Smet (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1478?page=com.atlassian.jira.plugi... ]
Geoffrey De Smet updated DROOLS-1478:
-------------------------------------
Description:
ActivationUnMatchListener is part of kie-internal, so its *not public API*.
*ActivationUnMatchListener is only used by OptaPlanner* (probably):
jBPM and downstream drools module don't use it:
https://github.com/search?q=org%3Akiegroup+ActivationUnMatchListener&type...
Community users probably don't use it either, because no one mentions it on StackOverflow:
https://www.google.be/search?q=%2BActivationUnMatchListener+site:stackove...
The current behaviour of ActivationUnMatchListener is a pain because it doesn't unmatch if a RHS fires again, causing an imbalance. OptaPlanner works around this through a hack (which fails for PLANNER-761).
For example, given this rule
{code}
global int score = 0;
rule R
when
Wine(age < 10, $age : age)
then
score += $age;
addUnmatchListener(() -> score -= $age);
end
{code}
This works for a normal match and unmatch event:
{code}
Wine w = new Wine(3);
insert(w);
fireAllRules(); => score = 7;
w.age = 50;
update(w);
fireAllRules(); => unmatch triggers => score = 0; // GOOD
{code}
So events are like this:
{code}
RHS
unmatch
{code}
However if we have a rematch:
{code}
Wine w = new Wine(3);
insert(w);
fireAllRules(); => score = 7;
w.age = 4;
update(w);
fireAllRules(); => no unmatch triggers => score = 13; // BAD should be 6!
w.age = 50;
update(w);
fireAllRules(); => unmatch triggers => score = 7; // should be 0!
{code}
Because the events are unbalanced:
{code}
RHS
RHS
unmatch
{code}
was:
ActivationUnMatchListener is part of kie-internal, so its *not public API*.
*ActivationUnMatchListener is only used by OptaPlanner* (probably):
jBPM and downstream drools module don't use it:
https://github.com/search?q=org%3Akiegroup+ActivationUnMatchListener&type...
Community users probably don't use it either, because no one mentions it on StackOverflow:
https://www.google.be/search?q=%2BActivationUnMatchListener+site:stackove...
The current behaviour of ActivationUnMatchListener is a pain because it doesn't unmatch if a RHS fires again, causing an imbalance. OptaPlanner works around this through a hack (which fails for PLANNER-761).
For example, given this rule
{code}
global int score = 0;
rule R
when
Wine(age < 10, $age : age)
then
score += $age;
addUnmatchListener(() -> score -= $age);
end
{code}
This works for a normal match and unmatch event:
{code}
Wine w = new Wine(3);
insert(w);
fireAllRules(); => score = 7;
w.age = 50;
update(w);
fireAllRules(); => unmatch triggers => score = 0; // GOOD
{code}
So events are like this:
{code}
RHS
unmatch
{code}
However if we have a rematch:
{code}
Wine w = new Wine(3);
insert(w);
fireAllRules(); => score = 7;
w.age = 4;
update(w);
fireAllRules(); => no unmatch triggers => score = 13; // should be 6!
w.age = 50;
update(w);
fireAllRules(); => unmatch triggers => score = 7; // should be 0!
{code}
Because the events are unbalanced:
{code}
RHS
RHS
unmatch
{code}
> Call ActivationUnMatchListener also when a rule rematches
> ---------------------------------------------------------
>
> Key: DROOLS-1478
> URL: https://issues.jboss.org/browse/DROOLS-1478
> Project: Drools
> Issue Type: Enhancement
> Components: core engine
> Reporter: Geoffrey De Smet
> Assignee: Mario Fusco
>
> ActivationUnMatchListener is part of kie-internal, so its *not public API*.
> *ActivationUnMatchListener is only used by OptaPlanner* (probably):
> jBPM and downstream drools module don't use it:
> https://github.com/search?q=org%3Akiegroup+ActivationUnMatchListener&type...
> Community users probably don't use it either, because no one mentions it on StackOverflow:
> https://www.google.be/search?q=%2BActivationUnMatchListener+site:stackove...
> The current behaviour of ActivationUnMatchListener is a pain because it doesn't unmatch if a RHS fires again, causing an imbalance. OptaPlanner works around this through a hack (which fails for PLANNER-761).
> For example, given this rule
> {code}
> global int score = 0;
> rule R
> when
> Wine(age < 10, $age : age)
> then
> score += $age;
> addUnmatchListener(() -> score -= $age);
> end
> {code}
> This works for a normal match and unmatch event:
> {code}
> Wine w = new Wine(3);
> insert(w);
> fireAllRules(); => score = 7;
> w.age = 50;
> update(w);
> fireAllRules(); => unmatch triggers => score = 0; // GOOD
> {code}
> So events are like this:
> {code}
> RHS
> unmatch
> {code}
> However if we have a rematch:
> {code}
> Wine w = new Wine(3);
> insert(w);
> fireAllRules(); => score = 7;
> w.age = 4;
> update(w);
> fireAllRules(); => no unmatch triggers => score = 13; // BAD should be 6!
> w.age = 50;
> update(w);
> fireAllRules(); => unmatch triggers => score = 7; // should be 0!
> {code}
> Because the events are unbalanced:
> {code}
> RHS
> RHS
> unmatch
> {code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
9 years, 1 month
[JBoss JIRA] (DROOLS-1478) Call ActivationUnMatchListener also when a rule rematches
by Geoffrey De Smet (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1478?page=com.atlassian.jira.plugi... ]
Geoffrey De Smet updated DROOLS-1478:
-------------------------------------
Description:
ActivationUnMatchListener is part of kie-internal, so its *not public API*.
*ActivationUnMatchListener is only used by OptaPlanner* (probably):
jBPM and downstream drools module don't use it:
https://github.com/search?q=org%3Akiegroup+ActivationUnMatchListener&type...
Community users probably don't use it either, because no one mentions it on StackOverflow:
https://www.google.be/search?q=%2BActivationUnMatchListener+site:stackove...
The current behaviour of ActivationUnMatchListener is a pain because it doesn't unmatch if a RHS fires again, causing an imbalance. OptaPlanner works around this through a hack (which fails for PLANNER-761).
For example, given this rule
{code}
global int score = 0;
rule R
when
Wine(age < 10, $age : age)
then
score += $age;
addUnmatchListener(() -> score -= $age);
end
{code}
This works for a normal match and unmatch event:
{code}
Wine w = new Wine(3);
insert(w);
fireAllRules(); => score = 7;
w.age = 50;
update(w);
fireAllRules(); => unmatch triggers => score = 0; // GOOD
{code}
So events are like this:
{code}
RHS
unmatch
{code}
However if we have a rematch:
{code}
Wine w = new Wine(3);
insert(w);
fireAllRules(); => score = 7;
w.age = 4;
update(w);
fireAllRules(); => no unmatch triggers => score = 13; // BAD Should be 6. Unmatch should have triggered.
w.age = 50;
update(w);
fireAllRules(); => unmatch triggers => score = 7; // Should be 0.
{code}
Because the events are unbalanced:
{code}
RHS
RHS
unmatch
{code}
was:
ActivationUnMatchListener is part of kie-internal, so its *not public API*.
*ActivationUnMatchListener is only used by OptaPlanner* (probably):
jBPM and downstream drools module don't use it:
https://github.com/search?q=org%3Akiegroup+ActivationUnMatchListener&type...
Community users probably don't use it either, because no one mentions it on StackOverflow:
https://www.google.be/search?q=%2BActivationUnMatchListener+site:stackove...
The current behaviour of ActivationUnMatchListener is a pain because it doesn't unmatch if a RHS fires again, causing an imbalance. OptaPlanner works around this through a hack (which fails for PLANNER-761).
For example, given this rule
{code}
global int score = 0;
rule R
when
Wine(age < 10, $age : age)
then
score += $age;
addUnmatchListener(() -> score -= $age);
end
{code}
This works for a normal match and unmatch event:
{code}
Wine w = new Wine(3);
insert(w);
fireAllRules(); => score = 7;
w.age = 50;
update(w);
fireAllRules(); => unmatch triggers => score = 0; // GOOD
{code}
So events are like this:
{code}
RHS
unmatch
{code}
However if we have a rematch:
{code}
Wine w = new Wine(3);
insert(w);
fireAllRules(); => score = 7;
w.age = 4;
update(w);
fireAllRules(); => no unmatch triggers => score = 13; // BAD should be 6!
w.age = 50;
update(w);
fireAllRules(); => unmatch triggers => score = 7; // should be 0!
{code}
Because the events are unbalanced:
{code}
RHS
RHS
unmatch
{code}
> Call ActivationUnMatchListener also when a rule rematches
> ---------------------------------------------------------
>
> Key: DROOLS-1478
> URL: https://issues.jboss.org/browse/DROOLS-1478
> Project: Drools
> Issue Type: Enhancement
> Components: core engine
> Reporter: Geoffrey De Smet
> Assignee: Mario Fusco
>
> ActivationUnMatchListener is part of kie-internal, so its *not public API*.
> *ActivationUnMatchListener is only used by OptaPlanner* (probably):
> jBPM and downstream drools module don't use it:
> https://github.com/search?q=org%3Akiegroup+ActivationUnMatchListener&type...
> Community users probably don't use it either, because no one mentions it on StackOverflow:
> https://www.google.be/search?q=%2BActivationUnMatchListener+site:stackove...
> The current behaviour of ActivationUnMatchListener is a pain because it doesn't unmatch if a RHS fires again, causing an imbalance. OptaPlanner works around this through a hack (which fails for PLANNER-761).
> For example, given this rule
> {code}
> global int score = 0;
> rule R
> when
> Wine(age < 10, $age : age)
> then
> score += $age;
> addUnmatchListener(() -> score -= $age);
> end
> {code}
> This works for a normal match and unmatch event:
> {code}
> Wine w = new Wine(3);
> insert(w);
> fireAllRules(); => score = 7;
> w.age = 50;
> update(w);
> fireAllRules(); => unmatch triggers => score = 0; // GOOD
> {code}
> So events are like this:
> {code}
> RHS
> unmatch
> {code}
> However if we have a rematch:
> {code}
> Wine w = new Wine(3);
> insert(w);
> fireAllRules(); => score = 7;
> w.age = 4;
> update(w);
> fireAllRules(); => no unmatch triggers => score = 13; // BAD Should be 6. Unmatch should have triggered.
> w.age = 50;
> update(w);
> fireAllRules(); => unmatch triggers => score = 7; // Should be 0.
> {code}
> Because the events are unbalanced:
> {code}
> RHS
> RHS
> unmatch
> {code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
9 years, 1 month