[JBoss JIRA] (DROOLS-897) Binding variable or condition
by Mario Fusco (JIRA)
[ https://issues.jboss.org/browse/DROOLS-897?page=com.atlassian.jira.plugin... ]
Mario Fusco edited comment on DROOLS-897 at 8/28/15 5:40 AM:
-------------------------------------------------------------
Sorry, but I think you're not understanding what I'm saying. Let me rephrase. At COMPILE TIME we generate a syntetic Java method implementing the consequence's body. In your case it should be something like this:
{code}
public void doConsequence(Drools drools, X $entity, java.util.Map $t, java.math.BigDecimal $cambio) {
$entity.setCodDiviCont($t.get("cod_divi_contab").toString());
$entity.setCambioDiviCont($cambio);
drools.update( $entity );
}
{code}
Of which type should be X in your case to make that method to work for all possible types of $entity?
was (Author: mfusco):
Sorry, but I think you're not understanding what I'm saying. Let me rephrase. At COMPILE TIME we generate a syntetic Java method implementing the consequence's body. In your case it should be something like this:
{code}
public void doConsequence(Drools drools, X $entity) {
$entity.setCodDiviCont($t.get("cod_divi_contab").toString());
$entity.setCambioDiviCont($cambio);
drools.update( $entity );
}
{code}
Of which type should be X in your case to make that method to work for all possible types of $entity?
> Binding variable or condition
> -----------------------------
>
> Key: DROOLS-897
> URL: https://issues.jboss.org/browse/DROOLS-897
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 6.2.0.Final
> Environment: Windows 8
> Reporter: Sante Stanisci
> Assignee: Mario Fusco
> Labels: dynamic, instanciation, variable
> Attachments: rule.drl, workaround.drl
>
>
> In this example I have more classes that extends EntityBase (my class). In my intention, i would assign to variable $entity one of this class that is inserted in Ksession fact.
> I insert fact of CtbMovrCoan class
> In when statement of the rule at row 16, variable $entity is correctely,
> but in then statement variable $entity becomes JtbRLavt class (first declared in then cond) and this behavior throw a ClassCastException, obviously.
> Can Help me?
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
10 years, 2 months
[JBoss JIRA] (DROOLS-897) Binding variable or condition
by Mario Fusco (JIRA)
[ https://issues.jboss.org/browse/DROOLS-897?page=com.atlassian.jira.plugin... ]
Mario Fusco commented on DROOLS-897:
------------------------------------
Sorry, but I think you're not understanding what I'm saying. Let me rephrase. At COMPILE TIME we generate a syntetic Java method implementing the consequence's body. In your case it should be something like this:
{code}
public void doConsequence(Drools drools, X $entity) {
$entity.setCodDiviCont($t.get("cod_divi_contab").toString());
$entity.setCambioDiviCont($cambio);
drools.update( $entity );
}
{code}
Of which type should be X in your case to make that method to work for all possible types of $entity?
> Binding variable or condition
> -----------------------------
>
> Key: DROOLS-897
> URL: https://issues.jboss.org/browse/DROOLS-897
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 6.2.0.Final
> Environment: Windows 8
> Reporter: Sante Stanisci
> Assignee: Mario Fusco
> Labels: dynamic, instanciation, variable
> Attachments: rule.drl, workaround.drl
>
>
> In this example I have more classes that extends EntityBase (my class). In my intention, i would assign to variable $entity one of this class that is inserted in Ksession fact.
> I insert fact of CtbMovrCoan class
> In when statement of the rule at row 16, variable $entity is correctely,
> but in then statement variable $entity becomes JtbRLavt class (first declared in then cond) and this behavior throw a ClassCastException, obviously.
> Can Help me?
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
10 years, 2 months
[JBoss JIRA] (DROOLS-897) Binding variable or condition
by Sante Stanisci (JIRA)
[ https://issues.jboss.org/browse/DROOLS-897?page=com.atlassian.jira.plugin... ]
Sante Stanisci commented on DROOLS-897:
---------------------------------------
ok, I'll take the hint.
My intention is to use only one rule for most classes that share common fields.
Drools should properly instantiate the variable $entity to the correct class.
I don't understand why in the when statement instantiation is correct and in then statement, change class.
This is a issue!? In my opinion, yes.
> Binding variable or condition
> -----------------------------
>
> Key: DROOLS-897
> URL: https://issues.jboss.org/browse/DROOLS-897
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 6.2.0.Final
> Environment: Windows 8
> Reporter: Sante Stanisci
> Assignee: Mario Fusco
> Labels: dynamic, instanciation, variable
> Attachments: rule.drl, workaround.drl
>
>
> In this example I have more classes that extends EntityBase (my class). In my intention, i would assign to variable $entity one of this class that is inserted in Ksession fact.
> I insert fact of CtbMovrCoan class
> In when statement of the rule at row 16, variable $entity is correctely,
> but in then statement variable $entity becomes JtbRLavt class (first declared in then cond) and this behavior throw a ClassCastException, obviously.
> Can Help me?
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
10 years, 2 months
[JBoss JIRA] (WFCORE-850) AuditLogBootingLogTestCase fails on Windows
by Ondrej Kotek (JIRA)
[ https://issues.jboss.org/browse/WFCORE-850?page=com.atlassian.jira.plugin... ]
Ondrej Kotek resolved WFCORE-850.
---------------------------------
Resolution: Won't Fix
Fixed by Jason Greene, it was an issue with wildfly build tools leaking file descriptors.
> AuditLogBootingLogTestCase fails on Windows
> -------------------------------------------
>
> Key: WFCORE-850
> URL: https://issues.jboss.org/browse/WFCORE-850
> Project: WildFly Core
> Issue Type: Bug
> Components: Test Suite
> Affects Versions: 2.0.0.Alpha11
> Environment: Windows server 2008
> java version "1.8.0_40"
> Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
> Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
> Reporter: Petr Kremensky
> Assignee: Ondrej Kotek
> Attachments: TEST-org.jboss.as.test.manualmode.auditlog.AuditLogBootingLogTestCase.xml
>
>
> org.jboss.as.test.manualmode.auditlog.AuditLogBootingLogTestCase starts failing on windows since 2.0.0.Alpha11 release, test passed with 2.0.0.Alpha9.
> http://jenkins.mw.lab.eng.bos.redhat.com/hudson/job/eap-7x-as-testsuite-t...
> Suspicios message in logs
> {noformat}
> Caused by: java.nio.file.FileSystemException: C:\wildfly-core\testsuite\manualmode\target\wildfly-core\standalone\configuration\standalone.xml:
> The process cannot access the file because it is being used by another process.
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
10 years, 2 months
[JBoss JIRA] (WFCORE-850) AuditLogBootingLogTestCase fails on Windows
by Ondrej Kotek (JIRA)
[ https://issues.jboss.org/browse/WFCORE-850?page=com.atlassian.jira.plugin... ]
Ondrej Kotek reassigned WFCORE-850:
-----------------------------------
Assignee: Ondrej Kotek (was: Ondrej Lukas)
> AuditLogBootingLogTestCase fails on Windows
> -------------------------------------------
>
> Key: WFCORE-850
> URL: https://issues.jboss.org/browse/WFCORE-850
> Project: WildFly Core
> Issue Type: Bug
> Components: Test Suite
> Affects Versions: 2.0.0.Alpha11
> Environment: Windows server 2008
> java version "1.8.0_40"
> Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
> Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
> Reporter: Petr Kremensky
> Assignee: Ondrej Kotek
> Attachments: TEST-org.jboss.as.test.manualmode.auditlog.AuditLogBootingLogTestCase.xml
>
>
> org.jboss.as.test.manualmode.auditlog.AuditLogBootingLogTestCase starts failing on windows since 2.0.0.Alpha11 release, test passed with 2.0.0.Alpha9.
> http://jenkins.mw.lab.eng.bos.redhat.com/hudson/job/eap-7x-as-testsuite-t...
> Suspicios message in logs
> {noformat}
> Caused by: java.nio.file.FileSystemException: C:\wildfly-core\testsuite\manualmode\target\wildfly-core\standalone\configuration\standalone.xml:
> The process cannot access the file because it is being used by another process.
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
10 years, 2 months
[JBoss JIRA] (DROOLS-897) Binding variable or condition
by Mario Fusco (JIRA)
[ https://issues.jboss.org/browse/DROOLS-897?page=com.atlassian.jira.plugin... ]
Mario Fusco commented on DROOLS-897:
------------------------------------
In this case the fix that I'm trying to develop won't fix your problem. The thing is that the consequence of a rule is in the end a syntetic Java method having as arguments all the declaration used by the consequence itself. Not having a common class of which type should be your $entity variable in the signature of the Java method implementing the consequence? Or, to rephrase the problem, how would you write a Java method that could call 'setCodDiviCont' on any of the objects of your domain not using reflection as you have been obliged to do to workaround the problem?
My suggestion is to refactor the classes in your domain model putting the common methods and data in a parent class. Does this make sense? In case this is not possible for you (you are not allowed to change the domain model) the only other suggestion I can give you is using a different rule for each of the classes in your domain.
As a side note (not related with this issue) I'm just noticing that you're calling modify twice for the same object in your consequence. This is a performance antipattern since your propagating the modification of that fact twice inside the rete network. Despite this problem is mitigated by the new phreak algorithm implemented in Drools 6.x I suggest you to put both sets in the same modify block as it follows
{code}
modify( $entity ) {
setCodDiviCont($t.get("cod_divi_contab").toString()),
setCambioDiviCont($cambio)
}
{code}
> Binding variable or condition
> -----------------------------
>
> Key: DROOLS-897
> URL: https://issues.jboss.org/browse/DROOLS-897
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 6.2.0.Final
> Environment: Windows 8
> Reporter: Sante Stanisci
> Assignee: Mario Fusco
> Labels: dynamic, instanciation, variable
> Attachments: rule.drl, workaround.drl
>
>
> In this example I have more classes that extends EntityBase (my class). In my intention, i would assign to variable $entity one of this class that is inserted in Ksession fact.
> I insert fact of CtbMovrCoan class
> In when statement of the rule at row 16, variable $entity is correctely,
> but in then statement variable $entity becomes JtbRLavt class (first declared in then cond) and this behavior throw a ClassCastException, obviously.
> Can Help me?
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
10 years, 2 months
[JBoss JIRA] (WFCORE-820) Attribute for-hosts for Security Realm with Kerberos does not select keytab in defined order
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/WFCORE-820?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration commented on WFCORE-820:
------------------------------------------------
Tomas Hofman <thofman(a)redhat.com> changed the Status of [bug 1228228|https://bugzilla.redhat.com/show_bug.cgi?id=1228228] from ASSIGNED to CLOSED
> Attribute for-hosts for Security Realm with Kerberos does not select keytab in defined order
> --------------------------------------------------------------------------------------------
>
> Key: WFCORE-820
> URL: https://issues.jboss.org/browse/WFCORE-820
> Project: WildFly Core
> Issue Type: Bug
> Components: Domain Management
> Affects Versions: 2.0.0.Alpha9
> Reporter: Tomas Hofman
> Assignee: Tomas Hofman
> Fix For: 2.0.0.Alpha11
>
>
> This was cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1228228
> Attribute for-hosts for Security realm with Kerberos does not select keytab in order which is described in $EAP_SERVER/docs/schema/jboss-as-config_1_7.xsd (begin on line 456).
> According to this XSD hostname values from for-hosts attributes (steps 1. nad 2.) are iterated before values obtained from principal (steps 3. and 4.). In case when keytab element (denote as keytab1) contains for-hosts attribute with hostname EXAMPLE and some another keytab element (denote as keytab2) contains principal HTTP/EXAMPLE(a)SOMETHING.COM then keytab2 is selected instead of keytab1. It means step 3. is performed before step 2.
> Configuration for mentioned above example:
> {code:xml}
> <server-identities>
> <kerberos>
> <keytab principal="HTTP/ANYVALUE(a)SOMETHING.COM" path="/path/to/krb1.keytab" for-hosts="EXAMPLE"/>
> <keytab principal="HTTP/EXAMPLE(a)SOMETHING.COM" path="/path/to/krb2.keytab" for-hosts="SOMEHOST"/>
> </kerberos>
> </server-identities>
> {code}
> In case when hostname in for-hosts contains also protocol (HTTP/EXAMPLE instead of EXAMPLE) then it works correctly.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
10 years, 2 months
[JBoss JIRA] (DROOLS-897) Binding variable or condition
by Sante Stanisci (JIRA)
[ https://issues.jboss.org/browse/DROOLS-897?page=com.atlassian.jira.plugin... ]
Sante Stanisci commented on DROOLS-897:
---------------------------------------
My configuration is this, for example
public static class Parent {
//other methods
//other fields
}
public static class ChildA extends Parent {
public String value;
public String getValue() {
return value;
}
public void setValue( String value ) {
this.value = value;
}
}
public static class ChildB extends Parent {
public String value;
public String getValue() {
return value;
}
public void setValue( String value ) {
this.value = value;
}
}
public static class ChildC extends Parent {
//other fields
}
public static class ChildD extends Parent {
//other fields
}
public static class ChildE extends Parent {
//other fields
}
> Binding variable or condition
> -----------------------------
>
> Key: DROOLS-897
> URL: https://issues.jboss.org/browse/DROOLS-897
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 6.2.0.Final
> Environment: Windows 8
> Reporter: Sante Stanisci
> Assignee: Mario Fusco
> Labels: dynamic, instanciation, variable
> Attachments: rule.drl, workaround.drl
>
>
> In this example I have more classes that extends EntityBase (my class). In my intention, i would assign to variable $entity one of this class that is inserted in Ksession fact.
> I insert fact of CtbMovrCoan class
> In when statement of the rule at row 16, variable $entity is correctely,
> but in then statement variable $entity becomes JtbRLavt class (first declared in then cond) and this behavior throw a ClassCastException, obviously.
> Can Help me?
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
10 years, 2 months
[JBoss JIRA] (DROOLS-897) Binding variable or condition
by Sante Stanisci (JIRA)
[ https://issues.jboss.org/browse/DROOLS-897?page=com.atlassian.jira.plugin... ]
Sante Stanisci commented on DROOLS-897:
---------------------------------------
The problem is that super class not have value field. Fields are declared on childs classes. ok?
> Binding variable or condition
> -----------------------------
>
> Key: DROOLS-897
> URL: https://issues.jboss.org/browse/DROOLS-897
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 6.2.0.Final
> Environment: Windows 8
> Reporter: Sante Stanisci
> Assignee: Mario Fusco
> Labels: dynamic, instanciation, variable
> Attachments: rule.drl, workaround.drl
>
>
> In this example I have more classes that extends EntityBase (my class). In my intention, i would assign to variable $entity one of this class that is inserted in Ksession fact.
> I insert fact of CtbMovrCoan class
> In when statement of the rule at row 16, variable $entity is correctely,
> but in then statement variable $entity becomes JtbRLavt class (first declared in then cond) and this behavior throw a ClassCastException, obviously.
> Can Help me?
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
10 years, 2 months