Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Mulesoft recuperando o TimeZone com groovy
Search
Alex teles
August 07, 2016
Education
0
66
Mulesoft recuperando o TimeZone com groovy
Mulesoft recuperando o TimeZone com groovy
Alex teles
August 07, 2016
Tweet
Share
More Decks by Alex teles
See All by Alex teles
Mulesoft configurando conexão com banco AS400 DB2
alexteles10
0
88
Chamando um flow de dentro do Transform Message
alexteles10
0
71
MuleSoft Juntando duas ou mais Listas ordenadas
alexteles10
0
67
MuleSoft Como mockar resultado com transform mensager
alexteles10
0
39
MuleSoft mock com set payload
alexteles10
0
45
Como excluir o conector do facebook Do anyponit
alexteles10
0
66
Baixando conectores que não são nativos
alexteles10
0
57
Editor do Anypoint
alexteles10
0
41
MuleSoft Como fazer um when dentro de um when
alexteles10
0
45
Other Decks in Education
See All in Education
America and the World
oripsolob
0
510
Case Studies and Course Review - Lecture 12 - Information Visualisation (4019538FNR)
signer
PRO
1
2k
サンキッズゾーン 春日井駅前 ご案内
sanyohomes
0
310
SARA Annual Report 2024-25
sara2023
1
180
Are puppies a ranking factor?
jonoalderson
0
820
演習問題
takenawa
0
4.6k
OpenSourceSummitJapanを運営してみた話
kujiraitakahiro
0
700
郷土教育モデル事業(香川県小豆島町).pdf
bandg
0
190
自己紹介 / who-am-i
yasulab
PRO
3
5.2k
SkimaTalk Tutorial for Students
skimatalk
0
1.8k
Visualisation Techniques - Lecture 8 - Information Visualisation (4019538FNR)
signer
PRO
0
2.4k
SkimaTalk Teacher Guidelines Summary
skimatalk
0
790k
Featured
See All Featured
Producing Creativity
orderedlist
PRO
346
40k
How to train your dragon (web standard)
notwaldorf
92
6.1k
Bash Introduction
62gerente
614
210k
Documentation Writing (for coders)
carmenintech
71
4.9k
Optimising Largest Contentful Paint
csswizardry
37
3.3k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
181
53k
How STYLIGHT went responsive
nonsquared
100
5.6k
Docker and Python
trallard
44
3.4k
Navigating Team Friction
lara
187
15k
4 Signs Your Business is Dying
shpigford
184
22k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
Transcript
None
Conector groovy Uso Liguagem Pegando o TimeZone
Inserindo valor na variável no código groovy
Configuração do poll
Xml do poll <poll doc:name="Poll"> <schedulers:cron-scheduler expression="0 0
1 1 * ? 2016"/> <logger message="======= Iniciado ========" level="INFO" doc:name="Logger"/> </poll>
Configuração de variavel Note que ela está sem valor na
expressão
Xml da variavel <set-variable variableName="dataTimeZone" value="" doc:name="Variable"/>
Configuração do groovy para pegar o timeZone
Código que recupera o time nove da Asia/Saigon <scripting:component
doc:name="Groovy"> <scripting:script engine="Groovy"><![CDATA[import groovy.time.TimeCategory timeZone = TimeZone.getTimeZone('Asia/Saigon') now = new Date() flowVars ['dataTimeZone'] = now.format('dd/MM/yyyy HH:mm:ss.S',timeZone)]]></scripting:script> </scripting:component>
Log pra mostra a variavel com valor do TimeZone
Xml do Log que mostra a vareavel <logger message="#[flowVars.dataTimeZone]"
level="INFO" doc:name="Logger"/>
<?xml version="1.0" encoding="UTF-8"?> <mule xmlns:schedulers="http://www.mulesoft.org/schema/mule/schedulers" xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting" 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/scripting http://www.mulesoft.org/schema/mule/scripting/current/mule- scripting.xsd http://www.mulesoft.org/schema/mule/schedulers http://www.mulesoft.org/schema/mule/schedulers/current/mule- schedulers.xsd"> <flow name="exemplo_groovy_timezoneFlow"> <poll doc:name="Poll"> <schedulers:cron-scheduler expression="0 0 1 1 * ? 2016"/> <logger message="======= Iniciado ========" level="INFO" doc:name="Logger"/> </poll> <set-variable variableName="dataTimeZone" value="" doc:name="Variable"/> <scripting:component doc:name="Groovy"> <scripting:script engine="Groovy"><![CDATA[import groovy.time.TimeCategory timeZone = TimeZone.getTimeZone('Asia/Saigon') now = new Date() flowVars ['dataTimeZone'] = now.format('dd/MM/yyyy HH:mm:ss.S',timeZone)]]></scripting:script> </scripting:component> <logger message="#[flowVars.dataTimeZone]" level="INFO" doc:name="Logger"/> </flow> </mule> Xml completo
Obrigado a todos Fim