Return Class

Assembly: CodeEffects.Rule.Editor.dll
Namespace: CodeEffects.Rule.Editor.Client

Summary

Represents the return value of an in-rule method in an Adaptive Source. A Function holds it in the Return property. The class carries the same information as the ReturnAttribute does in a source object class.

Syntax

public class Return : IDataTypable, IPromptable

Constructors

  • Return()

    Creates a return value with these defaults: DataType is DataType.None, ValueInputType is ValueInputType.All, Nullable and Prompt are false, and Settings is a new object with its own defaults.

Properties

  • DataType

    Type: CodeEffects.Rule.Common.Models.DataType

    The data type of the returned value. For time return values, see Settings.TimeType. The default value is DataType.None.

  • ValueInputType

    Type: CodeEffects.Rule.Common.Models.ValueInputType

    Defines how users may set the value that the method is compared with: pick fields only, type a value only, or both. The default value is ValueInputType.All.

  • Nullable

    Type: System.Boolean

    Indicates whether the method can return null. The default value is false.

  • Prompt

    Type: System.Boolean

    Implements IPromptable. When true for a string return value, 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.

  • Settings

    Type: Settings

    Implements ISettable. The type-specific settings of the return value, such as the range, the date and time format, TimeType, and the data source name.

Methods

  • ToString(bool _)

    Returns: System.String

    Returns the return value as the JSON object that the Rule Editor sends to the client. The parameter is not used and is reserved for future use. The Rule Editor calls this method; you do not need to.

Example

using CodeEffects.Rule.Common.Models;
using CodeEffects.Rule.Editor.Client;

var ret = new Return
{
	DataType = DataType.Numeric,
	Settings = new Settings { AllowDecimals = false, Min = 0, Max = 100 }
};

Ask on Stack Overflow - Yes, it's still active
Ask in GitHub Discussions

p102

l097 --

l102

p101

×