Move a file from one directory to another

Use this step to move a file from one directory to another.

Last published at: September 12th, 2023

moveFile Step

Description:

This step moves a file from one directory path to another on the application server.

 

Inputs

  • moveToDirectory – full path for the directory on the server
  • filePath – full path to the file on the server
  • overwrite – overwrite file on destination
  • newFilePathVarGlobal – Variable/Global to store new file path
 

 

Returns

  • True – step executed successfully
  • False – step failed to execute 
 

 

Usage:

 

 

Example:

Let’s build and execute the “moveFileDef” example.          

  • Create a new definition called “moveFileDef”
  • Select the definition and click the “design” button
  • Drag a “moveFile” step from the toolbox
  • Configure Variable variable.newFilePath as string 
  • Connect the dots between the start and “moveFile”  step
  • Click the “moveFile” step to configure its “Settings” properties. Provide a name to the step. 

 

  • Click the “moveFile” step to configure its “Advanced” properties. Select “ON” to overwrite the files (if existing) on the destination. Provide a directory file path to move to. Provide the source file path info. Note: The file selection wild cards like (*.* / *.doc) etc. are not supported yet. Provide the variable/global to store the new file path after execution. 

 

  • The “Logging” setting configuration is necessary for documentation and also measures the workflow progress and the percent complete. This is achieved by configuring the step state and percent fields individually, as shown in the images below. Configure the “Logging” using the following properties.

 

  • Save the process definition. Create a new process instance and execute. The process step should move file from one directory to another within the app server and the new file path is stored in variable.newFilePath as configured.

 

 

Definition Sample:

You may download the sample definition(s) from the link here and later import it (drag-drop) to your FlowWright Process Definition (XML file) or Form Definition (HTML file) page.

NOTE: Please verify and complete the process steps for any missing configurations, such as file path references and database connections after import. Then, save the definition to confirm the changes.

Click here to download the sample file.