TextTemplateActivity
Category: Common Steps Namespace: CMS.Plugin.FlowManagement.Domain.FlowBusiness.Activitys Base Class: BusinessActivity Module: FlowManagement.Domain
Overview
TextTemplateActivity (Text Template) is a node used for text template rendering in the process. It inherits from BusinessActivity and uses the Scriban template engine, supporting rendering process context data into a template to generate final text.
Configuration Description
| Property Name | Type | Required | Default | Description |
|---|---|---|---|---|
| TextContext | string | No | TextTemplateRender_Value | Process context key name for rendering result |
| TextTemplate | string | Yes | - | Template content (Scriban syntax) |
Process Context
Input Parameters
All data in the process context can be used in the template.
Output Parameters
| Parameter Name | Type | Description |
|---|---|---|
{TextContext} | string | Rendered text result |
Usage Examples
Basic Example
{
"Type": "TextTemplateActivity",
"Name": "Generate Report Content",
"Alias": "GenerateReport",
"TextTemplate": "Product Name: {{ ProductName_Value }}, Quantity: {{ Quantity_Value }}",
"TextContext": "ReportContent_Value"
}
Using Loop
{
"Type": "TextTemplateActivity",
"Name": "Generate Product List",
"Alias": "GenerateList",
"TextTemplate": "{{ for item in ProductList_Value }}Product: {{ item.Name }}, Price: {{ item.Price }}\n{{ end }}",
"TextContext": "ProductListText_Value"
}
Notes
- 💡 Uses Scriban template syntax, reference: https://github.com/scriban/scriban
- 💡 All data in process context can be directly referenced in the template.
- 💡 Supports advanced features like conditions, loops, functions, etc.
- ⚠️ Template syntax errors will record exception logs.
Related Nodes
- FileWriteActivity: File Write Node
- SendEmailActivity: Send Email Node
Update History
| Date | Version | Description |
|---|---|---|
| 2025-11-28 | 1.0 | Initial version |
Last updated: 2025-11-28