extending an eca

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

extending an eca

chris snow
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
Reply | Threaded
Open this post in threaded view
|

Re: extending an eca

BJ Freeman
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
>

Reply | Threaded
Open this post in threaded view
|

Re: extending an eca

BJ Freeman
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
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: extending an eca

chris snow
In reply to this post by BJ Freeman
> 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.
Reply | Threaded
Open this post in threaded view
|

Re: extending an eca

BJ Freeman

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.
>