在dataweave中进行自定义查找 [英] Custom Lookup in dataweave

查看:115
本文介绍了在dataweave中进行自定义查找的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在输入中有2个字段,一个是primary_language&另一个是secondary_language.我有一种情况,我必须查找这两个字段中存在的值,然后根据该表返回一个特定的值. 例如 如果主要语言是英语&第二语言为null,则英语为输出&如果主要语言是西班牙语& secondary是Sign,然后将None放在输出中&很快.可以告诉我们如何在mulesoft的dataweave中执行此操作.

I have 2 field in the input, one is primary_language & the other is secondary_language. I have a case where I have to lookup values present in these two fields and then return a specific value according to the table. For example If primary language is English & secondary language is null then English will be the output & if primary language is Spanish & secondary is Sign then put None in the output & so on. Can one tell how we can perform this in dataweave in mulesoft.

推荐答案

您真的有一些动态逻辑还是只是上面提到的两个条件?

Do you really have some more dynamic logic or its just the two conditions you mentioned above?

您可以使用when/否则,或调用另一个流来获取值.

you can use when/otherwise or call another flow to get the value.

%dw 1.0
%output application/java

---
{
language: 'English' when (payload.primary == 'English' and payload.secondary is :null) 
                otherwise ('None' when payload.primary == 'Spanish' and payload.secondary == 'Sign'
                    otherwise ''
                ),

language2: lookup("testFlow",payload)
}

这篇关于在dataweave中进行自定义查找的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆