[
https://issues.apache.org/jira/browse/OFBIZ-3847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15281293#comment-15281293 ]
Gareth Carter commented on OFBIZ-3847:
--------------------------------------
Hi Paul
Thanks for the quick response!
My guess is the field (availableToPromiseDiff in InventoryItemDetail example) is available in the value parameter but the field value is null.
InventoryItemDetail is a bad example here but we had to remove some records because of invalid data. We could not do this via webtools but could using pgadmin.
As for a fix, all I can think of is either check for null on oldValue or don't run the check on remove operation. This will eliminate NPE and setLastInventoryCount would not run though I am not sure if this would be correct behaviour if availableToPromiseDiff = null?
> Entity ECAs not triggered correctly when using Delegator.storeAll() method
> --------------------------------------------------------------------------
>
> Key: OFBIZ-3847
> URL:
https://issues.apache.org/jira/browse/OFBIZ-3847> Project: OFBiz
> Issue Type: Bug
> Components: framework
> Affects Versions: Release Branch 10.04
> Reporter: Martin Kreidenweis
> Assignee: Paul Foxworthy
> Fix For: Upcoming Branch
>
> Attachments: GenericDelegator.java.diff, OFBIZ-3847_Entity-ECAs-not-triggered-correctly.patch, OFBIZ-3847_Entity-ECAs-not-triggered-correctly.patch
>
>
> The conditions don't work when updating (not creating) entities using the Delegator.storeAll() method. E.g. the following condition does not work:
> {code}
> <eca entity="Product" operation="create-store" event="return">
> <condition field-name="autoCreateKeywords" operator="not-equals" value="N"/>
> <action service="indexProductKeywords" mode="sync" value-attr="productInstance"/>
> </eca>
> {code}
> The indexProductKeywords service is called anyway when the product is updated and the autoCreateKeywords was "N" and stays "N". It works correctly for newly created products.
> The problem is in the method GenericDelegator.storeAll(), where unchanged field values are not passed down to the store() method. The store method calls the ECA engine, which does not receive the unchanged values at all and thus cannot evaluate the EECA conditions correctly.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)