VariableWriteActivity
Category: Common Steps Namespace: CMS.Plugin.FlowManagement.Domain.FlowBusiness.Activitys Base Class: BusinessActivity Module: FlowManagement.Domain
Overview
VariableWriteActivity is a node used to write external variables (such as PLC variables) in a flow. Inheriting from BusinessActivity, it writes values to variables via the IFlowVariableService.
Configuration Instructions
| Property Name | Type | Required | Default Value | Description |
|---|---|---|---|---|
| CheckVariableName | bool | No | false | Whether to check variable configuration |
| WriteRetryCount | int | No | 3 | Write retry count |
| WriteRetryDelay | int | No | 500 | Write retry delay (milliseconds) |
| ParameterVariables | WriteParameterVariables | No | Empty Collection | Parameter variable collection |
Parameter Variable Configuration
| Property Name | Type | Description |
|---|---|---|
| WriteVariableName | string | Write Variable Name |
| WriteVariableValue | string | Fixed Value to Write |
| ReadParameterName | string | Key name to read value from flow context |
| ReadVariableName | string | Variable name to read value from |
| FlowItemKey | string | Flow Context Key |
| WriteIntoDataItems | bool | Whether to write to flow context |
| Sort | int | Sort Order |
Usage Examples
{
"Type": "VariableWriteActivity",
"Name": "Write PLC Vars",
"Alias": "WritePLCVars",
"WriteRetryCount": 3,
"WriteRetryDelay": 500,
"ParameterVariables": [
{
"WriteVariableName": "DB1.StartSignal",
"WriteVariableValue": "1",
"WriteIntoDataItems": false
},
{
"WriteVariableName": "DB1.ProductCode",
"ReadParameterName": "ProductCode_Value",
"WriteIntoDataItems": true
}
]
}
Notes
- 💡 Supports batch writing of multiple variables
- 💡 Automatically retries on write failure
- 💡 Supports reading values from flow context or other variables
- ⚠️ Requires variable service configuration (IFlowVariableService)
Related Nodes
- VariableReadActivity: Variable Read Node
- VariableMonitorActivity: Variable Monitor Node
Update History
| Date | Version | Description |
|---|---|---|
| 2025-11-28 | 1.0 | Initial version |
Last updated: 2025-11-28