Wiki

Scale Your Enterprise

User Tools

Site Tools


bw:file_operations_tool

This is an old revision of the document!


Introduction (File Operations)

This document describes the use of the “File Operations” tool in Bizweaver. Information regarding the associated File Reader and File Writer tools is found in separate documents.

Audience

This document is intended for developers of Bizweaver workflows.

Related Documents

The following documents contain additional information that may be helpful with the development of Bizweaver workflows.

General Workflow Step Information

  1. Each workflow step must have a unique Name.
    1. The application will assign a default name, but we recommend that you change the name to something that helps you understand the purpose of the step as it is used in other steps.
    2. The name cannot have spaces or special characters other than and underscore (_)
  2. Enter an optional Description to provide any additional information that may be helpful to understanding the step.
  3. Press <F4> to find and use values from previous workflow steps.

File Operations Tool

The File Operations tool (WF_FileOperations) provides three standard Windows file operations and one operation specific to Bizweaver. The fields displayed in the File Operations tool will change depending on the function.

The standard Windows operations are Copy, Move, and Delete. The Bizweaver function is named Get.

Copy and Move

The Copy and Move operations function in the same way and are configured in the same manner.

  1. Select the desired operation (Copy or Move) from the “Operation” drop-down list.
  2. Enter or select a Source Path (folder where the files are located).
    1. The source path can be anywhere on the local network but the user executing the workflow must have appropriate access.
  3. Enter a File Name.
    1. Standard Windows wildcard operators can be used to identify multiple files.
  4. Enter or select a Target (destination) Path (folder where the files will be copied/moved).
    1. The target path can be anywhere on the local network but the user executing the workflow must have appropriate access.
  5. Enter a file name.
    1. Standard Windows wildcard operators can be used to identify multiple files.
    2. When multiple files are referenced in the Source, the names will be the same in the target folder if the wildcard designation *.* is used.
  6. Indicate if you wish to Overwrite an existing file by selecting the checkbox.
  7. When duplicate files are found in the destination folder and you do not want to overwrite the existing ones, you can use the format described in the text just above the “Overwrite existing file option.”
    1. Do not use a wildcard (*) for the file extension when using the rename options.

Renaming Files

Use either the Copy or Move operations to rename a file. Make the target file name the new name and this will effectively rename the file.

Delete

  1. Select the Delete operation from the drop-down list.
  2. Enter or select a Source Path (folder where the files are located).
  3. Enter a file Name to be deleted.
    1. Standard Windows wildcard operators can be used to identify multiple files.
    2. In the example above, all files with the “.txt” extension will be deleted.

Get Files

File Handler also has a special function called Get Files. This operation is used to define multiple files (using * as wildcard) to be processed through subsequent workflow steps. The function can also reference a specific file.

The Get Files operation is most often used in conjunction with the Bizweaver “looping” function. In this process, the Get Files step creates a list of files, which is the input to the looping process. Whatever actions are needed are defined between the Loop and LoopEnd steps. These actions are performed for each file in the Get Files list. See the “Bizweaver – Looping Tool” document for more information on this process. The advantage of using this approach is that there is no need to use other tools to determine if files exist. If no files are found for processing, the workflow will simply end.

  1. Select the Get Files operation from the drop-down list.
  2. Enter or select a Source Path (folder where the files are located).
  3. Enter a file Name to be processed is subsequent steps.
    1. Standard Windows wildcard operators can be used to identify multiple files.
    2. In the example above, all files with the “.txt” extension will be processed.

Appendix A - File Operations Variables

There are several variables from the File Operations function that can be used in other workflow steps. In the following examples the file being addressed is named “FileName.txt” and it is found in the folder “C:\SourceFolder”.

Variable Name Explanation Example
File Name Full file name including path (folder) C:\SourceFolder\FileName.txt
File Title The file name including the extension FileName.txt
File Title without ExtThe file name without the extension FileName
File Extension The file extension including the “.” separator.txt
File Type File type such as TAB, csv, etc.
Source Path Path of the source file C:\SourceFolder
Source File Name “File” name as defined in a Get Files action Example: “*FileName.txt”
Target Path Path name from a File Writer operation C:\TargetFolder
Target File Name “File” name as defined in a File Writer action Example: “*FileName.txt”
bw/file_operations_tool.1551976634.txt.gz · Last modified: 2019/03/07 11:37 by runger