Hi Vivek,

I tried the following sequence with task scheduler. It works fine.








*<sequence name="MoveFileSequence">        <property
expression="//sourceLocation" name="sourceLocation"
xmlns:ns="http://org.apache.synapse/xsd <http://org.apache.synapse/xsd>"/>
      <log>            <property expression="$ctx:sourceLocation"
      name="=================================="
xmlns:ns="http://org.apache.synapse/xsd <http://org.apache.synapse/xsd>"/>
      </log>        <drop/></sequence>*
_____________________________________________________________________________________________________________________











*<task class="org.apache.synapse.startup.tasks.MessageInjector"
group="synapse.simple.quartz" name="abc">        <trigger count="5"
interval="10"/>        <property name="message"
xmlns:task="http://www.wso2.org/products/wso2commons/tasks
<http://www.wso2.org/products/wso2commons/tasks>">            <locations
xmlns="">                <sourceLocation>someValidPath</sourceLocation>
        </locations>        </property>        <property name="injectTo"
value="sequence" xmlns:task="http://www.wso2.org/products/wso2commons/tasks
<http://www.wso2.org/products/wso2commons/tasks>"/>        <property
name="sequenceName" value="MoveFileSequence"
xmlns:task="http://www.wso2.org/products/wso2commons/tasks
<http://www.wso2.org/products/wso2commons/tasks>"/></task>*

And find the wire log below

[2018-03-12 16:19:09,575] [EI-Core]  INFO - AbstractQuartzTaskManager Task
scheduled: [-1234][ESB_TASK][abc]
[2018-03-12 16:19:09,576] [EI-Core]  INFO - NTaskTaskManager Scheduled task
[NTask::-1234::abc]
[2018-03-12 16:19:09,578] [EI-Core]  INFO - LogMediator To: , MessageID:
urn:uuid:fdbc84af-1d9d-48f4-9255-31124c13db4f, Direction: request,
================================== = someValidPath
[2018-03-12 16:19:19,577] [EI-Core]  INFO - LogMediator To: , MessageID:
urn:uuid:28a6a526-d8c2-4468-9ae9-0b318b8f795e, Direction: request,
================================== = someValidPath
[2018-03-12 16:19:29,577] [EI-Core]  INFO - LogMediator To: , MessageID:
urn:uuid:0d836dfe-60e4-4f14-9a54-828b359b0058, Direction: request,
================================== = someValidPath
[2018-03-12 16:19:39,577] [EI-Core]  INFO - LogMediator To: , MessageID:
urn:uuid:1c1f1daf-00c3-464b-935a-229f7bf18b79, Direction: request,
================================== = someValidPath
[2018-03-12 16:19:49,576] [EI-Core]  INFO - LogMediator To: , MessageID:
urn:uuid:91332ea7-4084-4975-8308-9e6dcd181be3, Direction: request,
================================== = someValidPath

Please check this

Regards,
Nirthika Rajendran
Associate Software Engineer
WSO2 Inc : http://wso2.org
Mobile       : +94 77 719 8368
LinkedIn    : https://www.linkedin.com/in/nirthika/
Blog          : http://nirthika-tech-stuff.blogspot.com/


On Mon, Mar 12, 2018 at 3:18 PM, Vivek Kumar <vivku...@salmon.com> wrote:
>
> Hi Nirthika,
>
> Here is my synapse configuration:
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <sequence name="MoveFileSequence" trace="disable" xmlns="
http://ws.apache.org/ns/synapse";>
>
>     <property expression="/*[local-name()='Envelope' and namespace-uri()='
http://schemas.xmlsoap.org/soap/envelope/']/*[local-name()='Body' and
namespace-uri()='
http://schemas.xmlsoap.org/soap/envelope/']/*[local-name()='locations' and
namespace-uri()='
http://ws.apache.org/ns/synapse']/*[local-name()='sourceLocation' and
namespace-uri()='http://ws.apache.org/ns/synapse']" name="sourceLocation"
scope="default" type="STRING"/>
>
>
>
>     <log level="full">
>
>         <property expression="get-property('sourceLocation')"
name="sourceLocation"/>
>
>     </log>
>
>     <respond/>
>
> </sequence>
>
>
>
> Here In my MoveFileSequence sequence
>
> I am not able to set property 'sourceLocation' and print the data
'someValidPath' in the log mediator.
>
>
>
> Regards,
>
> Vivek
>
>
>
> From: Nirthika Rajendran [mailto:nirth...@wso2.com]
> Sent: Monday, March 12, 2018 2:36 PM
> To: Vivek Kumar
> Cc: dev@wso2.org
> Subject: Re: Passing parameter from Task Schedular to sequence in WSO2ESB
>
>
>
> Hi Vivek,
>
> Could you please share your samples and synapse configurations?
>
>
> Regards,
>
> Nirthika Rajendran
>
> Associate Software Engineer
> WSO2 Inc : http://wso2.org
> Mobile       : +94 77 719 8368
> LinkedIn    : https://www.linkedin.com/in/nirthika/
>
> Blog          : http://nirthika-tech-stuff.blogspot.com/
>
>
>
> On Fri, Mar 9, 2018 at 6:04 PM, Vivek Kumar <vivku...@salmon.com> wrote:
>
> Hi Dev Team,
>
> I want to pass some paramters into a sequence that is called by Task
Schedular.
>
>
>
> I was trying put all parameters in message of task schedular but not able
to get them in injected sequence.
>
>
>
> Like below is the message in the task schedular:
>
>      <task class="org.apache.synapse.startup.tasks.MessageInjector"
>
>           ====================
>
>           ====================
>
>           <property name="sequenceName" value="MoveFileSequence"
xmlns:task="http://www.wso2.org/products/wso2commons/tasks"/>
>
>     <property name="message" xmlns:task="
http://www.wso2.org/products/wso2commons/tasks";>
>
>         <locations>
>
>             <sourceLocation>someValidPath</sourceLocation>
>
>         </locations>
>
>     </property>
>
>    </task>
>
>
>
>
>
>   But I am not able to read string "someValidPath" in the sequence
"MoveFileSequence" using Xpath.
>
>
>
> Could you help me how to  achieve this using task schedular and the
sequence.
>
>
>
>
>
>
>
> Vivek Kumar
>
> Associate System Analyst
>
> Office:      +91-120-4737401
>
> Mobile:     +91 8588897434
>
> Email:        vivku...@salmon.com
>
>
>
>
>
> Information contained in this e-mail and any attachments is confidential
and intended for the use of the addressee only. Dissemination,
distribution, copying or use of this communication without prior permission
of the addressee is strictly prohibited. If you have received this
transmission in error, please advise the originator by reply e-mail and
delete it. Thank you. Salmon India’s Registered Address is: B-13, Sector
57, Noida (U.P.) 201301. Registered in India U72200DL2003PTC120356.
>
>
>
>
>
> Information contained in this e-mail and any attachments is confidential
and intended for the use of the addressee only. Dissemination,
distribution, copying or use of this communication without prior permission
of the addressee is strictly prohibited. If you have received this
transmission in error, please advise the originator by reply e-mail and
delete it. Thank you. Salmon India’s Registered Address is: B-13, Sector
57, Noida (U.P.) 201301. Registered in India U72200DL2003PTC120356.
>
>
>
> Information contained in this e-mail and any attachments is confidential
and intended for the use of the addressee only. Dissemination,
distribution, copying or use of this communication without prior permission
of the addressee is strictly prohibited. If you have received this
transmission in error, please advise the originator by reply e-mail and
delete it. Thank you. Salmon India’s Registered Address is: B-13, Sector
57, Noida (U.P.) 201301. Registered in India U72200DL2003PTC120356.
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to