读取文件 |
The Read File action directs the Integration Service to look in a specified folder for a defined file type, read the data that is contained in that file, and then save the data to a variable.
You can configure the following properties for the Read File action:
操作
名称: 指定操作的名称。 如果需要,可以通过在字段中键入新名称来替换默认名称。
描述: 用于保存操作的描述。
Run Action: 用于指定希望运行操作的频率。
始终: 指定 Integration Service 将在每次运行集成时运行操作。
从不: 指定 Integration Service 将不会在运行集成时运行操作。
Conditionally, based on variable: Specifies that the Integration Service will run the action only when a selected variable meets a specified condition. 在仅有一个条件可以确定是否运行操作的情况下才可使用此选项。 只要启用了此选项,就可以在提供的输入框中创建条件语句。
根据表达式,在一定条件下: Specifies the conditions under which the Integration Service will run the action. 此选项在需要不只一个条件语句的情况下使用。 只要启用了此选项,就可以通过创建所需的条件语句在提供的输入框中创建条件表达式。 You create and edit your conditional expression on the Tree View tab. Click the Text View tab to see a read-only text view of the conditional expression.
来源
位置: 指定源文件夹所在的文件系统。 File systems or locations can include local file systems or network shares, Librarian, or a supported cloud storage location. For more information about supported cloud storage locations, see Administration Console's
文件名: Specifies the file that the Integration Service will read from. 可以键入文件夹位置和文件名称,或单击“浏览”以找到所需的文件并选中。 Alternatively, you can add a variable to specify the desired file or add a special character to the value you have entered.
|
If you have clicked to select the Wait for file to arrive check box under File Detection (as follows), the File Name option changes to the Folder to Scan option. |
要扫描的文件夹: 指定 Integration Service 需要用来查找文件的文件夹位置。 You can type the folder location or click Browse to locate and select the desired folder. Alternatively, you can add a variable that specifies the folder to scan, or add a special character to the value you have entered.
文件编码: 指定用于编码正在读取的文件的方法。
文件内容格式: Specifies the data contents type. The Integration Service processes the contents of the file according to this format.
Data is contained in a SOAP message: When enabled, the Integration Service expects the data to be contained in a SOAP message.
锁定的文件超时: 指定尝试打开最初发现为其他应用程序锁定的文件的时间。
文件检测
等待文件到达: When this option is selected, the Integration Service waits for the file to arrive if it does not already exist in the folder.
|
File detection options are available only when you have clicked to select the Wait for file to arrive check box. |
检测选项
扫描方法: 指定 Integration Service 将会用来为指定文件的到来监视扫描文件夹的方法。
Notification and Polling: 指定 Integration Service 将继续监视扫描文件夹并在时间间隔中扫描文件夹。 如果您对文件系统的可靠性有担忧,那么此选项可能会有用。 如果继续扫描时会丢失事件,那么轮询扫描将会确保检测到该事件。 启用此选项后,可以毫秒、秒、分钟或小时为单位指定轮询间隔。
Notifications Only: 指定 Integration Service 会继续监视扫描文件夹。
Polling Only: 指定 Integration Service 会在时间间隔中扫描扫描文件夹。 启用此选项后,可以毫秒、秒、分钟或小时为单位指定轮询间隔。
轮询间隔: Specifies how often the Integration Service scans for the file, Available when Notification and Polling or Polling Only is selected for the Scan Method.
文件样式: 指定要查找的文件的筛选器。 默认为 *.dat。 如果希望,可以输入一个不同的文件扩展名。 Alternatively, you can add a variable that specifies the file pattern, or add a special character to the value you have entered.
使用正则表达式: Specifies that the Integration Service will use regular expressions to identify the file pattern. Once this option is enabled, you can add regular expression modifiers to the previous property for more control over the search criteria.
最小文件大小: 指定 Integration Service 接受文件作为来源文件时,文件必须具备的最小文件大小。
最大文件大小: 指定 Integration Service 接受文件作为来源文件时,文件不可超过的文件大小。
File Idle Time: Specifies the maximum time a file can be idle in the specified folder for the Integration Service to still accept it as the source file. The maximum idle time can be specified in milliseconds, seconds, minutes or hours, and is compared against the file's "LastModifiedTime".
多个文件排序顺序
在有不只一个文件符合指定文件样式时,定义 Integration Service 将会在指定文件夹中处理文件的顺序。 如果在属性页中未指定任何排序顺序,那么默认为按创建时间(升序)排序,然后按文件名称(升序)排序。 可以指定零到四个排序条件。
顺序: 指定排序条件应用到指定文件夹中匹配文件的顺序。
Sort Field: 指定应用到匹配文件的条件。
方向: 指定将排序字段条件应用到匹配文件时,使用升序还是降序。
Add Sort Criteria: 用于添加其他排序条件。
输出
将文件内容保存到变量: 指定希望保存文件内容的变量。 Enter the variable in the input box. 或者,可以添加一个变量。
测试读取文件
测试: 运行操作。 The Message pane displays information on the success or failure of the action.
|
Clicking the Test button executes the action only and does not run the integration. 因此,操作将会在不使用曾经可能配置为使用的集成中的任何数据的情况下运行。 For information on testing your integration, refer to Using the Test Pane. |
用户帐户
Inherit from parent action: When enabled, the action inherits the user account credentials specified on the Actions property page. Alternatively, if the action is part of a Group action, it will inherit the user account credentials specified on the immediate parent Group action’s property page.
指定用户凭据: 启用此选项后,会使用指定的凭据运行操作。
错误处理和诊断
Ignore errors and continue running actions: 启用此选项后,指定如果操作失败,那么会继续运行其余操作。
|
如果未启用此属性,并且操作失败,那么产生的行为取决于以下方案:
If the selected action is within a Group action, no actions outside of that Group action are affected. |
Retry if failed: 启用此选项后,指定如果操作失败,那么 Integration Service 会尝试再次运行操作。
Maximum retries: 指定 Integration Service 将会再次尝试运行操作的最大次数。 Available when Retry if failed is enabled.
Retry interval: 指定 Integration Service 将在操作失败后,尝试再次运行操作之前等待的最大时间。 Available when Retry if failed is enabled.