[jboss-jira] [JBoss JIRA] (DROOLS-1168) notify property change
Mario Fusco (JIRA)
issues at jboss.org
Wed May 18 08:49:00 EDT 2016
[ https://issues.jboss.org/browse/DROOLS-1168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mario Fusco resolved DROOLS-1168.
---------------------------------
Resolution: Rejected
Said that the modify statement is the preferred syntax to notify Drools of a change in a fact, when you write:
{code}
$entity.setUntMisVen($entity.getUntMisVen());
update($entity)
{code}
Drools compiler is still able to infer the name of the changed property and calculate the modification bitmask accordingly. Conversely when you write:
{code}
DroolsUtil.completeEntity($entity, fields, $untMis);
update($entity)
{code}
of course the method completeEntity() is totally opaque to Drools, so it is impossible to set that bitmask.
I'm afraid that property reactivity doesn't fit your use case so my suggestion is to avoid using it there. As an (ugly) workaround you could try to do the following:
{code}
DroolsUtil.completeEntity($entity, fields, $untMis);
$entity.setUntMisVen($entity.getUntMisVen());
update($entity)
{code}
where the setUntMisVen() won't have any practical effect on the $entity (the value is modified by the completeEntity() method) but will allow Drools to infer the correct bitmask.
> notify property change
> ----------------------
>
> Key: DROOLS-1168
> URL: https://issues.jboss.org/browse/DROOLS-1168
> Project: Drools
> Issue Type: Enhancement
> Components: core engine
> Affects Versions: 6.4.0.Final
> Environment: java 6, eclipse 4, windows 8.1
> Reporter: Sante Stanisci
> Assignee: Mario Fusco
> Priority: Critical
> Attachments: DroolsUtil.java, EntityBase.java, MtbLisvData.java, rules.drl
>
>
> in the then statement instead of modify use a custom function to change the field. This change does not notify the property even if the class is annotated with @PropertyReactive
> How can I manually notify the change?
> Use a stateless session
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list