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
<flow name="getStockInfo"> | |
<http:listener path="stock" method="GET" config-ref="httpListener"> | |
<http:response> | |
<http:body> | |
<![CDATA[ | |
%dw 2.0 | |
output application/json | |
--- | |
{ | |
"ticker": attributes.queryParams.ticker, |
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
<flow name="prersons"> | |
<http:listener path="person" method="POST" config-ref="httpListener" /> | |
<foreach collection="#[payload.persons]"> | |
<choice> | |
<when expression="#[payload.age > 21"]> | |
<logger message="#['$(payload.name) is an adult']" /> | |
</when> | |
<otherwise> | |
<logger message="#['$(payload.name) is a minor.']" /> | |
</otherwise> |
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
{ | |
persons: [ | |
{ | |
name: "John Doe", | |
age: 35 | |
}, | |
{ | |
name: "Jane Doe", | |
age: 32 | |
}, |
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
<idempotent-message-validator idExpression="#[payload]" valueExpression="#[payload]"> | |
<os:private-object-store | |
entryTtl="20" | |
entryTtlUnit="MILLISECONDS" | |
maxEntries="20" | |
persistent="false" | |
expirationInterval="20" | |
expirationIntervalUnit="MILLISECONDS"/> | |
</idempotent-message-validator> |
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
<sfdc:config-with-oauth name="salesforce-oauth" | |
consumerKey="${salesforce.consumerKey}" | |
consumerSecret="${salesforce.consumerSecret}"> | |
<sfdc:oauth-callback-config domain="localhost" localPort="8082" | |
remotePort="8082" path="callback" connector-ref="HTTP_HTTPS" /> | |
<sfdc:oauth-store-config objectStore="tokensStore" /> | |
</sfdc:config-with-oauth> |
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
<os:object-store name="tokensStore" | |
entryTtl="1" | |
entryTtlUnit="HOURS" | |
maxEntries="100" | |
persistent="true" | |
expirationInterval="30" | |
expirationIntervalUnit="MINUTES" /> |
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
<os:retrieve key="state"> | |
<os:default-value> | |
<![CDATA[#[ | |
output application/json | |
--- | |
{ "id": attributes.queryParams.id, | |
"timestamp": now(), | |
"name": payload.name | |
} | |
]]]> |
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
<os:retrieve key="timestamp"> | |
<os:default-value>#[now()]</os:default-value> | |
</os:retrieve> |
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
<os:retrieve key="userId" /> |
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
<os:store key="state"> | |
<os:value> | |
<![CDATA[#[ | |
output application/json | |
--- | |
{ "id": attributes.queryParams.id, | |
"timestamp": now(), | |
"name": payload.name | |
} | |
]]]> |
NewerOlder