You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by chris snow <ch...@gmail.com> on 2010/09/17 20:01:24 UTC

extending an eca

Is it possible to extend an eca?  For example, when an order is
completed, I would like to call another service.  There is already an
OOTB eca:

    <eca service="changeOrderItemStatus" event="commit">
        <condition field-name="statusId" operator="equals"
value="ITEM_COMPLETED"/>
        <action service="checkOrderItemStatus" mode="sync"/>
    </eca>

I can't see a way to extend this, should I just place a duplicate eca
definition in mycomponent, e.g.

    <eca service="changeOrderItemStatus" event="commit">
        <condition field-name="statusId" operator="equals"
value="ITEM_COMPLETED"/>
        <action service="checkOrderItemStatus" mode="sync"/>
        <action service="myCustomerService" mode="sync"/>
    </eca>

Will this duplicate definition override the OOTB one?

Many thanks,

Chris

Re: extending an eca

Posted by BJ Freeman <bj...@free-man.net>.
oops meant event instead of trigger


BJ Freeman sent the following on 9/17/2010 12:40 PM:
> don't believe so
> just remove the
> <action service="checkOrderItemStatus" mode="sync"/>
> from yours
> both will fire.
> Note: unless I want to change based on commit I use one of the other
> triggers that fit my service. they all effect the same transaction.
>
>
> chris snow sent the following on 9/17/2010 11:01 AM:
>> Is it possible to extend an eca? For example, when an order is
>> completed, I would like to call another service. There is already an
>> OOTB eca:
>>
>> <eca service="changeOrderItemStatus" event="commit">
>> <condition field-name="statusId" operator="equals"
>> value="ITEM_COMPLETED"/>
>> <action service="checkOrderItemStatus" mode="sync"/>
>> </eca>
>>
>> I can't see a way to extend this, should I just place a duplicate eca
>> definition in mycomponent, e.g.
>>
>> <eca service="changeOrderItemStatus" event="commit">
>> <condition field-name="statusId" operator="equals"
>> value="ITEM_COMPLETED"/>
>> <action service="checkOrderItemStatus" mode="sync"/>
>> <action service="myCustomerService" mode="sync"/>
>> </eca>
>>
>> Will this duplicate definition override the OOTB one?
>>
>> Many thanks,
>>
>> Chris
>>
>
>


Re: extending an eca

Posted by BJ Freeman <bj...@free-man.net>.
sorry about that
was thinking same service and wrote same transaction.
as far as I know you do not replace the other eca so it will be 
processed then yours will be.





chris snow sent the following on 9/17/2010 12:51 PM:
>> Note: unless I want to change based on commit I use one of the other
>> triggers that fit my service. they all effect the same transaction.
>
> Hi BJ, I don't understand your last line - can you please elaborate?
>
> I would like checkOrderItemStatus and myCustomerService to be part of
> the same transaction - i.e. both are successful or get rolled back.
>


Re: extending an eca

Posted by chris snow <ch...@gmail.com>.
> Note: unless I want to change based on commit I use one of the other
> triggers that fit my service. they all effect the same transaction.

Hi BJ, I don't understand your last line - can you please elaborate?

I would like checkOrderItemStatus and myCustomerService to be part of
the same transaction - i.e. both are successful or get rolled back.

Re: extending an eca

Posted by BJ Freeman <bj...@free-man.net>.
don't believe so
just remove the
           <action service="checkOrderItemStatus" mode="sync"/>
from yours
both will fire.
Note: unless I want to change based on commit I use one of the other 
triggers that fit my service. they all effect the same transaction.


chris snow sent the following on 9/17/2010 11:01 AM:
> Is it possible to extend an eca?  For example, when an order is
> completed, I would like to call another service.  There is already an
> OOTB eca:
>
>      <eca service="changeOrderItemStatus" event="commit">
>          <condition field-name="statusId" operator="equals"
> value="ITEM_COMPLETED"/>
>          <action service="checkOrderItemStatus" mode="sync"/>
>      </eca>
>
> I can't see a way to extend this, should I just place a duplicate eca
> definition in mycomponent, e.g.
>
>      <eca service="changeOrderItemStatus" event="commit">
>          <condition field-name="statusId" operator="equals"
> value="ITEM_COMPLETED"/>
>          <action service="checkOrderItemStatus" mode="sync"/>
>          <action service="myCustomerService" mode="sync"/>
>      </eca>
>
> Will this duplicate definition override the OOTB one?
>
> Many thanks,
>
> Chris
>