Skip to main content
Version: Next

FileCopyActivity

Category: File Operations Namespace: CMS.Plugin.FlowManagement.Domain.FlowBusiness.Activitys Base Class: ActionActivity Module: FlowManagement.Domain

Overview​

FileCopyActivity (Copy File) is a node used to copy files within a process. It inherits from ActionActivity and supports copying files from a specified path to a target path, with an option to overwrite existing files.

Business Scenarios​

Applicable Scenarios​

  • File Backup: Copy files to a backup directory.
  • File Distribution: Copy files to multiple locations.
  • Data Archiving: Copy data files to an archive directory.
  • Template Copying: Copy template files for generating new files.

Configuration Description​

Basic Configuration​

Property NameTypeRequiredDefaultDescription
FilePathstringYes-Source file path
FilePathForCopystringYes-Target path
OverWriteboolNotrueWhether to overwrite existing files

Usage Examples​

Basic Example​

{
"Type": "FileCopyActivity",
"Name": "Backup Config File",
"Alias": "BackupConfig",
"FilePath": "C:\\Config\\settings.json",
"FilePathForCopy": "C:\\Backup\\settings.json",
"OverWrite": true
}

Notes​

  • ⚠️ Source file and target path cannot be the same.
  • ⚠️ If the source file does not exist, a warning is recorded and the operation is skipped.
  • ⚠️ If OverWrite is false and the target file exists, an exception will be thrown.
  • 💡 Ensure the target directory exists, otherwise the copy will fail.

Update History​

DateVersionDescription
2025-11-281.0Initial version

Last updated: 2025-11-28