filenet.vw.api

Class VWFieldType

  • java.lang.Object
    • filenet.vw.api.VWFieldType


  • public final class VWFieldType
    extends java.lang.Object
    Use this class to determine the data field types available in a workflow. You can validate a field type value or validate and retrieve the field type of an object.

    The methods of this class perform the following:

    • Validate a field type value.
    • Retrieve the field type of an object.
    • Validate that an object has a valid field type.
    Since:
    VWWS3.10
    See Also:
    VWParameter, VWParameterDefinition, VWExposedFieldDefinition, VWDataField, VWFieldDefinition
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int ALL_FIELD_TYPES
      Integer value representing the result of the following field values combined by using a bitwise OR operation on the following: component file types: FIELD_TYPE_INT, FIELD_TYPE_STRING, FIELD_TYPE_BOOLEAN, FIELD_TYPE_FLOAT, FIELD_TYPE_TIME, FIELD_TYPE_ATTACHMENT, FIELD_TYPE_PARTICIPANT, FIELD_TYPE_XML.
      static int BASIC_FIELD_TYPES
      Integer value representing the result of the following basic field values combined by using a bitwise OR operation on the following: component file types: FIELD_TYPE_INT, FIELD_TYPE_STRING, FIELD_TYPE_BOOLEAN, FIELD_TYPE_FLOAT, FIELD_TYPE_TIME.
      static int FIELD_TYPE_ATTACHMENT
      Value of 32. Indicates a workflow field of type Attachment(an attached document).
      static int FIELD_TYPE_BOOLEAN
      Value of 4. Indicates a workflow field of type java.lang.Boolean.
      static int FIELD_TYPE_FLOAT
      Value of 8. Indicates a workflow field of type java.lang.Float, java.lang.Double, or java.lang.Long.
      static int FIELD_TYPE_GUID
      Value of 512. Indicates a workflow field of type guid.
      static int FIELD_TYPE_INT
      Value of 1. Indicates a workflow field of type java.lang.Integer or java.lang.Short.
      static int FIELD_TYPE_PARTICIPANT
      Value of 64. Indicates a workflow field of type participant.
      static int FIELD_TYPE_STRING
      Value of 2. Indicates a workflow field of type java.lang.String.
      static int FIELD_TYPE_TIME
      Value of 16. Indicates a workflow field of type java.util.Date.
      static int FIELD_TYPE_XML
      Value of 128. Indicates a workflow field of type XML.
      static int FIELD_TYPEDEF_TIME32
      Deprecated. 
      for creation. Use FIELD_TYPEDEF_TIME instead. All times created in P8 4.6.0 are 64 bit.
      static int FIELD_TYPEDEF_TIME64
      Deprecated. 
      for creation. Use FIELD_TYPEDEF_TIME instead. All times created in P8 4.6.0 are 64 bit.
      static int MAX_IDENTIFIER_LENGTH
      Maximum field and index name length
      static java.lang.String TIME_MASK
      Default date time mask "MM/dd/yyyy HH:mm:ss".
    • Constructor Summary

      Constructors 
      Constructor and Description
      VWFieldType() 
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static java.lang.String getLocalizedDefinitionString(int theFieldDefinitionType)
      Deprecated. 
      static java.lang.String getLocalizedString(int theFieldType)
      Retrieves the localized string containing the value of the field type.
      static int getVWFieldType(java.lang.Object theValue)
      Gets the field type of the passed object.
      static boolean isValid(int fieldType)
      Validates an integer to insure that it is valid field type.
      static boolean isValid(java.lang.Object theValue)
      Validates whether the passed object type matches one of valid the field types.
      static boolean isValidName(java.lang.String theName)
      Validates the input string as a properly formed field name.
      static int lValue(java.lang.String theExpr, VWWorkflowSignature theSig, VWWorkflowDefinition theWF)
      Determines whether an expression is a valid as an array or single value on the left (target) side of an assignment statement.
      static int stringToType(java.lang.String fieldType)
      Returns a field type for an ascii string representing the field type, or throws an exception if the string doesn't match a field type.
      static java.lang.Object stringToValue(java.lang.String theString, int theType, boolean isArray)
      Returns an object or an array of objects of the specified type, as denoted by an input String.
      static java.lang.String typeToString(int fieldType)
      Returns a string which is the ascii representation of the field type.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • FIELD_TYPE_INT

        public static final int FIELD_TYPE_INT
        Value of 1. Indicates a workflow field of type java.lang.Integer or java.lang.Short. A type of java.lang.Short is converted to java.lang.Integer and mapped to FIELD_TYPE_INT.
        See Also:
        Constant Field Values
      • FIELD_TYPE_STRING

        public static final int FIELD_TYPE_STRING
        Value of 2. Indicates a workflow field of type java.lang.String.
        See Also:
        Constant Field Values
      • FIELD_TYPE_BOOLEAN

        public static final int FIELD_TYPE_BOOLEAN
        Value of 4. Indicates a workflow field of type java.lang.Boolean.
        See Also:
        Constant Field Values
      • FIELD_TYPE_FLOAT

        public static final int FIELD_TYPE_FLOAT
        Value of 8. Indicates a workflow field of type java.lang.Float, java.lang.Double, or java.lang.Long. A type of java.lang.Double or java.lang.Long is converted to java.lang.Float and mapped to FIELD_TYPE_INT.
        See Also:
        Constant Field Values
      • FIELD_TYPE_TIME

        public static final int FIELD_TYPE_TIME
        Value of 16. Indicates a workflow field of type java.util.Date.
        See Also:
        Constant Field Values
      • FIELD_TYPE_ATTACHMENT

        public static final int FIELD_TYPE_ATTACHMENT
        Value of 32. Indicates a workflow field of type Attachment(an attached document).
        See Also:
        VWAttachment, Constant Field Values
      • FIELD_TYPE_PARTICIPANT

        public static final int FIELD_TYPE_PARTICIPANT
        Value of 64. Indicates a workflow field of type participant.
        See Also:
        VWParticipant, Constant Field Values
      • FIELD_TYPE_XML

        public static final int FIELD_TYPE_XML
        Value of 128. Indicates a workflow field of type XML.
        See Also:
        VWXMLData, Constant Field Values
      • FIELD_TYPEDEF_TIME32

        public static final int FIELD_TYPEDEF_TIME32
        Deprecated. for creation. Use FIELD_TYPEDEF_TIME instead. All times created in P8 4.6.0 are 64 bit.
        Value of 16. only for use with VWExposedFieldDefinition. Indicates an exposed field of type java.util.Date. This exposed field type contains values that may not be valid past GMT 03:14:07, Tuesday, January 19, 2038 because the database column representation on the server is 32 bits in length.
        Since:
        P8 4.0.3
        See Also:
        Constant Field Values
      • FIELD_TYPEDEF_TIME64

        public static final int FIELD_TYPEDEF_TIME64
        Deprecated. for creation. Use FIELD_TYPEDEF_TIME instead. All times created in P8 4.6.0 are 64 bit.
        Value of 256. only for use with VWExposedFieldDefinition. Indicates an exposed field of type java.util.Date. This exposed field type contains values that will be valid past GMT 03:14:07, Tuesday, January 19, 2038 because the database column representation on the server is 64 bits in length.
        Since:
        P8 4.0.3
        See Also:
        Constant Field Values
      • FIELD_TYPE_GUID

        public static final int FIELD_TYPE_GUID
        Value of 512. Indicates a workflow field of type guid.
        See Also:
        VWGuid, Constant Field Values
      • BASIC_FIELD_TYPES

        public static final int BASIC_FIELD_TYPES
        Integer value representing the result of the following basic field values combined by using a bitwise OR operation on the following: component file types: FIELD_TYPE_INT, FIELD_TYPE_STRING, FIELD_TYPE_BOOLEAN, FIELD_TYPE_FLOAT, FIELD_TYPE_TIME. This type is used for API calls that retrieve multiple fields or parameters of basic types.
        See Also:
        Constant Field Values
      • ALL_FIELD_TYPES

        public static final int ALL_FIELD_TYPES
        Integer value representing the result of the following field values combined by using a bitwise OR operation on the following: component file types: FIELD_TYPE_INT, FIELD_TYPE_STRING, FIELD_TYPE_BOOLEAN, FIELD_TYPE_FLOAT, FIELD_TYPE_TIME, FIELD_TYPE_ATTACHMENT, FIELD_TYPE_PARTICIPANT, FIELD_TYPE_XML. This type is used for API calls that retrieve multiple fields or for input parameters of multiple types.
        See Also:
        Constant Field Values
      • TIME_MASK

        public static final java.lang.String TIME_MASK
        Default date time mask "MM/dd/yyyy HH:mm:ss".
        See Also:
        Constant Field Values
      • MAX_IDENTIFIER_LENGTH

        public static final int MAX_IDENTIFIER_LENGTH
        Maximum field and index name length
        See Also:
        Constant Field Values
    • Constructor Detail

      • VWFieldType

        public VWFieldType()
    • Method Detail

      • getLocalizedString

        public static java.lang.String getLocalizedString(int theFieldType)
                                                   throws VWException
        Retrieves the localized string containing the value of the field type.
        Parameters:
        theFieldType - An integer value associated with the field type value, in accord with the VWFieldType field summary.
        Returns:
        A String containing the localized data field type.
        Throws:
        VWException - Thrown if the field type is not valid.
      • getLocalizedDefinitionString

        public static java.lang.String getLocalizedDefinitionString(int theFieldDefinitionType)
                                                             throws VWException
        Deprecated. Use VWFieldType.getLocalizedString(int) instead
        Retrieves the localized string containing the value of the field definition type.
        Parameters:
        theFieldDefinitionType - An integer value associated with the field type value, in accord with the VWFieldType field summary.
        Returns:
        A String containing the localized data field type.
        Throws:
        VWException - Thrown if the field definition type is not valid.
      • isValidName

        public static boolean isValidName(java.lang.String theName)
        Validates the input string as a properly formed field name.

        Valid field names must conform with the following guidelines:

        • Begin with a lowercase or uppercase letter [a-z,A-Z].
        • Contain only letters [a-z, A-Z], digits [0-9], and underscores [_.
        • Have a length of 1 to 128 characters. Empty strings are invalid.
        • Begin with other than "f_" or "F_" (Names starting with "f_" or "F_" are reserved as system field names.)
        • Not match a reserved word used by the expression grammar.
        Parameters:
        theName - A string contain the field name value to be validated.
        Returns:
        A Boolean value: TRUE if the field name is valid; FALSE if the field name is invalid.
      • isValid

        public static boolean isValid(int fieldType)
        Validates an integer to insure that it is valid field type.
        Parameters:
        fieldType - An integer to be tested to see if it is a field type, as shown in the VWFieldType field summary.
        Returns:
        A Boolean value: TRUE if the fieldType parameter value is valid; FALSE if the fieldType parameter value is invalid.
      • isValid

        public static boolean isValid(java.lang.Object theValue)
        Validates whether the passed object type matches one of valid the field types.
        Parameters:
        theValue - An object to validate against the field types shown in the VWFieldType field summary.
        Returns:
        A Boolean value: TRUE if the object matches a valid field type; FALSE if null or if the object does not match a valid field type.
      • getVWFieldType

        public static int getVWFieldType(java.lang.Object theValue)
        Gets the field type of the passed object.
        Parameters:
        theValue - An object to check for a valid data type.
        Returns:
        An integer value associated with the field type that corresponds to the input object's type, as shown in the VWFieldType field summary, if the object has a valid field type. If the input object is null or does not have a valid field type, this method returns "-1".
      • stringToValue

        public static java.lang.Object stringToValue(java.lang.String theString,
                                     int theType,
                                     boolean isArray)
                                              throws VWException
        Returns an object or an array of objects of the specified type, as denoted by an input String. Value(s) shown in the String must represent literal values, not expressions.

        The String specified in the theString parameter must conform to the following formatting rules:

        • If the String contains String values, Attachment values, Participant values, or Time values, such a value must be bounded by double quote (") characters.
        • If the String contains bounding quotes (�), the bounded String value can include pairs of double quote ("") characters.
        • If isArray is true, separate the string values for each array member with a comma (",") character.
        Parameters:
        theString - An input String value to be parsed.
        theType - The integer value associated with the field type, as shown in the VWFieldType field summary.
        isArray - A Boolean value: TRUE if the input string represents an array of values; FALSE if the input string contains a single value.
        Returns:
        An object of the specified type, or an array of such objects. The method returns null if any among the following conditions occurs:

        • The value in the theType parameter is invalid.
        • The string is null.
        • The string length is zero (0).
        • The string contains an expression that the system cannot convert to an object. For example, the system cannot convert "SystemTime()" into a Java Date object, because the String contains a function call.
        Throws:
        VWException - Thrown if the specified object cannot be constructed from the supplied String and isArray flag input information.
      • typeToString

        public static java.lang.String typeToString(int fieldType)
                                             throws VWException
        Returns a string which is the ascii representation of the field type. Used for converting a field type into a string for generating XML.
        Parameters:
        fieldType - an int representing a valid field type.
        Throws:
        VWException - if the fieldType value is not a valid field type.
      • stringToType

        public static int stringToType(java.lang.String fieldType)
                                throws VWException
        Returns a field type for an ascii string representing the field type, or throws an exception if the string doesn't match a field type. Used for figuring out field types after reading in a type string from an XML file.
        Parameters:
        fieldType - a string representing a valid field type.
        Throws:
        VWException - if the string doesn't match a valid field type.
      • lValue

        public static int lValue(java.lang.String theExpr,
                 VWWorkflowSignature theSig,
                 VWWorkflowDefinition theWF)
                          throws VWException
        Determines whether an expression is a valid as an array or single value on the left (target) side of an assignment statement. This can provide validation to prepare for various assignments which occur in situations like single and compound step processing, wait-for-event processes, object creation, and parameter definition of "in/out" or "out" parameter definitions.
        Parameters:
        theExpr - An expression to be tested as a value on the left (target) side of an assignment statement.
        theSig - the signature of a work class containing field definitions to be used to evaluate whether the expression can be used on the left (target) side of an assignment statement. Such a signature could be a base work class signature, or in cases like assignments in wait for event, it could be the signature of the alternate work class. Null is a valid value for this argument.
        theWF - the workflow that contains the expression being validated, for looking up the list of valid fields. This parameter could be null if argument theSig is non-null and the assignment applies to an alternate work class field.
        Returns:
        An integer that belongs to one of the following groups of possibilities:

        • 0 if the expression is not a valid when used on the left (target) side of an assignment statement
        • A positive integer whose value represents a field type for the input expression, where the expression is valid on the left side of an assignment statement.
        • A negative integer whose absolute value represents the field type of the array denoted by the input expression, where the array is valid on the left side of an assignment statement.

        Note that valid field types are shown in the VWFieldType field summary.

        For example, where "I" is an integer field and "FA" is a float array field, An input expression "I + FA[1]" would return 0 (not an lvalue). Similarly the expression "I" would return the value of FIELD_TYPE_INT, and the expression "FA" would return the value of (-1) * FIELD_TYPE_FLOAT.

        Throws:
        VWException - if both of the theSig and theWF parameters are null.

© Copyright IBM Corporation 2002, 2013. All rights reserved.