ModificationTime 是一个输出参数,它是远程 sftp 命令的结果。
请参阅示例 BP,其中列出了 TXT (*.txt) 文件:
<process name = "Demo_BP_SFTP_List">
<sequence name="Demo_BP_SFTP_List">
<!-- Begin Session -->
<operation name="SFTP Client Begin Session Service">
<participant name="SFTPClientBeginSession"/>
<output message="SFTPClientBeginSessionServiceTypeInputMessage">
<assign to="SFTPClientAdapter">SFTPClientAdapter</assign>
<assign to="RemoteHost">127.0.0.1</assign>
<assign to="RemotePort">22</assign>
<assign to="RemoteUserId">Demo_Remote_SFTP</assign>
<assign to="RemotePasswd">passw0rd</assign>
<assign to="PreferredAuthenticationMethod">password</assign>
<assign to="KnownHostKeyId">442297176384f4ba2node1</assign>
<assign to="." from="*"></assign>
</output>
<input message="inmsg">
<assign to="SFTPClientBeginSessionServiceResults" from="*"></assign>
</input>
</operation>
<operation name="SFTP Client LIST Service">
<participant name="SFTPClientList"/>
<output message="SFTPClientListServiceTypeInputMessage">
<assign to="RemoteFileName">*.txt</assign>
<assign to="SessionToken" from="SFTPClientBeginSessionServiceResults/SessionToken/text()"></assign>
<assign to="." from="*"/>
</output>
<input message="inmsg">
<assign to="SFTPClientLISTServiceResults" from="*"></assign>
</input>
</operation>
<operation name="SFTP Client End Session Service">
<participant name="SFTPClientEndSession"/>
<output message="SFTPClientEndSessionServiceTypeInputMessage">
<assign to="SessionToken" from="SFTPClientBeginSessionServiceResults/SessionToken/text()"></assign>
<assign to="." from="*"></assign>
</output>
<input message="inmsg">
<assign to="SFTPClientEndSessionServiceResults" from="*"></assign>
</input>
</operation>
</sequence>
</process>
输出将是:
</ProcessData>
....
</SFTPClientLISTServiceResults>
....
<Files>
<File>
<Name>testdata01.txt</Name>
<Size>11</Size>
<Type>Regular</Type>
<Permissions>-rw-rw-r--</Permissions>
<ModificationTime>1611017370</ModificationTime>
<Owner>Demo_Remote_SFTP</Owner>
<Group>Demo_Remote_SFTP</Group>
</File>
<File>
<Name>testdata02.txt</Name>
<Size>11</Size>
<Type>Regular</Type>
<Permissions>-rw-rw-r--</Permissions>
<ModificationTime>1611017385</ModificationTime>
<Owner>Demo_Remote_SFTP</Owner>
<Group>Demo_Remote_SFTP</Group>
</File>
<File>
<Name>testdata03.txt</Name>
<Size>12</Size>
<Type>Regular</Type>
<Permissions>-rw-rw-r--</Permissions>
<ModificationTime>1611017399</ModificationTime>
<Owner>Demo_Remote_SFTP</Owner>
<Group>Demo_Remote_SFTP</Group>
</File>
</Files>
</SFTPClientLISTServiceResults>
</ProcessData>
您需要创建一个循环并检查 ModificationTime 是否小于您的 Current Time 减去 5 分钟,然后执行SFTP Client GET Service。