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
68
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
99
Chamando um flow de dentro do Transform Message
alexteles10
0
77
MuleSoft Juntando duas ou mais Listas ordenadas
alexteles10
0
72
MuleSoft Como mockar resultado com transform mensager
alexteles10
0
46
MuleSoft mock com set payload
alexteles10
0
55
Como excluir o conector do facebook Do anyponit
alexteles10
0
69
Baixando conectores que não são nativos
alexteles10
0
61
Editor do Anypoint
alexteles10
0
45
MuleSoft Como fazer um when dentro de um when
alexteles10
0
54
Other Decks in Education
See All in Education
10分で学ぶ すてきなモナド
soukouki
1
150
【洋書和訳:さよならを待つふたりのために】第2章 ガン特典と実存的フリースロー
yaginumatti
0
230
卒論の書き方 / Happy Writing
kaityo256
PRO
54
28k
Evaluation Methods - Lecture 6 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
1.3k
2025-12-11 nakanoshima.dev LT
takesection
0
110
2025年度伊藤正彦ゼミ紹介
imash
0
170
Introduction - Lecture 1 - Information Visualisation (4019538FNR)
signer
PRO
0
5.1k
The Next Big Step Toward Nuclear Disarmament
hide2kano
0
220
0203
cbtlibrary
0
110
RGBでも蛍光を!? / RayTracingCamp11
kugimasa
2
380
国際卓越研究大学計画|Science Tokyo(東京科学大学)
sciencetokyo
PRO
0
47k
Node-REDで広がるプログラミング教育の可能性
ueponx
1
270
Featured
See All Featured
Design in an AI World
tapps
0
140
Un-Boring Meetings
codingconduct
0
200
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
210
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.9k
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
140
HDC tutorial
michielstock
1
390
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
200
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
54
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
67
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
250
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