Trading Networks 10.3 | Administering and Monitoring B2B Transactions | Managing File Transfers with ActiveTransfer | Managing Events | Writing File Content to the Database
 
Writing File Content to the Database
*To write file content to the database
1. In My webMethods: Administration > Integration > Managed File Transfer > Event Management.
2. Select the server instance. For details, see Selecting the Instance to Work With.
3. Click the tab containing the event for which you are creating the file operation action (Post-Processing Events or Scheduled Events).
4. Select the event in the event list.
5. In the Actions section, click the Select Action list.
6. In the resulting dialog box, do the following:
a. Click the Select Category list and select Write File to Database.
b. Click the Package box and select the package that contains the service you want to execute.
c. Click the Service box and select the service you want to execute.
d. Click OK.
7. In the Source Filter box, enter the name of the file whose transfer will trigger this event. By default, ActiveTransfer Server considers all files.
Note:
You can use wildcard characters to filter the file names. For example, enter *.zip to trigger the event only when zip files are uploaded or downloaded. To trigger an event based on a name string in the zip files, use the name string in the Source Filter box, preceded and followed by wildcard characters. For example, enter *invoice*.zip to trigger the event based on the file URLs, when zip files containing the character string invoice in their file names are uploaded or downloaded. If you define a Source Filter for an action, the action acts only on the files that are filtered out.
For information on the use of wildcards in ActiveTransfer Server, see Use of Special Characters in Search.
8. If you want to use regular expression in the source filter, specify a valid regular expression in Source Filter and select Use regular expression.
Examples for regular expressions:
(.(?!purchaseorder))*
Excludes files with the file URL containing purchaseorder
.*/out/.*
Include files with the file URL containing the folder out
^abc(.*)123$
Includes anything that starts with abc and ends with 123. Matches abc123, abcxyz123, but not abcxyz123def
NEW-((*.doc)|(*_backup_*))
Includes anything starting with NEW- that either ends in .doc, or is followed by the string _backup_
9. If you want ActiveTransfer to provide the path of the target file to the respective service, select Include file path. The file path information is passed to the service as input parameter filePath.
10. If you want to pass the contents of the file to the service, select the Include file content check box and select the transmission method (as bytes or as stream). The file content is passed to the service as input parameters fileContent and fileBytes, or as fileContent and fileStream. Code your input parameter as fileContent + fileBytes or fileContent + fileStream.
Note:
Selecting this check box is not necessary if your service does not require the file content as input (for example, if the service only writes the name of the files being uploaded, or the names of the users who uploaded them).
11. Specify values for the input parameters of the service that you selected, as required.
12. If you want to execute an error action if the file operation fails, select Execute error action.
13. Click Save.
14. If you selected the Execute error action check box, define an error action as described in Defining an Error Action.
15. If you are finished defining actions for this event, activate the event as described in Activating an Event.
Result:
The “Write File to Database” action delivers the contents of a file to an Integration Server service for the purpose of writing the content to the database. ActiveTransfer Server provides the content in byte or stream form to the service according to the format that the service’s input signature requires. This action does not modify the list of files from the previous action.