Class TypedVariable

All Implemented Interfaces:
com.appiancorp.core.expr.portable.PortableNamedTypedValue, com.appiancorp.core.expr.portable.PortableNamedTypedValueWithChildren, com.appiancorp.core.expr.portable.PortableTypedValue, DeepCloneable, JSONable, JSONCacheable, XMLable, AppianTypeHolder, TypedVariableTypes, AppianType, com.appiancorp.type.HasTypeRef, com.appiancorp.type.NamedType, Serializable, Cloneable
Direct Known Subclasses:
ActivityClassParameterSchema, GenericTypedVariable, Mapping, ProcessVariable

@Deprecated public class TypedVariable extends NamedTypedValue implements XMLable, AppianTypeHolder, Serializable, TypedVariableTypes, DeepCloneable, com.appiancorp.core.expr.portable.PortableNamedTypedValueWithChildren
Deprecated.
Use the class NamedTypedValue instead.
Base class for the parameters and variables in the system. Generally, a typed variable is a binding between a key and a value, with the additional attribute of a type giving context to the value. The key is really the name of the value, and the type tells clients how the value object should be interpreted. A GROUP and a DOCUMENT, for example, both have values that are numbers (Long primary keys). The type can be compared to one of the constants in this class to determine the proper semantics of the value. A lot of utility methods are included in this class to help validate types and manage the relationships among typed variables.
See Also:
  • Field Details

    • classType$TRANSIENT

      public static final boolean classType$TRANSIENT
      Deprecated.
      See Also:
    • dataType$TRANSIENT

      public static final boolean dataType$TRANSIENT
      Deprecated.
      See Also:
    • detailedTypes$TRANSIENT

      public static final boolean detailedTypes$TRANSIENT
      Deprecated.
      See Also:
    • multipleSupportingType$TRANSIENT

      public static final boolean multipleSupportingType$TRANSIENT
      Deprecated.
      See Also:
    • displayName$TRANSIENT

      public static final boolean displayName$TRANSIENT
      Deprecated.
      See Also:
    • MAX_TYPE

      public static final int MAX_TYPE
      Deprecated.
      See Also:
    • LOCAL_USER

      public static final int LOCAL_USER
      Deprecated.
    • LOCAL_GROUP

      public static final int LOCAL_GROUP
      Deprecated.
    • LOCAL_DOCUMENT

      public static final int LOCAL_DOCUMENT
      Deprecated.
    • LOCAL_FOLDER

      public static final int LOCAL_FOLDER
      Deprecated.
    • LOCAL_PORTLET

      public static final int LOCAL_PORTLET
      Deprecated.
    • LOCAL_PAGE

      public static final int LOCAL_PAGE
      Deprecated.
    • LOCAL_FORUM

      public static final int LOCAL_FORUM
      Deprecated.
    • LOCAL_TOPIC

      public static final int LOCAL_TOPIC
      Deprecated.
    • LOCAL_MESSAGE

      public static final int LOCAL_MESSAGE
      Deprecated.
    • LOCAL_KC

      public static final int LOCAL_KC
      Deprecated.
    • LOCAL_COMMUNITY

      public static final int LOCAL_COMMUNITY
      Deprecated.
    • LOCAL_PM

      public static final int LOCAL_PM
      Deprecated.
    • LOCAL_PROCESS

      public static final int LOCAL_PROCESS
      Deprecated.
    • LOCAL_TASK

      public static final int LOCAL_TASK
      Deprecated.
    • LOCAL_NODE

      public static final int LOCAL_NODE
      Deprecated.
    • LOCAL_EMAIL_ADDRESS

      public static final int LOCAL_EMAIL_ADDRESS
      Deprecated.
  • Constructor Details

    • TypedVariable

      public TypedVariable()
      Deprecated.
      Creates an instance.
    • TypedVariable

      public TypedVariable(NamedTypedValue ntv)
      Deprecated.
      Creates an instance and sets the instance type and value to the instance type and value of the provided NamedTypedValue.
      Parameters:
      ntv - a NamedTypedValue containing the instance type and value to set for the newly created TypedVariable
    • TypedVariable

      public TypedVariable(TypedValue tv)
      Deprecated.
      Creates an instance and sets the instance type and value to the instance type and value of the provided TypedValue.
      Parameters:
      tv - a TypedValue containing the instance type and value to set for the newly created TypedVariable
  • Method Details

    • getTypedVariables

      public static TypedVariable[] getTypedVariables(NamedTypedValue[] ntvs)
      Deprecated.
    • getHiddenAttributes

      public HashSet getHiddenAttributes()
      Deprecated.
      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 TypedValue
      Returns:
      the set of hidden attributes
    • getKey

      @Deprecated public String getKey()
      Deprecated.
      Returns the name of the typed variable. Identical to NamedTypedValue.getName() - originally, a typed variable was a key/value binding, hence the name is called "key".
    • setKey

      @Deprecated public void setKey(String key_)
      Deprecated.
      use NamedTypedValue#setName()
    • getDetailedTypes

      public int[] getDetailedTypes()
      Deprecated.
      If the underlying representation of this typed variable is an array, returns the types of the objects contained in the array. For example, if the type of the TypedVariable is PEOPLE and the value contains 2 groups and 3 users, this method will return an array of size 5, where the first two elements are GROUP and the next 3 are USER.
      Returns:
      An array of types (type constants defined by this class).
    • convertFromLocalObjectType

      public static int convertFromLocalObjectType(int localObjectType)
      Deprecated.
      Convert LocalObject type to Standard type
      Parameters:
      localObjectType - The ObjectTypeMapping type from the LocalObject
      Returns:
      The corresponding AppianType
    • setValue

      public void setValue(Object value)
      Deprecated.
      Description copied from class: TypedValue
      Sets the value of the typed variable.
      Overrides:
      setValue in class TypedValue
      Parameters:
      value - The value to set the typed variable to.
    • setDetailedTypes

      public void setDetailedTypes(int[] detailedTypes_)
      Deprecated.
    • isAppianType

      public static boolean isAppianType(int tvType_)
      Deprecated.
      Determines whether the given type is an Appian Type (an Appian Type is any type that has a corresponding TYPE_XXX constant defined in ObjectTypeMapping).
      Parameters:
      tvType_ - The type to check.
      Returns:
      true if the passed type is an Appian Type, and false otherwise
    • isValidType

      @Deprecated public static boolean isValidType(int type_)
      Deprecated.
      use TypeService
      Determines whether the given type is a valid type.
      Parameters:
      type_ - The type to check.
      Returns:
      true if the passed type is a valid type, and false otherwise
    • isNotDeferred

      public static boolean isNotDeferred(int type_)
      Deprecated.
      Determines whether the given type is not a deferred type. A deffered type is a variable whose type cannot be determined until design time (determining the type is deffered until design time, such as for the type of the answer in a Multiple Questions process model node).
      Parameters:
      type_ - The type to check.
      Returns:
      true if type is NOT deferred, and false otherwise
    • toXML

      public String toXML()
      Deprecated.
      Converts a typed variable to XML.
      Specified by:
      toXML in interface XMLable
      Returns:
      The typed variable as a string of XML.
    • getXMLWrapperName

      protected String getXMLWrapperName()
      Deprecated.
    • getXMLWrapperStart

      protected final String getXMLWrapperStart()
      Deprecated.
      Returns:
      The xml wrapper start of a typed variable.
    • getXMLWrapperEnd

      protected final String getXMLWrapperEnd()
      Deprecated.
      Returns:
      The xml wrapper end of a typed variable.
    • toXML

      public void toXML(StringBuilder buffer_)
      Deprecated.
      Appends the XML representation of this typed variable to the given buffer.
      Specified by:
      toXML in interface XMLable
      Parameters:
      buffer_ - The buffer to which the typed variable should be appended.
    • toString

      public String toString(String[] input_)
      Deprecated.
      Converts an array of Strings in to a single String containing a comma-separated list of the passed strings.
    • getScalarTypedObject

      public static Object getScalarTypedObject(String val_, Long nType_, Long detailedType_, ServiceContext sc_)
      Deprecated.
      Converts the given String to an object of the given type.
      Parameters:
      val_ - The string representation of a value.
      nType_ - A constant representing the type to which val_ should be converted. This type MUST be a scalar, ie not XXX_ARRAY.
      detailedType_ - The type of the sub-object, which is only useful if the underlying class is a LocalObject (ie for PEOPLE and CONTENT types). Otherwise, the parameter is ignored and can be set to null.
      Returns:
      The object of the passed type and containing the passed value.
      Throws:
      IllegalArgumentException - if nType_ is invalid, not scalar, or DEFERRED or BEAN
    • getScalarTypedObject

      @Deprecated public static Object getScalarTypedObject(String val_, Long nType_, Long detailedType_, com.appiancorp.asl3.servicefw.connect.ServiceContext sc_)
      Deprecated.
      since 6.0.3
      Converts the given String to an object of the given type.
      Parameters:
      val_ - The string representation of a value.
      nType_ - A constant representing the type to which val_ should be converted. This type MUST be a scalar, ie not XXX_ARRAY.
      detailedType_ - The type of the sub-object, which is only useful if the underlying class is a LocalObject (ie for PEOPLE and CONTENT types). Otherwise, the parameter is ignored and can be set to null.
      Returns:
      The object of the passed type and containing the passed value.
      Throws:
      IllegalArgumentException - if nType_ is invalid, not scalar, or DEFERRED or BEAN
    • getTypedObjects

      public static Object[] getTypedObjects(String[] values_, Long nType_, int[] detailedTypes_, ServiceContext sc_)
      Deprecated.
      Converts the given Strings to objects of the given type.
      Parameters:
      values_ - The strings representing the values.
      nType_ - A constant representing the type to which each of the passed values should be converted. This type MUST be a scalar, i.e. not XXX_ARRAY.
      detailedTypes_ - The types of the sub-objects, which are only useful if the underlying class is a LocalObject (i.e. for PEOPLE and CONTENT types). Otherwise, the parameter is ignorred and can be set to null.
      Returns:
      The objects of the passed type and containing the passed values.
      Throws:
      IllegalArgumentException - if nType_ is invalid, not scalar, or DEFERRED or BEAN
    • getTypedObjectsFromUiInput

      public static Object[] getTypedObjectsFromUiInput(String[] values_, Long nType_, int[] detailedTypes_, ServiceContext sc_)
      Deprecated.
    • getTypedObjectFromUiInput

      public static Object getTypedObjectFromUiInput(String value_, Long nType_, Long detailedType_, ServiceContext sc_)
      Deprecated.
    • getNumericTypedObjectFromUiInput

      public static Object getNumericTypedObjectFromUiInput(String value_, Long nType_, ServiceContext sc_)
      Deprecated.
    • putOrAppendValue

      public void putOrAppendValue(String newValAsString_, ServiceContext sc_)
      Deprecated.
      Do not use this, as it is meant ONLY for web services.
    • putOrAppendTimestamp

      public void putOrAppendTimestamp(Timestamp ts_, ServiceContext sc_)
      Deprecated.
      Do not use this, as it is meant ONLY for web services.
    • appendFullName

      public void appendFullName(StringBuffer sb_)
      Deprecated.
      Appends the full name of this variable to the given buffer. The full name is the full name of the parent, if one exists, followed by a "." and the name of this variable.
      Parameters:
      sb_ - The buffer to append the name to.
    • findByName

      public static TypedVariable findByName(TypedVariable[] variables_, String name_)
      Deprecated.
      Finds the variable in the given array whose name corresponds to the given name. If no such variable can be found, returns null.
      Parameters:
      variables_ - The collection of variables to search.
      name_ - The name to look for.
      Returns:
      The variable in the collection whose name is a case-insensitive match for name_. If multiple values that meet this criterion exist (which they should not), the first match is returned. If no such value exists, or either parameter is null, null is returned.
    • findAllWithKeyPrefix

      public static TypedVariable[] findAllWithKeyPrefix(TypedVariable[] variables_, String name_)
      Deprecated.
      Finds all the variables in the given array whose name sarts with the passed name_ string. If no such variable(s) can be found or if either of the passed arguments is null, returns null.
      Parameters:
      variables_ - The collection of variables to search.
      name_ - The name search string.
      Returns:
      The variable(s) in the collection whose name starts with name_ (case-insensitive). If no such variable is found, or if either argument is null, null is returned.
    • children

      public TypedVariable[] children()
      Deprecated.
      If the type of the variable is BEAN, returns an array of ACPs (Activity Class Parameters) that are the fields of the bean. If the type of the variable is BEAN_ARRAY, returns an array of the ACPs that are the cells in the array. Otherwise, returns null. Note that this is not a getXXX method, so as not to be confused with a property.
      Specified by:
      children in interface com.appiancorp.core.expr.portable.PortableNamedTypedValueWithChildren
      Returns:
      The typed variables representing the ACPs.
    • integerToLong

      protected static Long integerToLong(Integer i_)
      Deprecated.
    • getUnderlyingClass

      @Deprecated public static Class getUnderlyingClass(Long type_, boolean multiple_)
      Deprecated.
      see TypeClassResolver#getTypeClass(Long)
      Determines the class that best represents the type of >value. For most types, this is Long.class, but for USER and STRING it is String.class, for DATE is java.sql.Date.class, for TIME is java.sql.Time.class, for DATETIME is java.sql.Timestamp.class, and for arrays it is the array type that corresponds to an array of the scalar type, such as Long[].class.
      Parameters:
      type_ - The type to check, which is one of the type constants defined by this class.
      multiple_ - Whether to get the class for the array version of the type.
      Returns:
      The underlying class for the given type.
    • getTypeForClass

      public static Long getTypeForClass(Class class_)
      Deprecated.
      Returns the TypedVariable type for a given class.
      Parameters:
      class_ - A class.
      Returns:
      The TypedVariable type corresponding to the passed class, which is a Long version of one of the type constants defined by this class. If the passed class is unknown, returns DEFERRED.
    • getDefaultValue

      public static Object getDefaultValue(Long type_, boolean multiple_)
      Deprecated.
      Returns the default value for the given type. The back end does not allow null values, so clients should set value to this instead. For type STRING, the default is empty string, for LONGs it is 0, and for arrays, it is a 0-length array. For timestamps, the default is the current time. There is no default value for DEFERRED, BEAN and BEAN_ARRAY, so this method returns null (which will cause an exception if you try to store it).
      Parameters:
      type_ - A type, which is one of the type constants defined by this class.
      Returns:
      The default value for the passed type.
    • getDefaultPvValue

      public static Object getDefaultPvValue(Long type_, boolean multiple_)
      Deprecated.
      Returns the default value for a ProcessVariable of the given type. For most types this is null, unless multiple_ is true, in which case the value is a 0-length array. For type LONG, the default value is 0, for DOUBLE it is 0.0, and for STRING it is "". There is no default value for DEFERRED, BEAN and BEAN_ARRAY, so this method returns null (which will cause an exception if you try to store it).
      Parameters:
      type_ - A type, which is one of the type constants defined by this class.
      multiple_ - Whether or not the variable is an array.
      Returns:
      The default value for the passed type.
    • fillInAppianTypes

      public void fillInAppianTypes(AppianTypeCache cache_)
      Deprecated.
      If this typed variable is an Appian Type, adds its primary key to the cache.
      Specified by:
      fillInAppianTypes in interface AppianTypeHolder
      Parameters:
      cache_ - The cache to add to.
    • computeValueString

      public String computeValueString(ServiceContext sc_)
      Deprecated.
      Computes the string representation of the value of this typed variable, which should be shown to the user. For most types, this is just the number. For arrays, it is a CSV (comma-separated values string), and for time types it is a nicely formatted date or time. If the type is a String[], the CSV for the array does not quote the strings in the array; for example, an array of users whose usernames are payton.manning and brett.favre would result in the string "payton.manning,brett.favre" which can be fed to a picker as a value.
      Returns:
      The string representation of the value of the typed variable.
    • computeValueStringForUiOutput

      public String computeValueStringForUiOutput(ServiceContext sc_, boolean wrapInQuotes_, boolean escapeXml_)
      Deprecated.
    • computeDisplayString

      @Deprecated public String computeDisplayString(ServiceContext sc_)
      Deprecated.
      Use either computeValueString(ServiceContext), or computeValueStringForUiOutput(ServiceContext, boolean, boolean). This is the same as #computeValueString() except that if the type is a String[], the CSV for the array does have quotes around the individual strings in the array; for example, an array of users whose usernames are payton.manning and brett.favre would result in the string ""payton.manning","brett.favre"".
      Returns:
      The string representation of the value of the typed variable.
    • computeDisplayString

      public String computeDisplayString(AppianTypeCache cache_)
      Deprecated.
      This is the same as #computeDisplayString(), except that the passed cache is used to get the display value (so that for an Appian Type, a user-friendly string is returned; for exmple, "Technology" instead of a number for a GROUP).
      Parameters:
      cache_ - The cache to use to look up the typed variable value.
      Returns:
      The display value of the typed variable, as it is stored in the passed cache, or null if this typed variable is not an Appian Type.
    • handleTimestampValue

      protected static String handleTimestampValue(Date value_, int type_, ServiceContext sc_)
      Deprecated.
    • handleTimestampValueForUiOutput

      protected static String handleTimestampValueForUiOutput(Date value_, int type_, ServiceContext sc_)
      Deprecated.
    • renderArrayAsCsv

      @Deprecated public static String renderArrayAsCsv(Object[] values_, boolean wrapInQuotes_, int type_, ServiceContext sc_)
      Deprecated.
      Use either renderArrayAsCsv(Object[], boolean, boolean, int, ServiceContext) or renderArrayAsCsv(Object[], boolean, boolean, int, ServiceContext, char). Transforms the given aray into a single string containing a comma-separated list of the array values.
      Parameters:
      values_ - The array of values to convert to a CSV string.
      isString_ - Whether the objects are Strings, in which case they will be surrounded by quotes. The quotes that are used are XML-escaped (ie they are ").
      type_ - the type of the things being rendered, as one of the type contants such as DATE or LONG. Currently, the type is only used to determine the format with which to render timestamp values.
    • renderArrayAsCsv

      public static String renderArrayAsCsv(Object[] values_, boolean wrapInQuotes_, int type_, ServiceContext sc_, int multiple)
      Deprecated.
    • renderArrayAsCsv

      public static String renderArrayAsCsv(Object[] values_, boolean wrapInQuotes_, boolean escapeXml_, int type_, ServiceContext sc_)
      Deprecated.
      Transforms the given array into a single sting containing a comma-separated list of the array values.
      Parameters:
      values_ - The array of values to convert to a CSV string.
      wrapInQuotes_ - Whether or not the objects are Strings, in which case they will be surrounded by quotes.
      escapeXml_ - Whether to escape the quotes (which are only used if isString_ is true). If false, the " symbol will be used to surround the strings, otherwise " is used.
      type_ - the type of the things being rendered, as one of the type contants such as DATE or LONG. Currently, the type is only used to determine the format with which to render timestamp values.
    • renderArrayAsCsv

      public static String renderArrayAsCsv(Object[] values_, boolean wrapInQuotes_, boolean escapeXml_, int type_, ServiceContext sc_, int multiple)
      Deprecated.
    • renderArrayAsString

      public static String renderArrayAsString(Object[] values_, boolean wrapInQuotes_, boolean escapeXml_, int type_, ServiceContext sc_, String delim_, int multiple)
      Deprecated.
    • renderArrayAsCsvForUiOutput

      public static String renderArrayAsCsvForUiOutput(Object[] values_, boolean wrapInQuotes_, boolean escapeXml_, int type_, ServiceContext sc_)
      Deprecated.
    • getClassType

      public int getClassType()
      Deprecated.
      Gets the type classification of this typed variable.
      Returns:
      One of the TypeDescriptor.CLASS_XXX constants, or CLASS_NONE if the type is not recognized.
    • getDataType

      public int getDataType()
      Deprecated.
      Gets the underlying datatype of this typed variable.
      Returns:
      One of the TypeDescriptor.DATATYPE_XXX constants, or DATATYPE_UNKNOWN if the type is not recognized.
    • isMultipleSupportingType

      public boolean isMultipleSupportingType()
      Deprecated.
      Determines whether the type of this variable could support multiple values. Note that if the answer is yes (true), this does NOT mean that this instance supports multiple values. If the type is not recognized, this method returns true by default.
    • appendLocalObject

      protected static void appendLocalObject(StringBuffer sb_, LocalObject local_)
      Deprecated.
    • appendLocalObject

      protected static void appendLocalObject(StringBuilder sb_, LocalObject local_)
      Deprecated.
    • appendLocalObjects

      protected static void appendLocalObjects(StringBuffer sb_, LocalObject[] locals_)
      Deprecated.
    • appendLocalObjects

      protected static void appendLocalObjects(StringBuilder sb_, LocalObject[] locals_)
      Deprecated.
    • getTypeFromObjectTypeMappingType

      public static int getTypeFromObjectTypeMappingType(int otmType_)
      Deprecated.
      Returns the TypedVariable type corresponding to a given ObjectTypeMapping type.
      Parameters:
      otmType_ - The ObjectTypeMapping type, defined by one of the TYPE_XXX in the ObjectTypeMapping class.
      Returns:
      A TypedVariable type which is one of the type constants defined by this class.
    • getObjectTypeMappingFromType

      public static int getObjectTypeMappingFromType(int tvType_)
      Deprecated.
    • externalize

      public static String externalize(Object value_, Long type_, boolean multiple_)
      Deprecated.
      Convert the data passed in to the externalized (String) format
      Parameters:
      value_ - the value to convert
      type_ - the TypedVariable type to convert to
      multiple_ - whether the type can hold multiple values
      Returns:
      the externalized String
    • externalize

      public static String externalize(TypedValue tv)
      Deprecated.
    • internalize

      public static TypedVariable internalize(String externalized)
      Deprecated.
      Interalizes the externalized String passed in
      Parameters:
      externalized - the externalized String
      Returns:
      a TypedVariable representation of the data encoded into the externalized String
    • getInstanceClass

      public static Class getInstanceClass(Long type_)
      Deprecated.
    • getMultiple

      @Deprecated public int getMultiple()
      Deprecated.
      To determine if a type is multiple or not, retrieve its Datatype or DatatypeProperties bean via TypeService and use DatatypeProperties.isListType().
      Determines whether this instance supports multiple values. The value should be NEVER or ALWAYS.
      Returns:
      One of NEVER or ALWAYS.
    • setMultiple

      @Deprecated public void setMultiple(int multiple)
      Deprecated.
      Set the instance type instead. The instance type contains the multiple information within it.
      This sets instanceType as necessary. See getMultiple().
    • getType

      @Deprecated public Long getType()
      Return the type of the typed variable, which is one of the constants defined by this class.
    • setType

      @Deprecated public void setType(Long type)
      Deprecated.
      use TypedValue#setInstanceType()
      This sets instanceType as necessary. See getType().
    • setTypeMultiple

      @Deprecated public void setTypeMultiple(Long type, int multiple)
      Deprecated.
    • setInstanceType

      public final void setInstanceType(Long instanceType)
      Deprecated.
      Sets the instance type of the typed value. This is used in preference to type and multiple; it will set type and multiple as necessary for backward compatibility.
      Overrides:
      setInstanceType in class TypedValue
      Parameters:
      instanceType - The instance type id, which corresponds to a Datatype. Built-in datatype ids are defined in AppianType