You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by ChoeJenSing <je...@b2b.com.my> on 2013/09/05 06:16:57 UTC

Is that a way to pass context variable into ECA

Hi,

i would like to create a SECA that are triggered when 
service=createProduct committed
it will trigger addPartyToProduct

and the service required two mandatory field
partyId and roleTypeId

i would like to know how do i pass in the value of these two fields into 
context.
and then retrieve the value into secas.xml, where upon i defined the ECA

<eca service="createProduct" event="commit">
         <set field-name="partyId" env-name="${userLogin.partyId}"/>
         <set field-name="roleTypeId" value="MANUFACTURER"/>
         <action service="addPartyToProduct" mode="sync"/>
</eca>

I had done some debug.
The context variable that are variable during ECA
is found in

trunk = ServiceDispatcher.java [340]
context = checkAuth(localName, context, modelService);

and at line [460]
ecaContext = FastMap.newInstance();

Thank you
Regards,
Jen Sing


Disclaimer : This E-mail is intended only for the use of the individual or entity named above and may contain information that is confidential. If you are not the intended recipients, please immediately notify us by return email and delete it from your system. Any unauthorised dissemination, distribution or copying of this email is strictly prohibited. Thank You.



Re: Is that a way to pass context variable into ECA

Posted by Jacques Le Roux <ja...@les7arts.com>.
You need to use result-to-context="true"

Jacques

ChoeJenSing wrote:
> Hi,
> 
> i would like to create a SECA that are triggered when
> service=createProduct committed
> it will trigger addPartyToProduct
> 
> and the service required two mandatory field
> partyId and roleTypeId
> 
> i would like to know how do i pass in the value of these two fields into
> context.
> and then retrieve the value into secas.xml, where upon i defined the ECA
> 
> <eca service="createProduct" event="commit">
>         <set field-name="partyId" env-name="${userLogin.partyId}"/>
>         <set field-name="roleTypeId" value="MANUFACTURER"/>
>         <action service="addPartyToProduct" mode="sync"/>
> </eca>
> 
> I had done some debug.
> The context variable that are variable during ECA
> is found in
> 
> trunk = ServiceDispatcher.java [340]
> context = checkAuth(localName, context, modelService);
> 
> and at line [460]
> ecaContext = FastMap.newInstance();
> 
> Thank you
> Regards,
> Jen Sing
> 
> 
> Disclaimer : This E-mail is intended only for the use of the individual or entity named above and may contain information that is
> confidential. If you are not the intended recipients, please immediately notify us by return email and delete it from your
> system. Any unauthorised dissemination, distribution or copying of this email is strictly prohibited. Thank You.