Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Chamando um flow de dentro do Transform Message

6ed0152927434a106bb683fda7f69620?s=47 Alex teles
January 17, 2017

Chamando um flow de dentro do Transform Message

Chamando um flow de dentro do Transform Message

6ed0152927434a106bb683fda7f69620?s=128

Alex teles

January 17, 2017
Tweet

More Decks by Alex teles

Other Decks in Education

Transcript

  1. Mulesoft

  2.  Chamando um flow de dentro do Transform Message

  3.  Vamos ultilizar dois flows, um com transform que vai

    chaar o outro flow como na imagem
  4. Poll para iniciar a chamada

  5. Aqui está o segredo chama o nome do segundo flow

    no lookup e pode passar parâmetros
  6. Setando valor para o payload para retorna para o segundo

    flow
  7.  XML  <?xml version="1.0" encoding="UTF-8"?>  <mule xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking"

    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/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd  http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule- tracking-ee.xsd">  <flow name="lookup-flowsFlow">  <poll doc:name="Poll">  <fixed-frequency-scheduler frequency="10000" timeUnit="MINUTES"/>  <logger message="START" level="INFO" doc:name="Logger"/>  </poll>  <dw:transform-message doc:name="Transform Message">  <dw:set-payload><![CDATA[%dw 1.0
  8.  XML 2  %output application/java  ---  {

     nome: lookup ("segundoFlow",{})  }]]></dw:set-payload>  </dw:transform-message>  <logger message="=== result === #[message.payloadAs(java.lang.String)]" level="INFO" doc:name="Logger"/>  </flow>  <flow name="segundoFlow">  <logger level="INFO" doc:name="Logger"/>  <set-payload value="#[&quot;Alex Lindo&quot;]" doc:name="Set Payload"/>  </flow>  </mule>
  9.  FIM