Skip to content

Expressions Params

Beatrix Expressions are a mechanism for defining how small pieces of code should be generated in your Solution. These code snippets can be constants, environment variables, pointers to other entity properties, among other types.

Every Expression requires that at least one parameter be informed. It allows Expression to know the desired value and the type of return that should be made.

The parameters are predefined and each one has an associated purpose and value type.

General Rules

All parameters have a pattern for their use: @[Param_Name]::[Param_Value].

  • Must start with '@';
  • Must have a pre-defined name;
  • Depending on the type of parameter, it is optional to inform a desired value. Each value must be separated by '::'

Example:

1
@ConstString::My_Value

Find out below the types of parameters that exist and the rules for using each one.

@ConstBool

Indicates a constant value of type bool or System.Boolean. Used when you want an Expression to return this constant value.

Requirements Rules:

  • Is required to inform one value;
  • The value must be a Boolean type (true or false)

Example:

1
@ConstBool::true

Usage in an Expression:

1
Value(@ConstBool::true)


@ConstByte

Indicates a constant value of type byte or System.Byte. Used when you want an Expression to return this constant value.

Requirements Rules:

  • Is required to inform one value;
  • The value must be equivalent to the byte type (Range: 0 to 255)

Example:

1
@ConstByte::5

Usage in an Expression:

1
Value(@ConstByte::5)


@ConstSByte

Indicates a constant value of type sbyte or System.SByte. Used when you want an Expression to return this constant value.

Requirements Rules:

  • Is required to inform one value;
  • The value must be equivalent to the sbyte type (Range: -128 to 127)

Example:

1
@ConstSByte::-5

Usage in an Expression:

1
Value(@ConstSByte::-5)


@ConstChar

Indicates a constant value of type char or System.Char. Used when you want an Expression to return this constant value.

Requirements Rules:

  • Is required to inform one value;
  • The value must be equivalent to the char type

Example:

1
@ConstChar::A

Usage in an Expression:

1
Value(@ConstChar::A)


@ConstDate

Indicates a constant value of type DateTimeOffset or System.DateTimeOffset. Used when you want an Expression to return this constant value.

It allows you to define the desired format for the date, including setting the time zone.

Requirements Rules:

  • Two values are needed, they are:
    • The desired date
    • The date format
  • The date and format must be valid and matches

Example:

1
@ConstDate::2022-01-01T12:30:25-03:00::yyyy-MM-ddTHH:mm:sszzz

Usage in an Expression:

1
Value(@ConstDate::2022-01-01T12:30:25-03:00::yyyy-MM-ddTHH:mm:sszzz)

@ConstDecimal

Indicates a constant value of type decimal or System.Decimal. Used when you want an Expression to return this constant value.

Requirements Rules:

  • Is required to inform one value;
  • The value must be equivalent to the decimal type

Example:

1
@ConstDecimal::100

Usage in an Expression:

1
Value(@ConstDecimal::100)


@ConstDouble

Indicates a constant value of type double or System.Double. Used when you want an Expression to return this constant value.

Requirements Rules:

  • Is required to inform one value;
  • The value must be equivalent to the double type

Example:

1
@ConstDouble::100.0

Usage in an Expression:

1
Value(@ConstDouble::100.0)


@ConstFloat

Indicates a constant value of type float or System.Single. Used when you want an Expression to return this constant value.

Requirements Rules:

  • Is required to inform one value;
  • The value must be equivalent to the float type

Example:

1
@ConstFloat::25.51

Usage in an Expression:

1
Value(@ConstFloat::25.51)


@ConstShort

Indicates a constant value of type short or System.Int16. Used when you want an Expression to return this constant value.

Requirements Rules:

  • Is required to inform one value;
  • The value must be equivalent to the short type (Range: -32,768 to 32,767)

Example:

1
@ConstShort::-1000

Usage in an Expression:

1
Value(@ConstShort::-1000)


@ConstUShort

Indicates a constant value of type ushort or System.UInt16. Used when you want an Expression to return this constant value.

Requirements Rules:

  • Is required to inform one value;
  • The value must be equivalent to the ushort type (Range: 0 to 65,535)

Example:

1
@ConstUShort::1000

Usage in an Expression:

1
Value(@ConstUShort::1000)


@ConstInt

Indicates a constant value of type int or System.Int32. Used when you want an Expression to return this constant value.

Requirements Rules:

  • Is required to inform one value;
  • The value must be equivalent to the int type (Range: -2,147,483,648 to 2,147,483,647)

Example:

1
@ConstInt::-40000

Usage in an Expression:

1
Value(@ConstInt::-40000)


@ConstUInt

Indicates a constant value of type uint or System.UInt32. Used when you want an Expression to return this constant value.

Requirements Rules:

  • Is required to inform one value;
  • The value must be equivalent to the uint type (Range: 0 to 4,294,967,295)

Example:

1
@ConstUInt::40000

Usage in an Expression:

1
Value(@ConstUInt::40000)


@ConstLong

Indicates a constant value of type long or System.Int64. Used when you want an Expression to return this constant value.

Requirements Rules:

  • Is required to inform one value;
  • The value must be equivalent to the long type (Range: -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807)

Example:

1
@ConstLong::-10000000000

Usage in an Expression:

1
Value(@ConstLong::-10000000000)


@ConstULong

Indicates a constant value of type ulong or System.UInt64. Used when you want an Expression to return this constant value.

Requirements Rules:

  • Is required to inform one value;
  • The value must be equivalent to the ulong type (Range: 0 to 18,446,744,073,709,551,615)

Example:

1
@ConstULong::10000000000

Usage in an Expression:

1
Value(@ConstULong::10000000000)


@ConstString

Indicates a constant value of type string or System.String. Used when you want an Expression to return this constant value.

Requirements Rules:

  • Is required to inform one value;
  • Must only have letters, numbers, underline char ('_'), dot char ('.') and at char ('@')
  • Max length of 200 chars

Example:

1
@ConstString::email@my_domain.com

Usage in an Expression:

1
Value(@ConstString::email@my_domain.com)


@ConstGuid

Indicates a constant value of type Guid or System.Guid (Globally Unique Identifier). Used when you want an Expression to return this constant value.

Requirements Rules:

  • Is required to inform one value;
  • The value must be a valid Guid type

Example:

1
@ConstGuid::be6e4458-813b-4918-a9e5-cc0f44d3c670

Usage in an Expression:

1
Value(@ConstGuid::be6e4458-813b-4918-a9e5-cc0f44d3c670)


@UtcToday

Gets the current date at run time, in UTC format.

Requirements Rules:

  • It isn't necessary to inform a value for this parameter

Example:

1
@UtcToday

Usage in an Expression:

1
Value(@UtcToday)


@UtcNow

Gets the current date and time at run time, in UTC format.

Requirements Rules:

  • It isn't necessary to inform a value for this parameter

Example:

1
@UtcNow

Usage in an Expression:

1
Value(@UtcNow)


@Regex

Gets a Regular Expression string value.

Due to the complexity of characters that a Regular Expression can have, the value for the parameter must be in Base64 format.

Requirements Rules:

  • Is required to inform one value;
  • Must be a valid Base64 string;
  • The Base64 string must contains a valid Regular Expression

Example:

1
2
# Base64 string equivalent to regular expression ^[A-Z]$
@Regex::XltBLVpdJA==

Usage in an Expression:

1
Value(@Regex::XltBLVpdJA==)


@Prop

Indicates the property of an entity whose value you want to obtain at run time.

The entity for this property belongs to the expression/parameter execution context. For example: When executed on an EntityValidation, the validation entity is used.

Requirements Rules:

  • Is required to inform one value;
  • Must exist the property in the entity property list

Example:

1
@Prop::My_First_Property

Usage in an Expression:

1
Value(@Prop::My_First_Property)


@PropChild

Indicates a nesting of properties in an entity whose value you want to obtain at run time.

Only allowed for properties whose type is a relationship with another entity.

The entity of the main property belongs to the expression/parameter execution context. For example: When executed on an EntityValidation, the validation entity is used.

Requirements Rules:

  • Is required to inform one value;
  • Only allowed one child property, in which must be separated by dot char ('.');
  • The main property must exist in the context entity property list;
  • An entity must exist for the main property type in the current model;
  • The child property must exist in the relationship entity

Example:

1
@PropChild::Main_Property.Child_Property

Usage in an Expression:

1
Value(@PropChild::Main_Property.Child_Property)


Back to top