kflow.sample-mule-step.3.0-beta1.source-code.sample-mule-service.xml Maven / Gradle / Ivy
<?xml version="1.0" encoding="UTF-8"?> <mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:script="http://www.mulesoft.org/schema/mule/scripting" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:twitter="http://www.mulesoft.org/schema/mule/twitter" xsi:schemaLocation=" http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.2/mule.xsd http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/3.2/mule-scripting.xsd http://www.mulesoft.org/schema/mule/twitter http://www.mulesoft.org/schema/mule/twitter/2.0/mule-twitter.xsd "> <!-- you need to supply your own configuration and uncomment <twitter:update-state tag below --> <!--<twitter:config consumerKey="XXX" consumerSecret="XXX"--> <!--accessToken="XXX" accessTokenSecret="XXX"/>--> <flow name="twitter3" > <inbound-endpoint address="vm://twitter"/> <!--Another submission accepted, from --> <processor-chain> <script:component> <script:script engine="groovy"> try { def map = [:]; for (attr in payload.getProcessAttributes()) { map.put(attr.key, attr.toString()); } return "Another submission accepted, from @" + map["twitter_login"] + ", subject: " + map["email_subject"]; } catch (Exception e) { e.printStackTrace(); throw e; } </script:script> </script:component> <!-- uncomment this once configured --> <!--<twitter:update-state state="#[groovy:payload]" />--> <script:component> <script:script engine="groovy"> System.out.println("uncomment twitter tag in sample-mule-service.xml to send tweets"); </script:script> </script:component> </processor-chain> </flow> </mule>