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
40
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
ThingLink
matleenalaakso
28
4.1k
Are puppies a ranking factor?
jonoalderson
0
840
2025年度春学期 統計学 第1回 イントロダクション (2025. 4. 10)
akiraasano
PRO
0
180
バックオフィス組織にも「チームトポロジー」の考えが使えるかもしれない!!
masakiokuda
0
110
Sponsor the Conference | VizChitra 2025
vizchitra
0
550
計算情報学研究室 (数理情報学第7研究室)紹介スライド (2025)
tomonatu8
0
530
Design Guidelines and Principles - Lecture 7 - Information Visualisation (4019538FNR)
signer
PRO
0
2.4k
第1回大学院理工学系説明会|東京科学大学(Science Tokyo)
sciencetokyo
PRO
0
3.8k
推しのコミュニティはなんぼあってもいい / Let's join a lot of communities.
kaga
2
1.8k
SkimaTalk Teacher Guidelines Summary
skimatalk
0
790k
自己紹介 / who-am-i
yasulab
PRO
3
5.2k
Dashboards - Lecture 11 - Information Visualisation (4019538FNR)
signer
PRO
1
2k
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
100
5.6k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
Rebuilding a faster, lazier Slack
samanthasiow
82
9.1k
How to Ace a Technical Interview
jacobian
277
23k
How to Think Like a Performance Engineer
csswizardry
24
1.7k
Stop Working from a Prison Cell
hatefulcrawdad
270
21k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
22k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
Done Done
chrislema
184
16k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
KATA
mclloyd
30
14k
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