Parameter Class
Assembly: CodeEffects.Rule.Editor.dll
Namespace: CodeEffects.Rule.Editor.Client
Summary
Represents a parameter of an in-rule method or an action in an Adaptive Source. A Function holds its parameters in the Parameters property. The class carries the same information as the ParameterAttribute does in a source object class.
Syntax
public class Parameter : IDataTypable, IPromptable, IFilterable
Constructors
Parameter()
Creates a parameter with these defaults: Type is ParameterType.Input, DataType is DataType.None, ValueInputType is ValueInputType.All, Nullable and Prompt are false, and Collection and Settings are new objects with their own defaults.
Properties
Type
Type: CodeEffects.Rule.Common.Models.ParameterType
The kind of the parameter: Input for a value that users provide in the rule, Source for the source object itself, Constant, or Collection. The Rule Editor sends only Input parameters to the client. The default value is ParameterType.Input.
DataType
Type: CodeEffects.Rule.Common.Models.DataType
The data type of the parameter. For a collection parameter, set it to DataType.Collection and describe the collection in Collection. For time parameters, see Settings.TimeType. The default value is DataType.None.
-
Type: CodeEffects.Rule.Common.Models.ValueInputType
Defines how users may set the value of the parameter in a rule: pick fields only, type a value only, or both. The default value is ValueInputType.All.
Description
Type: System.String
The description of the parameter. The Rule Editor shows it as a tooltip.
AiDescription
Type: System.String
What an AI agent should know about the parameter, when it needs more than the description. The Rule Editor never shows it.
Filter
Type: System.String
Implements IFilterable. The filter value of the parameter. When the parameter has a data source, only the DataSourceItem objects whose Filter matches this value are shown.
Group
Type: System.String
The name of the group the Rule Editor shows the parameter's fields under in its menus.
Nullable
Type: System.Boolean
Indicates whether the parameter accepts null values. The default value is false.
Prompt
Type: System.Boolean
Implements IPromptable. When true for a string parameter, the Rule Editor shows its Prompt dialog for long-form input, as described in AI Prompts. It has no effect on other data types. The default value is false.
Collection
Type: Collection
The collection settings of the parameter. Used only when DataType is DataType.Collection.
Settings
Type: Settings
Implements ISettable. The type-specific settings of the parameter, such as the range, the date and time format, TimeType, and the data source name.
Methods
Example
using CodeEffects.Rule.Common.Models;
using CodeEffects.Rule.Editor.Client;
// A duration parameter that accepts hours and minutes
var parameter = new Parameter
{
DataType = DataType.Time,
Description = "Maximum waiting time",
Settings = new Settings { TimeType = TimeType.Duration, Format = "hh:mm" }
};