Hello Suraj,
Currently I see no possibility to override an eca because definitions
are all loaded and we can have exactly two identical definition with
different action. In this case difficult to spot the eca to disable/improve.
So before try to override an eca I suggest to implement an
identification like :
<eca entity="FinAccountTrans" operation="create-store" event="return"
package="org.apache.ofbiz.accounting"
id="FinAccountTransBalanceUpdate">
<condition field-name="statusId" operator="equals"
value="FINACT_TRNS_APPROVED"/>
<action service="updateFinAccountBalancesFromTrans" mode="sync"/>
</eca>
and after we would implement a new element as flying idea :
<extend-eca package="org.apache.ofbiz.accounting"
id="FinAccountTransBalanceUpdate">
<add>
<condition field-name="finAccountTrans" operator="contians"
value="LOVE"/>
</add>
</extend-eca>
or
<extend-eca package="org.apache.ofbiz.accounting"
id="FinAccountTransBalanceUpdate"><disable/></extend-eca>
or
<extend-eca package="org.apache.ofbiz.accounting"
id="FinAccountTransBalanceUpdate">
<replace>
<condition field-name="finAccountTrans" operator="contians"
value="LOVE"/>
<action service="updateFinAccountLove" mode="sync"/>
<replace/>
</extend-eca>
Nicolas
On 09/02/2018 14:01, Suraj Khurana wrote:
Hello,
What is the best way to override entity eca definition?
Suppose you need to add a condition-service as well in eca, as far as I can
check, currently, there is no way to handle condition service in eca rule.
IMO, this could be interesting to have this thing, is it intentional that
we do this only for seca rules and not for eca's?
Please share your thoughts on this.
--
Thanks and Regards,
*Suraj Khurana* | Omnichannel OMS Technical Expert
*HotWax Commerce* by *HotWax Systems*
Plot no. 80, Scheme no. 78, Vijay Nagar, Indore, M.P. India 452010