IAdmParameterOperatorValueCondition

The IAdmParameterOperatorValueCondition interface represents the If <parameter> <value> condition.

Inheritance: IAdmCondition

Properties

  • Property

  • Description

  • HolderId

  • Gets or sets the unique identifier of the object that contains the condition (e.g. custom command or report).

  • ParameterId

  • Gets or sets the identifier of the parameter that is checked in the condition.

  • ComparisonOperator

  • Gets or sets a comparison operator for the condition.

  • Value

  • Gets or sets the parameter value that will be checked in the condition.

  • CaseSensitive

  • Gets or sets a value indicating whether the parameter value will be treated as case sensitive for the condition.

  • Mask

  • Gets or sets a mask that determines the part of the parameter value that will be checked in the condition.

Details

HolderId

Gets or sets the unique identifier of the object that contains the condition (e.g. custom command or report).

  • Type:
  • string
  • Access:
  • Read/Write

ParameterId

Gets or sets the identifier of the parameter that is checked in the condition. To get the identifier, use the IAdmParameter::ID property.

  • Type:
  • string
  • Access:
  • Read/Write

ComparisonOperator

Gets or sets a comparison operator for the condition.


Value

Gets or sets the parameter value that will be checked in the condition.

  • Type:
  • Object
  • Access:
  • Read/Write

CaseSensitive

Gets or sets a value indicating whether the parameter value will be treated as case sensitive for the condition.

  • Type:
  • bool
  • Access:
  • Read/Write

Mask

Gets or sets a mask that determines the part of the parameter value that will be checked in the condition.

  • Type:
  • Object
  • Access:
  • Read/Write

Remarks

For parameters that represent a list of items, the mask specifies the identifier of the parameter item that will be checked in the condition. To get the identifier, use the IAdmParameter::ID property. For other parameters, this property is currently ignored.

Examples

The following code sample creates a condition that returns true if the first item of the specified parameter equals Yes.

PowerShell
# The $command variable refers to a custom command.
# The $actionSet variable refers to an action set in this custom command.

# The parameter name to check.
$parameterName = "param-MyParameter"

# Create condition.  
$condition = $actionSet.Conditions.CreateEx("adm-ParameterOperatorValueCondition")
$parameterCondition = $condition.GetCondition()

$parameterCondition.HolderId = $command.CommandID
$parameter = $command.Parameters | where {$_.Name -ieq $parameterName}
$parameterCondition.ParameterId = $parameter.ID
$parameterCondition.Mask = $parameter.Items[0].ID # identifier of the first item
$parameterCondition.Value = 1 # is enabled

# Save changes.
$condition.SetCondition($parameterCondition)
$condition.SetInfo()
$actionSet.Conditions.Add($condition)
C#
// The $command variable refers to a custom command.
// The $actionSet variable refers to an action set in this custom command.

// The parameter name to check.
string parameterName = "param-MyParameter";

// Create condition.
IAdmBusinessRuleCondition condition = (IAdmBusinessRuleCondition)actionSet.Conditions.CreateEx(
    "adm-ParameterOperatorValueCondition");
IAdmParameterOperatorValueCondition parameterCondition = 
    (IAdmParameterOperatorValueCondition)condition.GetCondition();

parameterCondition.HolderId = command.CommandID;
List<IAdmParameter> parameters = command.Parameters.ToList();
IAdmParameterCheckList parameter = 
    (IAdmParameterCheckList)parameters.Find(param => string.Equals(
    param.Name, parameterName, StringComparison.CurrentCultureIgnoreCase));
parameterCondition.ParameterId = parameter.ID;
parameterCondition.Mask = parameter.Items[0].ID; // identifier of the first item
parameterCondition.Value = 1; // is enabled

// Save changes.
condition.SetCondition(parameterCondition);
condition.SetInfo();
actionSet.Conditions.Add(condition);

Requirements

Minimum required version: 2018.2

See also