attribute of a action service

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

attribute of a action service

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

Re: attribute of a action service

Jacques Le Roux
Administrator
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" <[hidden email]>

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


Reply | Threaded
Open this post in threaded view
|

Re: attribute of a action service

Parimal Gain
In reply to this post by zhiyongcui
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 .
>  

Reply | Threaded
Open this post in threaded view
|

Re: attribute of a action service

Jacques Le Roux
Administrator
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" <[hidden email]>

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


Reply | Threaded
Open this post in threaded view
|

Re: attribute of a action service

Parimal Gain
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" <[hidden email]>
>> 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 .
>>>
>>
>>
>
>