Class ExpressionCondition
List of multiple conditions. Similiar to the CombinedCondition class except each condition has an operator that is separate of the other conditions. Used to describe complex, one-level logic equations.
Namespace: Unity.Industrial.Forma.Core.Ruling
Syntax
[MovedFrom(true, "UnityEngine.Industrial.Configuring.Core.Ruling", "Unity.Industrial.Configurator", null)]
[Serializable]
public class ExpressionCondition : IMultiOperatorCondition, IRuleCondition
Constructors
ExpressionCondition()
Initializes a new instance of the ExpressionCondition class.
Declaration
public ExpressionCondition()
Properties
Conditions
Conditions within this expression
Declaration
public IReadOnlyList<IRuleCondition> Conditions { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<IRuleCondition> |
Expressions
Expressions contained within this rule
Declaration
public List<ConditionLink> Expressions { get; }
Property Value
Type | Description |
---|---|
List<ConditionLink> |
Methods
Add(IRuleCondition)
Adds the specified condition.
Declaration
public bool Add(IRuleCondition condition)
Parameters
Type | Name | Description |
---|---|---|
IRuleCondition | condition | The condition. |
Returns
Type | Description |
---|---|
Boolean |
|
Add(IRuleCondition, Operator)
Adds the specified condition.
Declaration
public bool Add(IRuleCondition condition, Operator op)
Parameters
Type | Name | Description |
---|---|---|
IRuleCondition | condition | The condition. |
Operator | op | Condition operator. |
Returns
Type | Description |
---|---|
Boolean |
|
Applies(RuleExecutionContext)
Applies the specified context.
Declaration
public bool Applies(RuleExecutionContext context)
Parameters
Type | Name | Description |
---|---|---|
RuleExecutionContext | context | The context. |
Returns
Type | Description |
---|---|
Boolean |
|
Implements
ClearEmptyChildren()
Clears the empty children.
Declaration
public void ClearEmptyChildren()
GetIndicesInTree(IRuleCondition)
Find the location of a specific condition in the rule tree.
Declaration
public int[] GetIndicesInTree(IRuleCondition targetRuleCondition)
Parameters
Type | Name | Description |
---|---|---|
IRuleCondition | targetRuleCondition | Target condition |
Returns
Type | Description |
---|---|
Int32[] | Array of the indices on each tree level you need to follow to reach the node. |
GetOperator(IRuleCondition)
Get the Operator for this condition.
Declaration
public Operator GetOperator(IRuleCondition condition)
Parameters
Type | Name | Description |
---|---|---|
IRuleCondition | condition | condition |
Returns
Type | Description |
---|---|
Operator | Operator |
Insert(Int32, IRuleCondition)
Inserts the condition at the specified index.
Declaration
public bool Insert(int index, IRuleCondition condition)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The index. |
IRuleCondition | condition | The condition. |
Returns
Type | Description |
---|---|
Boolean |
|
Remove(IRuleCondition)
Removes the specified condition.
Declaration
public bool Remove(IRuleCondition condition)
Parameters
Type | Name | Description |
---|---|---|
IRuleCondition | condition | The condition. |
Returns
Type | Description |
---|---|
Boolean |
|
RemoveAt(Int32)
Remove the condition at a specified index
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | index |
SetAt(Int32, IRuleCondition)
Sets the condition at a specific index.
Declaration
public bool SetAt(int index, IRuleCondition condition)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index |
IRuleCondition | condition | Condition |
Returns
Type | Description |
---|---|
Boolean |
|
SetOperator(IRuleCondition, Operator)
Set the Operator for this condition.
Declaration
public void SetOperator(IRuleCondition condition, Operator op)
Parameters
Type | Name | Description |
---|---|---|
IRuleCondition | condition | condition |
Operator | op | operator |
ToString()
ToString
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | string |