Mule 负载属性值来自流变量

编程入门 行业动态 更新时间:2024-10-19 02:18:38
本文介绍了Mule 负载属性值来自流变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个场景,我需要从属性文件中获取值,而我需要获取的值将来自变量.

I have a scenario where i need to get the value from the property file and the values which i need to get will be from a variable.

我的道具文件

org1 =active org1_oracle_user = blah org1_oracle_password = blahblah org2 =active org2_oracle_user = blah2 org2_oracle_password = blah2blah2 org3 = Active org3_oracle_user = blah3 org3_oracle_password = blah3blah3

现在我通过一些输入获取组织的价值,并且我能够保存到一些变量中.

Now i'm getting the value of the org through some input and i was able to save into some variable.

<set-variable variableName="org_name" value="org1" doc:name="OrgNameVariable" />

此外,我还可以通过 dataweave 获取该组织是否处于活动状态

Also i'm able to get the status of that org as active or not through dataweave

<set-variable variableName="orgTypeStatus" value="#[dw('p(flowVars_name)')]" doc:name="orgTypeStatusVariable" />

我能够检索该值是否处于活动状态

I was able to retrieve the value as active or not

但是现在如何将其他键值附加到流变量 org_name获取他们的用户名和密码

But now how do I append the other key values to flow variable org_name to get thier user and password

<set-variable variableName="m_user" value="#[dw('p(flowVars_name.concat('_oracle_user'))')]" doc:name="user"/>

上面的代码不起作用,它说表达式执行失败.

The above code is not working it says execution of expression fails.

我给出了一个示例,因为还有其他基于组织名称的道具,我无法对其进行硬编码

I have give a sample example as there are other props based on the org name and I cant hard code it

推荐答案

你能试试这个表达吗:-

Can you try this expression:-

#[dw('p(flowVars_name ++ "_oracle_user")')]

因此,您需要在表达式中对 "" 进行转义,因此您在 XML 配置中的变量将如下所示:-

So, you need to escape "" in the expression and so your variable in XML config will be as follows:-

<set-variable variableName="m_user" value="#[dw('p(flowVars_name ++ &quot;_oracle_user&quot;)')]" doc:name="user"/>

更多推荐

Mule 负载属性值来自流变量

本文发布于:2023-11-23 19:58:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1622703.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:负载   变量   属性   Mule

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!