Hi Bhathiya,

Normally we use *fn:concat() *for this kind of situation. Are you
experiencing any problem while using this?

On Fri, Aug 21, 2015 at 10:18 AM, Kesavan Yogarajah <[email protected]>
wrote:

> Hi
>
> You can use the following configuration.You can get the query directly
> from the property mediator rather than the payload factory mediator.
>
> <property name="UserQuery" value="Select a.name, a.age From Users a where
> name='"/>
> <property name="Username" value="newuser"/>
> <property name="Apostrophe" value="'"/>
> <property name="CompleteUserQuery"
> expression="fn:concat(get-property('UserQuery'), get-property('Username'),
> get-property('Apostrophe'))"/>
>
>
> <salesforce.query>
>     <batchSize>1</batchSize>
>     <queryString xmlns:qu="user.com
> ">{get-property('CompleteUserQuery')}</queryString>
> </salesforce.query>
>
> Thanks
>
> Kesavan Yogarajah
> Associate Software Engineer
> Mobile :+94 (0) 779 758021
> [email protected]
> WSO2, Inc.
> lean . enterprise . middleware
>
> On Fri, Aug 21, 2015 at 9:50 AM, Sriashalya Srivathsan <[email protected]>
> wrote:
>
>> Hi
>> You can try this by following
>>
>> <property expression=“//qu:user/qu:query/text()" name="queryString"/>
>>
>> <salesforce.query>
>>     <batchSize>1</batchSize>
>>     <queryString>$ctx: queryString}</queryString>
>> </salesforce.query>
>>
>>
>> Thanks.
>>
>>
>> On Fri, Aug 21, 2015 at 9:45 AM, Shakila Sivagnanarajah <[email protected]
>> > wrote:
>>
>>> Hi Bhathiya,
>>>
>>> From my knowledge, creating my query with a dynamic value using
>>> property is the best way rather setting the value for queryString
>>> directly. If we do like this, that value will be set to message context.
>>>
>>> Thank you
>>>
>>> On Fri, Aug 21, 2015 at 9:42 AM, Shakila Sivagnanarajah <
>>> [email protected]> wrote:
>>>
>>>> Hi Bhathiya,
>>>>
>>>> From my knowledge, creating my query with a dynamic value is the best
>>>> way. If we do like this, that value will be set to message context.
>>>>
>>>> Thank you
>>>>
>>>>
>>>> On Fri, Aug 21, 2015 at 5:26 AM, Bhathiya Jayasekara <[email protected]
>>>> > wrote:
>>>>
>>>>> Hi all,
>>>>>
>>>>> I want to execute $subject. I could achieved it like below, but I
>>>>> believe there must be a better way.
>>>>>
>>>>> <property name="UserQuery" value="Select a.name, a.age From Users a where 
>>>>> name='"/>
>>>>> <property name="Username" value="newuser"/>
>>>>> <property name="Apostrophe" value="'"/>
>>>>> <property name="CompleteUserQuery" 
>>>>> expression="fn:concat(get-property('UserQuery'), 
>>>>> get-property('Username'), get-property('Apostrophe'))"/>
>>>>>
>>>>>
>>>>> <payloadFactory media-type="xml">
>>>>>     <format>
>>>>>         <qu:user xmlns:qu="user.com">
>>>>>             <qu:query>$1</qu:query>
>>>>>         </qu:user>
>>>>>     </format>
>>>>>     <args>
>>>>>         <arg evaluator="xml" 
>>>>> expression="get-property('CompleteActivityQuery')"/>
>>>>>     </args>
>>>>> </payloadFactory>
>>>>>
>>>>>
>>>>> <salesforce.query>
>>>>>     <batchSize>1</batchSize>
>>>>>     <queryString 
>>>>> xmlns:qu="user.com">{//qu:user/qu:query/text()}</queryString>
>>>>> </salesforce.query>
>>>>>
>>>>>
>>>>> I'd like to know 2 things. what is the best way,
>>>>>
>>>>> 1) to create my query with a dynamic value (i.e. property)?
>>>>> 2) to set a property value to queryString?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> --
>>>>> *Bhathiya Jayasekara*
>>>>> *Senior Software Engineer,*
>>>>> *WSO2 inc., http://wso2.com <http://wso2.com>*
>>>>>
>>>>> *Phone: +94715478185 <%2B94715478185>*
>>>>> *LinkedIn: http://www.linkedin.com/in/bhathiyaj
>>>>> <http://www.linkedin.com/in/bhathiyaj>*
>>>>> *Twitter: https://twitter.com/bhathiyax
>>>>> <https://twitter.com/bhathiyax>*
>>>>> *Blog: http://movingaheadblog.blogspot.com
>>>>> <http://movingaheadblog.blogspot.com/>*
>>>>>
>>>>> _______________________________________________
>>>>> Dev mailing list
>>>>> [email protected]
>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Shakila Sivagnanarajah
>>>> Associate Software Engineer
>>>> Mobile :+94 (0) 770 760240
>>>> [email protected]
>>>>
>>>
>>>
>>>
>>> --
>>> Shakila Sivagnanarajah
>>> Associate Software Engineer
>>> Mobile :+94 (0) 770 760240
>>> [email protected]
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> [email protected]
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Regards
>> S.Sriashalya,
>> WSO2 *Inc*.
>> lean . enterprise . middleware
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>


-- 
Shakila Sivagnanarajah
Associate Software Engineer
Mobile :+94 (0) 770 760240
[email protected]
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to