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

MuleSoft Juntando duas ou mais Listas ordenadas

Alex teles
January 10, 2017

MuleSoft Juntando duas ou mais Listas ordenadas

MuleSoft Juntando duas ou mais Listas ordenadas

Alex teles

January 10, 2017
Tweet

More Decks by Alex teles

Other Decks in Education

Transcript

  1. <?xml version="1.0" encoding="UTF-8"?> <mule xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata" 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"> <flow name="mock-set-payloadFlow"> <poll doc:name="Poll"> <fixed-frequency-scheduler frequency="1000" timeUnit="MINUTES"/> <logger message="====Start=====" level="INFO" doc:name="Logger"/> </poll> <set-payload value="[
  2. {&quot;Nome&quot;:&quot;pao&quot;, &quot;Descricao&quot;:&quot;pao de queijo&quot;}, {&quot;Nome&quot;:&quot;queijo&quot;, &quot;Descricao&quot;:&quot;queijo coalho&quot;}, {&quot;Nome&quot;:&quot;Pipoca&quot;,&quot;Descricao&quot;:&quot;Pipoca com mantega&quot;}

    ]" doc:name="Set Payload" mimeType="application/json"/> <set-variable variableName="varValores" value="#[['10','221','399']]" mimeType="application/java" doc:name="Variable_valores"/> <set-variable variableName="varQTD" value="#[[3,1,10]]" doc:name="Variable_quantidades"/> <dw:transform-message metadata:id="26f9ac57-0bb8-4858-9518-148549e84370" doc:name="Transform Message"> <dw:input-payload mimeType="application/json"/> <dw:set-payload><![CDATA[%dw 1.0 %output application/java
  3. --- payload map ((payloadProduto , index) -> { Name: payloadProduto.Nome,

    Description: payloadProduto.Descricao, Value: flowVars.varValores[index], Quantity: flowVars.varQTD[index] })]]></dw:set-payload> </dw:transform-message> <logger message="=====resultado======#[message.payloadAs(java.lang.String)]" level="INFO" doc:name="Logger"/> </flow> </mule>