You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by zhiyongcui <zh...@gmail.com> on 2009/12/06 05:13:46 UTC

attribute of a action service

I am wondering how to set the attributes of a eca's action service ?for
example, I defined a service named service1 which has two attributes named
attribute1 and attribute2. and this service as a action service of a seca
service as below:
       <service name="service1" engine="">
          <attribute name="attribute1" optional="false"/>
          <attribute name="attribute2" optional="false"/>
       </service>
       <eca service="createPartyGroup" event="commit">
        	<condition operator="is-not-empty" field-name="partyId"/>
        	<action mode="sync" service="service1"></action>
        </eca>
 How to set the value of service1 When I use the service createPartyGroup .
-- 
View this message in context: http://n4.nabble.com/attribute-of-a-action-service-tp949513p949513.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: attribute of a action service

Posted by Parimal Gain <pa...@hotwaxmedia.com>.
Thanks Jacques  :-)

Regards
--
Parimal Gain

Jacques Le Roux wrote:
> Thanks Parimal!
>
> This question comes from time to time. I have added a word about using 
> set in ECA section at http://cwiki.apache.org/confluence/x/M4Br. I 
> have also formatted a bit and fixed a link.
>
> This also answer to  http://markmail.org/message/grj4lqpocrjandir
>
> Jacques
> ()  ascii ribbon campaign against HTML e-mail
> /\  www.asciiribbon.org
>
> From: "Parimal Gain" <pa...@hotwaxmedia.com>
>> Hi zhiyongcui,
>>
>> You can use <set .. tag to solve your purpose. Take a look on this
>> example -
>>
>> <eca service="setCustRequestStatus" event="commit">
>>        <condition field-name="oldStatusId" operator="not-equals"
>> value="CRQ_COMPLETED"/>
>>        <condition field-name="statusId" operator="equals"
>> value="CRQ_COMPLETED"/>
>>        <set field-name="bodyParameters.custRequestId"
>> env-name="custRequestId"/>
>>        *<set field-name="partyIdTo" env-name="fromPartyId"/>
>>       <set field-name="emailTemplateSettingId"
>> value="CUST_REQ_COMPLETED"/>*
>>        <action service="sendMailFromTemplateSetting" mode="sync"/>
>>    </eca>
>>
>> and
>>
>> <service name="sendMailFromTemplateSetting" engine="simple"
>>        <implements service="sendMailInterface"/>
>>        *<attribute name="emailTemplateSettingId" type="String"
>> mode="IN" optional="false"/>*
>>        *<attribute name="partyIdTo" type="String" mode="IN"
>> optional="true"/>*
>>        -
>>        -
>>        -
>>    </service>
>>
>> Or attribute of  "service1" will take value from "createPartyGroup".
>>
>>
>> Regards
>> -- 
>> Parimal Gain
>>
>>
>> zhiyongcui wrote:
>>> I am wondering how to set the attributes of a eca's action service ?for
>>> example, I defined a service named service1 which has two attributes 
>>> named
>>> attribute1 and attribute2. and this service as a action service of a 
>>> seca
>>> service as below:
>>>        <service name="service1" engine="">
>>>           <attribute name="attribute1" optional="false"/>
>>>           <attribute name="attribute2" optional="false"/>
>>>        </service>
>>>        <eca service="createPartyGroup" event="commit">
>>>         <condition operator="is-not-empty" field-name="partyId"/>
>>>         <action mode="sync" service="service1"></action>
>>>         </eca>
>>>  How to set the value of service1 When I use the service 
>>> createPartyGroup .
>>>
>>
>>
>
>


Re: attribute of a action service

Posted by Jacques Le Roux <ja...@les7arts.com>.
Thanks Parimal!

This question comes from time to time. I have added a word about using set in ECA section at 
http://cwiki.apache.org/confluence/x/M4Br. I have also formatted a bit and fixed a link.

This also answer to  http://markmail.org/message/grj4lqpocrjandir

Jacques
()  ascii ribbon campaign against HTML e-mail
/\  www.asciiribbon.org

From: "Parimal Gain" <pa...@hotwaxmedia.com>
> Hi zhiyongcui,
>
> You can use <set .. tag to solve your purpose. Take a look on this
> example -
>
> <eca service="setCustRequestStatus" event="commit">
>        <condition field-name="oldStatusId" operator="not-equals"
> value="CRQ_COMPLETED"/>
>        <condition field-name="statusId" operator="equals"
> value="CRQ_COMPLETED"/>
>        <set field-name="bodyParameters.custRequestId"
> env-name="custRequestId"/>
>        *<set field-name="partyIdTo" env-name="fromPartyId"/>
>       <set field-name="emailTemplateSettingId"
> value="CUST_REQ_COMPLETED"/>*
>        <action service="sendMailFromTemplateSetting" mode="sync"/>
>    </eca>
>
> and
>
> <service name="sendMailFromTemplateSetting" engine="simple"
>        <implements service="sendMailInterface"/>
>        *<attribute name="emailTemplateSettingId" type="String"
> mode="IN" optional="false"/>*
>        *<attribute name="partyIdTo" type="String" mode="IN"
> optional="true"/>*
>        -
>        -
>        -
>    </service>
>
> Or attribute of  "service1" will take value from "createPartyGroup".
>
>
> Regards
> --
> Parimal Gain
>
>
> zhiyongcui wrote:
>> I am wondering how to set the attributes of a eca's action service ?for
>> example, I defined a service named service1 which has two attributes named
>> attribute1 and attribute2. and this service as a action service of a seca
>> service as below:
>>        <service name="service1" engine="">
>>           <attribute name="attribute1" optional="false"/>
>>           <attribute name="attribute2" optional="false"/>
>>        </service>
>>        <eca service="createPartyGroup" event="commit">
>>         <condition operator="is-not-empty" field-name="partyId"/>
>>         <action mode="sync" service="service1"></action>
>>         </eca>
>>  How to set the value of service1 When I use the service createPartyGroup .
>>
>
> 



Re: attribute of a action service

Posted by Parimal Gain <pa...@hotwaxmedia.com>.
Hi zhiyongcui,

You can use <set .. tag to solve your purpose. Take a look on this 
example -

<eca service="setCustRequestStatus" event="commit">
        <condition field-name="oldStatusId" operator="not-equals" 
value="CRQ_COMPLETED"/>
        <condition field-name="statusId" operator="equals" 
value="CRQ_COMPLETED"/>
        <set field-name="bodyParameters.custRequestId" 
env-name="custRequestId"/>
        *<set field-name="partyIdTo" env-name="fromPartyId"/>
       <set field-name="emailTemplateSettingId" 
value="CUST_REQ_COMPLETED"/>*
        <action service="sendMailFromTemplateSetting" mode="sync"/>
    </eca>

and

<service name="sendMailFromTemplateSetting" engine="simple"
        <implements service="sendMailInterface"/>
        *<attribute name="emailTemplateSettingId" type="String" 
mode="IN" optional="false"/>*
        *<attribute name="partyIdTo" type="String" mode="IN" 
optional="true"/>*
        -
        -
        -
    </service>

Or attribute of  "service1" will take value from "createPartyGroup".


Regards
--
Parimal Gain


zhiyongcui wrote:
> I am wondering how to set the attributes of a eca's action service ?for
> example, I defined a service named service1 which has two attributes named
> attribute1 and attribute2. and this service as a action service of a seca
> service as below:
>        <service name="service1" engine="">
>           <attribute name="attribute1" optional="false"/>
>           <attribute name="attribute2" optional="false"/>
>        </service>
>        <eca service="createPartyGroup" event="commit">
>         	<condition operator="is-not-empty" field-name="partyId"/>
>         	<action mode="sync" service="service1"></action>
>         </eca>
>  How to set the value of service1 When I use the service createPartyGroup .
>   


Re: attribute of a action service

Posted by Jacques Le Roux <ja...@les7arts.com>.
The service triggered by the SECA (in your case service1) can only use parameters in the trigerring service (in your case 
createPartyGroup)
See for instance http://markmail.org/message/grj4lqpocrjandir (BTW any attempts Rashko ? ;o)
And at large http://cwiki.apache.org/confluence/display/OFBTECH/Service+Engine+Guide#ServiceEngineGuide-ECAs

Jacques
()  ascii ribbon campaign against HTML e-mail
/\  www.asciiribbon.org

From: "zhiyongcui" <zh...@gmail.com>
> I am wondering how to set the attributes of a eca's action service ?for
> example, I defined a service named service1 which has two attributes named
> attribute1 and attribute2. and this service as a action service of a seca
> service as below:
>       <service name="service1" engine="">
>          <attribute name="attribute1" optional="false"/>
>          <attribute name="attribute2" optional="false"/>
>       </service>
>       <eca service="createPartyGroup" event="commit">
>        <condition operator="is-not-empty" field-name="partyId"/>
>        <action mode="sync" service="service1"></action>
>        </eca>
> How to set the value of service1 When I use the service createPartyGroup .
> -- 
> View this message in context: http://n4.nabble.com/attribute-of-a-action-service-tp949513p949513.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>