0
我有一个Mule ESB项目,我以JSON格式获取数据并将其转换为CSV。在转换过程中,我想将'&'替换为其中一个属性中的'/'。我试过如下:Mule ESB DataMapper:将输入'&'替换为'/'并将其分配给输出
output.Department = input.department.replace('&', '/');
但是骡子是抛出以下错误:
output.Department = input.department.replace('&', '/');" failed. (org.mule.api.expression.ExpressionRuntimeException)
org.mule.el.mvel.DataMapperExpressionLanguage:71 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/expression/ExpressionRuntimeException.html)
4. Message: Transform failed! (org.jetel.exception.TransformException)
org.jetel.component.DataRecordTransform:132 (null)
我也尝试了以下的变化,但他们都失败,相同的错误消息:
output.Department = input.department.replace("&", "/");
编辑:输入字段'Department'的值将如下所示:'Application & Development T EAM”。目标系统不接受'&',并且'为什么我们需要将其更改为'/',以便输出值看起来像'应用程序/开发团队'。
我的环境是Windows 7,带Mule ESB EE 3.6.2运行时的Anypoint Studio 5.1.2,我在Studio中运行它。有关如何用斜杠('/')替换&符号(&)的任何想法?
我觉得我得到的错误,因为记录的一个有空值,我没有检查空。无论如何,这现在的作品,并感谢您的答案。 –