Class ExpressionHelper

java.lang.Object
com.ptc.windchill.option.expression.ExpressionHelper

public class ExpressionHelper extends Object
A helper for working with Expressions.

Supported API: true

Extendable: false
  • Method Details

    • getAssignedExpression

      public static ComplexExpressionData getAssignedExpression(Expressionable ea, OptionSet optionset) throws WTException
      API used to get the formatted expression of an Expressionable object.Bydefault API passes the expression through an ExternalFormatConvertor

      Supported API: true
      Parameters:
      expressionable - objects that can have expressions assigned like Part, Links etc.
      optionset - the OptionSet
      Returns:
      ComplexExpressionData
      Throws:
      WTException
    • getAssignedExpression

      public static ComplexExpressionData getAssignedExpression(Expressionable ea, OptionSet optionset, boolean doConversion) throws WTException
      API to get the formatted expression of an Expressionable object. When doConversion is set to true, the API passes the expression through an ExternalFormatConvertor, if one has been defined. Else, it returns the expression in default format.

      Supported API: true
      Parameters:
      expressionable - objects that can have expressions assigned like Part, Links etc.
      optionset - the OptionSet
      doConversion - boolean
      Returns:
      ComplexExpressionData
      Throws:
      WTException
    • getDisplayExpression

      public static String getDisplayExpression(ExpressionAssignable expressionAssignable, WTContainerRef containerRef) throws Exception
      Get the display expression for this ExpressionAssignable in this container.

      Supported API: true
      Parameters:
      expressionAssignable - the objects that can have expressions assigned like Part, Links etc.
      containerRef - the container reference
      Returns:
      returns a json string with display and invalid keys { display: "display value", invalid: true/false }
      Throws:
      Exception
    • getDisplayExpression

      public static String getDisplayExpression(ExpressionAssignable expressionAssignable, WTContainerRef containerRef, boolean showDescription) throws Exception
      Get the display expression for this ExpressionAssignable in this container.

      Supported API: true
      Parameters:
      expressionAssignable - objects that can have expressions assigned like Part, Links etc.
      containerRef - the container reference
      showDescription - if flag is true then it shows descriptions along with expression string.
      Returns:
      returns a json string with display and invalid keys { display: "display value", invalid: true/false }
      Throws:
      Exception
    • getDisplayExpression

      public static String getDisplayExpression(Expressionable expressionable, WTContainerRef containerRef) throws Exception
      Get the display expression for this Expressionable in this container.

      Supported API: true
      Parameters:
      expressionable - objects that can have expressions assigned to them like Part, Links, occurrence etc
      containerRef - the container reference
      Returns:
      returns a json string with display and invalid keys { display: "display value", invalid: true/false }
      Throws:
      Exception
    • getDisplayExpression

      public static String getDisplayExpression(Expressionable expressionable, WTContainerRef containerRef, boolean showDescription) throws Exception
      Get the display expression for this Expressionable in this container.

      Supported API: true
      Parameters:
      expressionable - objects that can have expressions assigned to to like Part, Links etc
      containerRef - the container reference
      showDescription - if flag is true then it shows descriptions along with expression string.
      Returns:
      returns a json string with display and invalid keys { display: "display value", invalid: true/false }
      Throws:
      Exception