Mirth:如何从文件读取器通道获取源文件目录
我有一个文件读取器通道拾取 xml 文档。默认情况下,文件读取器通道会填充通道映射中的“originalFilename”,该通道仅提供文件名,而不是完整路径。有没有办法获得完整路径,而无需硬编码?
I have a file reader channel picking up an xml document. By default, a file reader channel populates the 'originalFilename' in the channel map, which ony gives me the name of the file, not the full path. Is there any way to get the full path, withouth having to hard code something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以像这样获取任何源阅读器属性:
我将其放在 Mirth 论坛中,并列出了您可以访问的其他属性
http://www.mirthcorp.com/community/forums/showthread.php ?t=2210
You can get any of the Source reader properties like this:
I put it up in the Mirth forums with a list of the other properties you can access
http://www.mirthcorp.com/community/forums/showthread.php?t=2210
您可以将该目录放入通道部署脚本中:
然后在源连接器
和另一个通道脚本中使用该映射:
You could put the directory in a channel deploy script:
then use that map in both your source connector:
and in another channel script:
不幸的是,没有用于检索文件的完整路径的变量或方法。当然,您可能已经知道路径,因为您必须在“目录”字段中提供它。我尝试使用预处理器将路径存储在通道变量中,但目录字段无法引用变量。因此,您必须在需要的地方对完整路径进行硬编码。
Unfortunately, there is no variable or method for retrieving the file's full path. Of course, you probably already know the path, since you would have had to provide it in the Directory field. I experimented with using the preprocessor to store the path in a channel variable, but the Directory field is unable to reference variables. Thus, you're stuck having to hard code the full path everywhere you need it.