[jboss-jira] [JBoss JIRA] (DROOLS-1168) notify property change
Mario Fusco (JIRA)
issues at jboss.org
Thu May 19 03:55:00 EDT 2016
[ https://issues.jboss.org/browse/DROOLS-1168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13239792#comment-13239792 ]
Mario Fusco commented on DROOLS-1168:
-------------------------------------
Passing a random long there is clearly wrong. That long is a bitmask calculated on the basis of the modified attributes of the fact you're updating, so creating a fake bitmask is not the solution.
Said that I don't understand why you need that DroolsUtil.completeEntity() method instead of invoking the proper setters directly on $entity, in case your modifying more than a field the workaround that I suggested should still work as in:
{code}
String[] fields = new String[] {"codDiviCont", "cambioDiviCont"};
DroolsUtil.completeEntity($entity, fields, $t.get("cod_divi_contab").toString(), cambio);
$entity.setCodDiviCont($entity.getCodDiviCont());
$entity.setCambioDiviCont($entity.getCambioDiviCont());
update($entity);
{code}
If this doesn't work for you my only other suggestion is giving up using property reactivity for this use case.
> 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