Created
December 21, 2020 15:44
-
-
Save emoran/886d6b97ceb9107af76dbf9299242957 to your computer and use it in GitHub Desktop.
Removes array object from other with Dataweave 1.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<flow name="dataweaveFlow"> | |
<poll doc:name="Poll"> | |
<fixed-frequency-scheduler frequency="1" startDelay="100" timeUnit="DAYS"/> | |
<logger message="tets" level="INFO" doc:name="Logger"/> | |
</poll> | |
<dw:transform-message doc:name="DropThese" metadata:id="096bae40-aafe-4bcd-bdaa-183fdd1fded6"> | |
<dw:input-payload/> | |
<dw:set-variable variableName="DropThese"><![CDATA[%dw 1.0 | |
%output application/java | |
--- | |
[ | |
{type: "secondary", space: "rgb"}, {type: "primary", space: "cmyk"} | |
]]]></dw:set-variable> | |
</dw:transform-message> | |
<dw:transform-message doc:name="Set Payload"> | |
<dw:set-payload><![CDATA[%dw 1.0 | |
%output application/java | |
--- | |
[ | |
{sequence: "1", colour: "red", type: "primary", space: "rgb"} | |
, {sequence: "2", colour: "green", type: "primary", space: "rgb"} | |
, {sequence: "3", colour: "blue", type: "primary", space: "rgb"} | |
, {sequence: "4", colour: "yellow", type: "secondary", space: "rgb"} | |
, {sequence: "5", colour: "magenta", type: "secondary", space: "rgb"} | |
, {sequence: "6", colour: "cyan", type: "secondary", space: "rgb"} | |
, {sequence: "7", colour: "cyan", type: "primary", space: "cmyk"} | |
, {sequence: "8", colour: "magenta", type: "primary", space: "cmyk"} | |
, {sequence: "9", colour: "yellow", type: "primary", space: "cmyk"} | |
, {sequence: "10", colour: "red", type: "secondary", space: "cmyk"} | |
, {sequence: "11", colour: "green", type: "secondary", space: "cmyk"} | |
, {sequence: "12", colour: "blue", type: "secondary", space: "cmyk"} | |
]]]></dw:set-payload> | |
</dw:transform-message> | |
<dw:transform-message doc:name="Transform Message"> | |
<dw:input-payload doc:sample="sample_data/list_map_2.dwl"/> | |
<dw:input-variable doc:sample="sample_data/list_map_3.dwl" variableName="DropThese"/> | |
<dw:set-payload><![CDATA[%dw 1.0 | |
%output application/java | |
--- | |
payload filter (not (flowVars.DropThese contains {type: $.type, space: $.space})) | |
]]></dw:set-payload> | |
</dw:transform-message> | |
<dw:transform-message doc:name="Return JSON"> | |
<dw:set-payload><![CDATA[%dw 1.0 | |
%output application/json | |
--- | |
payload]]></dw:set-payload> | |
</dw:transform-message> | |
</flow> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment