Thank Fancisco & Suraj Khurana,

I changed it to your recommondation.

Best regards,
ingo

-----Ursprüngliche Nachricht-----
Von: Blurbiness multimedia <[email protected]> 
Gesendet: Mittwoch, 3. Juli 2019 13:04
An: [email protected]
Betreff: Fwd: Get values from entity not commited.

Dear Ingo,

The "storeOrder" service is implemented in 
org.apache.ofbiz.order.order.OrderServices.java#createOrder. Many related 
entities may be created as part of the execution of this service.
Perhaps you may rethink your strategy, depending on your specific needs:

(A) Instead of implementing an EECA for OrderPaymentPreference, try to 
implement a service ECA for "storeOrder" service. Pay atenttion to the "event" 
attribute in the eca tag, depending on your needs, you may need to use one of 
the less common events.

(B) Remember that you could override an OOTB service definition in your own 
custom module. Then, you could call the OOTB service method and after the call, 
to add additional logic.

Hope this might help.

Regards,

Francisco

*Blurbiness multimedia*

*www.blurbiness.com* <http://www.blurbiness.com>



El mié., 3 jul. 2019 a las 12:31, Ingo Wolfmayr (<[email protected]>)
escribió:

> Dear Francisco,
>
>
>
> the problem is, that I need to trigger the service on 
> "OrderPaymentPreference". I already use the "value-attr" to get the 
> OrderPaymentPreference entity. But I need the OrderHeader.
>
>
>
> Thanks,
>
> Ingo
>
>
>
>
>
> *Von:* Blurbiness multimedia <[email protected]>
> *Gesendet:* Mittwoch, 3. Juli 2019 12:24
> *An:* Ingo Wolfmayr <[email protected]>
> *Betreff:* Re: Get values from entity not commited.
>
>
>
> Dear Ingo,
>
>
>
> When you define an Entity ECA (EECA), you can add the value-attr 
> attribute in the action tag. Then, you will receive a IN parameter in 
> your service with the new values for the entity. For example:
>
>
>
> ```
>
> <eca entity="MyEntity" operation="create" event="run">
>       <action service="myServuce" mode="sync" value-attr="newValue"
> abort-on-error="true" rollback-on-error="true"/> </eca>
>
> ```
>
>
>
> This way, "myService" will receive an IN parameter called "newValue" 
> which will be a GenericValue with the new field values for MyEntity 
> entity instance.
>
>
>
> Regards,
>
>
>
> Francisco
>
>
>
> *Blurbiness multimedia*
>
> *www.blurbiness.com* <http://www.blurbiness.com>
>
>
>
> El mié., 3 jul. 2019 a las 11:54, Ingo Wolfmayr 
> (<[email protected]>)
> escribió:
>
> Hi everybody,
>
> I have a question regarding services :
>
> I hava a "eecas" that a service after a new OrderPaymentPreference has 
> been created/stored.
>
> Within this service I would need some fields from OrderHeader entity.
> Unfortunately at this this point the entity entry is not commited and 
> therefore I cannot query it. Is there a way to get those values. The 
> service "storeOrder" is the service that initiates everything.
>
> I would appreciate every hint.
>
> Thanks,
> Ingo
>
>
>
> --
>
>
>


-- 



--
Atentamente,

El equipo de Blurbiness



*Blurbiness*
Producción multimedia para su negocio
*www.blurbiness.com* <http://www.blurbiness.com>

[email protected]
Tel. +(34) 984 49 13 52

C/ San Guillermo, 8, bajo
33210 Gijón (Asturias)
España

Reply via email to