ule子originalFilename为null [英] Mule originalFilename is null

查看:104
本文介绍了ule子originalFilename为null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Mule 3.4.1创建一个进程,该进程在处理文件后会用特定的文件名写出文件. 输入的文件名是:MMDDYYYY_sys_newhires.csv 处理的文件名是:MMDDYYYY_sys_newhires_NNN.csv

I am creating a process using Mule 3.4.1 which after processing a file it writes out the file with a specific filename. The input filename is: MMDDYYYY_sys_newhires.csv The processed filename is: MMDDYYYY_sys_newhires_NNN.csv

我正在使用的代码如下:

The code that i am using is below:

#[filename = message.inboundProperties.originalFilename;
  filename= com.cfa.apps.icims.mule.CounterSingleton.getInstance().getCount() 
         +  filename.substring(0,filename.length() -1 -4) + ".csv";
  filename]

第一行存在问题. message.inboundProperties.originalFilename.

The problem exists in the first line. message.inboundProperties.originalFilename.

我尝试了许多不同的组合

I have tried a number of different combinations

message.inboundProperties.originalFilename
message.inboundProperties['originalFilename']
message.inboundProperties.originalFileName
message.inboundProperties['originalFileName']
message.inboundProperties.sourceFilename
message.inboundProperties['sourceFilename']
message.inboundProperties.sourceFileName
message.inboundProperties['sourceFileName']

现在,我还尝试嵌套#[header:originalFilename],它可以单独工作,但是至少就我所知,您不能将表达式嵌套在代码中.

Now I have also tried nesting the #[header:originalFilename], this works by itself, but you can't nest the expression within the code at least as far as I know.

有帮助吗?

更新:我正在使用入站文件传输

UPDATE: I am using the inbound file transport

推荐答案

由于您没有显示端点配置,因此我假设这是文件入站端点发生的情况.

Since you don't show the endpoint configuration, I'm going to assume that this is happening with a file inbound endpoint.

出于难以置信的原因,入站端点后面的文件消息接收器在评估表达式以生成存档文件名时将originalFilename属性置于 outbound 范围内.

For a reason that goes beyond imagination, the file message receiver behind the inbound endpoint puts the originalFilename property in the outbound scope when evaluating the expression to generate the archived file name.

因此使用:message.outboundProperties.originalFilename

这篇关于ule子originalFilename为null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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