[
https://issues.apache.org/jira/browse/OFBIZ-3847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15281304#comment-15281304
]
Paul Foxworthy commented on OFBIZ-3847:
---------------------------------------
Hi Gareth,
I haven't tried to duplicate this yet, but on the line where I thought you
suggested the NPE occurs, the value.getPrimaryKey() is the only thing I can see
that might go wrong - thus my suggestion that value itself might be null. Does
that make sense to you?
I think that in principle, it ought to be possible to do an ECA check on
remove, much like a delete trigger in a relational database.
The normal way to adjust the availableToPromise for an InventoryItem would be
to *create* an InventoryItemDetail. IID is like a delta in a version control
system - it keeps a history of what changed. Why do you need to remove an IID?
Regards
Paul
> 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)