This file contains hidden or 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
START n=node:locations('withinDistance:[#[message.InboundProperties.lat],#[message.InboundProperties.lon], 0.5]') | |
MATCH (t)-[:`START`|END]->n | |
RETURN n.stationId, n.name, count(*) | |
ORDER BY count(*) DESC |
This file contains hidden or 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
<flow name="flow"> | |
<vm:inbound-endpoint path="test.in" | |
exchange-pattern="request-response" /> | |
<http:outbound-endpoint address="http://www.google.com/" | |
method="GET" exchange-pattern="request-response" /> | |
<choice> | |
<when | |
expression="#[message.inboundProperties['Content-Type'].contains('text/html')]"> | |
<logger message="when number one invoked" level="WARN" /> | |
</when> |
This file contains hidden or 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
<flow name="fileToMqttBridge"> | |
<file:inbound-endpoint path="/tmp/mule/in" /> | |
<object-to-string-transformer /> | |
<!-- extract attendee info and transform to JSON payload --> | |
<expression-transformer | |
expression="#[extractAttendeeData(message.payload, '${boothId}')]" /> | |
<json:object-to-json-transformer /> |
This file contains hidden or 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
<flow name="setupBlink1"> | |
<blink1:set-color deviceId="${blink1.device.id}" color="off" /> | |
<blink1:clear-pattern deviceId="${blink1.device.id}" /> | |
<blink1:store-pattern deviceId="${blink1.device.id}"> | |
<blink1:entries> | |
<blink1:entry color="green" duration="100" /> | |
<blink1:entry color="off" duration="100" /> | |
</blink1:entries> | |
</blink1:store-pattern> | |
<logger level="INFO" message="blink(1) initialized" /> |
This file contains hidden or 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
#!/usr/bin/python | |
import sys | |
import tempfile | |
while True: | |
data = sys.stdin.readline() | |
if data: | |
f = tempfile.NamedTemporaryFile(dir='/tmp/mule/in', delete=False) | |
f.write(data) |
This file contains hidden or 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.util.StringUtils; | |
def extractAttendeeData(payload, boothId) { | |
csv = StringUtils.strip(StringUtils.substringAfter(payload, 'QR-Code:')); | |
data = StringUtils.splitAndTrim(csv, ','); | |
flowVars.attendeeId = data[0]; | |
[ | |
'boothId': boothId, | |
'attendeeId' : data[0], | |
'fullName' : data[1], |
This file contains hidden or 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
<riak:config> | |
<riak:http-client-configuration url="http://localhost:8098/riak" /> | |
</riak:config> | |
<json:json-to-object-transformer name="jsonToShoppingCart" | |
returnClass="com.acme.ShoppingCart" /> | |
<json:object-to-json-transformer name="objectToJson" /> |
This file contains hidden or 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
<spring:bean name="shoppingCartResolver" | |
class="org.mule.modules.riak.mel.ExpressionConflictResolver" | |
init-method="initialise" p:deserializer-ref="jsonToShoppingCart" | |
p:serializer-ref="objectToJson"> | |
<spring:property name="expression"> | |
<spring:value><![CDATA[ | |
resolvedCartItems = [:]; | |
foreach (cart : siblings) { | |
foreach (item : cart.items) { |
This file contains hidden or 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
<flow name="retrieveShoppingCart" processingStrategy="synchronous"> | |
<riak:fetch bucketName="shoppingCarts" key="#[cartId]" | |
resolver-ref="shoppingCartResolver" /> | |
<transformer ref="jsonToShoppingCart" /> | |
</flow> |
This file contains hidden or 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
{ | |
"attendeeId": "123456", | |
"boothId": "E234", | |
"email": "[email protected]", | |
"fullName": "John Q. Doe", | |
"companyName": "Anonymous Inc." | |
} |