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
{ | |
"countries": [ | |
{ | |
"name": "Netherlands", | |
"continent": "Europe", | |
"cities": [ | |
{ | |
"name": "Amsterdam", | |
"population": "0.821", | |
"isCapital": true |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<fg:Countries xmlns:fg="http://examples.fganora.com"> | |
<fg:Country> | |
<fg:Name>Netherlands</fg:Name> | |
<fg:Continent>Europe</fg:Continent> | |
<fg:Cities> | |
<fg:City capital="YES"> | |
<fg:Name>Amsterdam</fg:Name> | |
<fg:Population>0.821</fg:Population> | |
</fg:City> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<mule xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" | |
xmlns:spring="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd | |
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd | |
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd | |
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd | |
http://www.mulesoft.org/schema/mule/ee/core http://ww |
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
muleContext.getRegistry().registerObject("<key>", <object>) | |
muleContext.getRegistry().get("<key>") |
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
// stopping | |
def myFlow = muleContext.registry.lookupFlowConstruct('<flow name>'); | |
if (myFlow.isStarted()) myFlow.stop() | |
// starting | |
def myFlow = muleContext.registry.lookupFlowConstruct('<flow name>'); | |
if (!myFlow.isStarted()) myFlow.start() |
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
package com.acme; | |
import org.mule.DefaultMuleEvent; | |
import org.mule.DefaultMuleMessage; | |
import org.mule.MessageExchangePattern; | |
import org.mule.api.MuleException; | |
import org.mule.api.MuleRuntimeException; | |
import org.mule.api.context.notification.MuleContextNotificationListener; | |
import org.mule.config.i18n.MessageFactory; | |
import org.mule.construct.Flow; |
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
%dw 1.0 | |
%output application/json | |
--- | |
payload orderBy ($.City ++ $.DeliveryDate) | |
groupBy ($.City ++ ',' ++ $.DeliveryDate) | |
pluck ( | |
{city: ($$ splitBy ",")[0], | |
deliveryDate: ($$ splitBy ",")[1], | |
stops: ($ groupBy $.CustomerId) | |
pluck ( |
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 org.mule.DefaultMuleMessage; | |
import org.mule.module.client.MuleClient; | |
request = new DefaultMuleMessage(payload, app.registry['_muleContext']); | |
MuleClient client = new MuleClient(app.registry['_muleContext']); | |
client.send("vm://myqueue", request); |
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
<configuration doc:name="Configuration"> | |
<expression-language> | |
<global-functions> | |
def logMessage(loggerName, messageToLog) { | |
return "[" + flow.name + ":" + loggerName + "]: " + messageToLog; | |
} | |
</global-functions> | |
</expression-language> | |
</configuration> |
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 menu = new XmlSlurper().parseText(payload) | |
def totalPrice = 0.0 | |
(menu.food).each { | |
menuItem -> | |
totalPrice += Double.parseDouble(menuItem.price.text()) | |
} | |
totalPrice |
NewerOlder