Class ProcessVariable

All Implemented Interfaces:
com.appiancorp.core.expr.portable.PortableNamedTypedValue, com.appiancorp.core.expr.portable.PortableNamedTypedValueWithChildren, com.appiancorp.core.expr.portable.PortableTypedValue, com.appiancorp.process.runtime.forms.FormParameter, DeepCloneable, JSONable, JSONCacheable, XMLable, AppianTypeHolder, TypedVariableTypes, Validatable, AppianType, com.appiancorp.type.ExpressionableNamedTypedValue, com.appiancorp.type.HasTypeRef, com.appiancorp.type.NamedType, Serializable, Cloneable, Comparable
Direct Known Subclasses:
ProcessVariableInstance

public class ProcessVariable extends TypedVariable implements com.appiancorp.process.runtime.forms.FormParameter, Comparable, Validatable, JSONCacheable, DeepCloneable, com.appiancorp.type.ExpressionableNamedTypedValue
A variable that is global to a process. The set of process variables for a process is a superset of the process parameters. A process parameter is merely a process variable with the parameter attribute set to true. Process variables can be used as default values of ActivityClassParameters, and the value of an ActivityClassParameter can be stored in a process variable after the execution of an activity. Note: When setting the value of ProcessVariable of type User, do not set the value to a User object, but rather the username (User.getUsername()).
See Also:
  • Field Details

    • SORT_BY_KEY

      public static final Integer SORT_BY_KEY
    • SORT_BY_TYPE

      public static final Integer SORT_BY_TYPE
    • SORT_BY_PARAMETER

      public static final Integer SORT_BY_PARAMETER
    • SORT_BY_REQUIRED

      public static final Integer SORT_BY_REQUIRED
    • SORT_BY_HIDDEN

      public static final Integer SORT_BY_HIDDEN
    • SORT_BY_ID

      public static final Integer SORT_BY_ID
    • SORT_BY_VALUE

      public static final Integer SORT_BY_VALUE
    • SORT_BY_MULTIPLE

      public static final Integer SORT_BY_MULTIPLE
  • Constructor Details

    • ProcessVariable

      public ProcessVariable()
    • ProcessVariable

      public ProcessVariable(NamedTypedValue ntv_)
  • Method Details

    • getHiddenAttributes

      public HashSet getHiddenAttributes()
      Description copied from interface: JSONable
      Returns the set of attributes (properties) that should not be included in the JSON representation of the object.
      Specified by:
      getHiddenAttributes in interface JSONable
      Overrides:
      getHiddenAttributes in class TypedVariable
      Returns:
      the set of hidden attributes
    • clone

      public Object clone()
      Clone this object.
      Specified by:
      clone in interface DeepCloneable
      Overrides:
      clone in class TypedValue
      Returns:
    • isHidden

      public boolean isHidden()
      True if the process variable is hidden from the parent process
      Returns:
      if this process variable is hidden from its parent process
    • setHidden

      public void setHidden(boolean hidden_)
      Sets whether or not the variable is hidden from its parent process
      Parameters:
      hidden_ - true if this process variable will be hidden from its parent process
    • getMutable

      public Long getMutable()
      The default implementation always returns Validatable.MUTABLE_BY_END_USER. This means that unless this method is overriden all process variables can be changed by the end user.
      Specified by:
      getMutable in interface Validatable
      Returns:
      Validatable.MUTABLE_BY_END_USER.
      See Also:
    • getXMLWrapperName

      protected String getXMLWrapperName()
      Returns the xmlWrapperName for a ProcessVariable. Only used internally.
      Overrides:
      getXMLWrapperName in class TypedVariable
    • isParameter

      public boolean isParameter()
      Retrieves whether or not this ProcessVariable is a parameter of the process
      Returns:
      true if the process variable is a parameter else false
    • setParameter

      public void setParameter(boolean parameter_)
      Sets whether or not this process variabe is a parameter
      Parameters:
      parameter_ - whether this process variable is a parameter
    • getNullable

      public Long getNullable()
      If this variable is not a parameter, or is a parameter but is not required, then it is NULLABLE_BY_ALL. Otherwise, it is NULLABLE_NOT_AT_ALL.
      Specified by:
      getNullable in interface Validatable
      Returns:
      whether or not the parameter needs a default value.
    • getValidationMessages

      public List getValidationMessages()
      Retrieves a list of String objects that contain validation messages for the process variable
      Specified by:
      getValidationMessages in interface com.appiancorp.process.runtime.forms.FormParameter
      Specified by:
      getValidationMessages in interface Validatable
      Returns:
      list of validation messages for this process variable
    • addValidationMessage

      public void addValidationMessage(String message_)
      Adds the given String validation message to the collection of validation messages for the process variable
      Specified by:
      addValidationMessage in interface com.appiancorp.process.runtime.forms.FormParameter
      Specified by:
      addValidationMessage in interface Validatable
      Parameters:
      message_ - validation message that is added to the list of messages
    • clearValidationMessages

      public void clearValidationMessages()
      Clears all validation messages from this process variable
      Specified by:
      clearValidationMessages in interface Validatable
    • addAllMessages

      public void addAllMessages(List newMessages)
      Adds new validation messages to this process variable.
      Specified by:
      addAllMessages in interface Validatable
      Parameters:
      newMessages - validation messages
    • isRequired

      public boolean isRequired()
      This property is used only if the process variable is a parameter.
      Specified by:
      isRequired in interface com.appiancorp.process.runtime.forms.FormParameter
      Returns:
      true if this a parameter and is required, false if it is a parameter and not required, and an undefined value if it is not a parameter.
    • setRequired

      public void setRequired(boolean required_)
      Sets if the process variable is required. The process variable should be set to required only when its a parameter and is required at the start of the process.
      Specified by:
      setRequired in interface com.appiancorp.process.runtime.forms.FormParameter
      Parameters:
      required_ - sets if the process variable is required
    • getFriendlyName

      public String getFriendlyName()
      Gets the name of this variable, which is the same as getKey.
      Specified by:
      getFriendlyName in interface Validatable
      Returns:
      String name of this process variable
    • compareTo

      public int compareTo(Object o1_)
      Specified by:
      compareTo in interface Comparable
    • getExpression

      public String getExpression()
      The expression that represents the default value of this process variable.
      Specified by:
      getExpression in interface com.appiancorp.type.ExpressionableNamedTypedValue
      Returns:
    • setExpression

      public void setExpression(String expression_)
      This expression represents the default value of a process variable. It should only be set at design time and is only evaluated when retrieving the process model parameters, NOT when starting the process.
      Specified by:
      setExpression in interface com.appiancorp.type.ExpressionableNamedTypedValue
      Parameters:
      expression_ - default expression value for the process variable