FileWriteActivity
Category: File Operations Namespace: CMS.Plugin.FlowManagement.Domain.FlowBusiness.Activitys Base Class: ActionActivity Module: FlowManagement.Domain
Overview
FileWriteActivity (Write File) is a node used to write file content in the process. It inherits from ActionActivity and supports writing text content or data from the process context to a file at a specified path. This node supports configuring file access modes and share types.
Business Scenarios
Applicable Scenarios
- Data Export: Write processing results to a file.
- Logging: Write to custom log files.
- Report Generation: Generate text report files.
- Configuration Saving: Save configuration information to a file.
- Data Backup: Backup data to a file.
Role in the System
FileWriteActivity provides file writing capabilities in the LMES process system:
- Writes to files in the local file system.
- Supports getting data from process context or writing text directly.
- Supports multiple file access modes.
Configuration Description
Basic Configuration
| Property Name | Type | Required | Default | Description |
|---|---|---|---|---|
| FilePath | string | Yes | - | File path |
| FlowItemKey | string | No | - | Process context key name to get data from (Priority) |
| Text | string | No | - | Write text, directly specify content to write |
| FileMode | FileMode | No | OpenOrCreate | File mode |
| FileAccess | FileAccess | No | Write | Access type |
| FileShare | FileShare | No | None | Share type |
Configuration Details
FlowItemKey
Description: Key name to get data from process context. If specified, data from process context is used with priority.
Text
Description: Directly specify text content to write. Used when FlowItemKey is not specified or empty.
Process Context
Input Parameters
| Parameter Name | Type | Description |
|---|---|---|
{FlowItemKey} | any | Data to write to file |
Usage Examples
Basic Example: Write Fixed Text
{
"Type": "FileWriteActivity",
"Name": "Write Log",
"Alias": "WriteLog",
"FilePath": "C:\\Logs\\process.log",
"Text": "Process completed"
}
Write from Process Context
{
"Type": "FileWriteActivity",
"Name": "Export Data",
"Alias": "ExportData",
"FilePath": "D:\\Export\\result.txt",
"FlowItemKey": "ProcessResult_Value",
"FileMode": "Create"
}
Notes
- ⚠️ FlowItemKey takes precedence over Text; if both are configured, FlowItemKey is used.
- ⚠️ Ensure the process running account has file write permissions.
- ⚠️ When FileMode is Create, it will overwrite existing files.
- 💡 Use Append mode to append content to the end of the file.
Related Nodes
- FileReadActivity: Read File Node
- FileCopyActivity: Copy File Node
- CsvWriteActivity: CSV Write Node
Update History
| Date | Version | Description |
|---|---|---|
| 2025-11-28 | 1.0 | Initial version |
Last updated: 2025-11-28