This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from payload as u | |
select new(com.mulesoft.mql.example.User) { | |
name = u.name, | |
email = u.email, | |
address = new(com.mulesoft.mql.example.Address) { | |
address = u.address, | |
city = u.city, | |
state = u.state | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mql:transform query="from yammer.messages select new { text = body.plain }" /> | |
<mql:transform query="from twitter.publicTimeline as tweet select new { text = tweet.text }" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<User> users = ...; | |
Map<String,Object> context = new HashMap<String,Object>(); | |
context.put("users", users); | |
Collection<User> result = | |
Query.execute("from users where division = 'Engineering'", context); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mql:transform query="select new { name = u.name, email = u.email}"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mql:query-service name=“UsersService" | |
address="http://localhost:9002/mulesoft-users" | |
query="from userManager.users as u where email like 'mulesoft.com'"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from userManager.users as user | |
join salesforce.query('SELECT Company, MobilePhone | |
FROM Lead | |
WHERE Email = \'' + user.email + '\'', 1) | |
as sfuser | |
select new { | |
name = user.name, | |
email = user.email, | |
company = sfuser[0].?Company, | |
mobilePhone = sfuser[0].?MobilePhone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from userManager.users as u | |
select new { | |
href = 'http://localhost/users/' + u.id, | |
name = u.firstName + ' ' + u.lastName, | |
division = u.division | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from userManager.users | |
where division = ‘Sales’ and | |
(email like ‘mulesoft.com’ or email like ‘mulesource.com’) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def request = new Expando(); | |
request.status= 'my tweet' | |
request.in_reply_to_status_id = 123; | |
... fill in your object properties | |
def response = client.resource("http://api.twitter.com/1/statuses/update.json").post(Map.class, request.properties); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Map; | |
@Command("public-tweets") | |
public class PublicTweetsCommand extends GroovyCommand { | |
void execute() { | |
def response = client.resource("http://api.twitter.com/1/statuses/public_timeline.json") | |
.get(Map[].class); | |
// print the text field of each tweet object | |
response.each { |