Aras Innovator Platform

Customizing Effectivity String Notations

While an Effectivity Expression is saved as XML, a user-friendly Notation of this Expression is displayed to users. It is possible to change the construction of this Notation. This section describes how the Notation can be customized.

Effectivity on a Part BOM Relationship is managed using its related effs_Part_BOM_expression Items. A Part BOM Relationship can have zero, one, or more Effectivities. The string_notation text property on the effs_Part_BOM_expression ItemType stores the user-friendly Notation for a single Effectivity Expression. The eff_expression_string_notation federated property on the Part BOM ItemType dynamically constructs the Effectivity text from its related Effectivities.

The string_notation property from the effs_Part_BOM_expression ItemType appears in:

  • The Manage Effectivity Expressions split pane on the BOM Structure tab of the Part Item view when the View Effectivity context menu item is accessed.
  • The Effectivity tab of the Part BOM Relationship Item view.

The eff_expression_string_notation property on the Part BOM ItemType is displayed in:

  • The BOM Structure tab of the Part Item view in the Effectivity column.

Customizing Effectivity String Notation on Effectivity Expression

Upon its creation and update, an Effectivity Expression gets a new Effectivity String Notation. This behavior is the job of the effs_expStringNotationConversion server-side Method executed on the onBeforeAdd and onBeforeUpdate events of the effs_Part_BOM_expression Items. This Method converts an Effectivity Condition to an Effectivity String Notation and stores the output to the string_notation Item property.

Customization of the Effectivity String Notations requires modification of the discussed Method as follows:

  1. Define a new class to represent a new Effectivity String Notation converter and to provide a String Notation value for a given Effectivity Expression object representation. This class should get objects of Effectivity Variables and Effectivity Expression, convert them into Effectivity String Notation, and return this Notation. The class must implement the Aras.Server.Core.Configurator.IStringNotationConverter interface, as included in the Appendix.
Note
A new class for a custom Effectivity String Notation converter is required because the Aras.Server.Core.Configurator.ExpressionToStringNotationConverter class with the default Effectivity String Notation converter is compiled. A customization example is provided in the Appendix.

  1. In the CreateNewStringNotationConverter local method definition, replace the Aras.Server.Core.Configurator.ExpressionToStringNotationConverter class with your custom class in the return statement. Do not change the variableContainer argument.

    internal virtual Aras.Server.Core.Configurator.IStringNotationConverter CreateNewStringNotationConverter(

    IEnumerable<Aras.Server.Core.Configurator.Variable> variableContainer)

    {

    return newAras.Server.Core.Configurator.ExpressionToStringNotationConverter(

    variableContainer);

    }

Customizing Unified Effectivity String Notation

The Part BOM ItemType is the Effectivity Scope ItemType of the Aras Part BOM Scope. An ItemType used as the Effectivity Scope ItemType can have a unified Effectivity String Notation joined from its related single Effectivity Expressions. To provide this feature, the Part BOM ItemType uses the:

  • eff_expression_string_notation federated property.
  • effs_getExpressionStringNotation server-side Method executed on the onAfterGet event.

Customization of the unified Effectivity String Notations requires modification of this Method, where the JoinExpressionStringNotation local method definition is changed according to the desired uniting template.

Note
A customization example is provided in the Appendix.

The local method produces a single value for the eff_expression_string_notation property. It combines related Effectivity Expressions using a conjunction.

The following is the default implementation of JoinExpressionStringNotation where parentheses enclose individual Effectivity String Notations and commas join these Notations.

internal virtual string JoinExpressionStringNotation(IEnumerable<string> expressionStringNotations) { if (!string.IsNullOrEmpty(expressionStringNotations.ElementAtOrDefault(1))) { expressionStringNotations = expressionStringNotations.Select( expressionStringNotation => "(" + expressionStringNotation + ")”); } return string.Join(", ", expressionStringNotations); }