Class HistoryRecord

java.lang.Object
com.appiancorp.suiteapi.process.HistoryRecord
All Implemented Interfaces:
Serializable

public class HistoryRecord extends Object implements Serializable
An individual history record, representing an element of an audit trail in a process.
See Also:
  • Field Details

    • TYPE_CHANGE_PRIORITY

      public static final int TYPE_CHANGE_PRIORITY
      See Also:
    • TYPE_SCHEDULE

      public static final int TYPE_SCHEDULE
      See Also:
    • TYPE_ASSIGNED

      public static final int TYPE_ASSIGNED
      See Also:
    • TYPE_REASSIGNED

      public static final int TYPE_REASSIGNED
      See Also:
    • TYPE_ESCALATED

      public static final int TYPE_ESCALATED
      See Also:
    • TYPE_ESCALATION_NOTIFICATION

      public static final int TYPE_ESCALATION_NOTIFICATION
      See Also:
    • TYPE_START

      public static final int TYPE_START
      See Also:
    • TYPE_CANCEL

      public static final int TYPE_CANCEL
      See Also:
    • TYPE_PAUSE

      public static final int TYPE_PAUSE
      See Also:
    • TYPE_RESUME

      public static final int TYPE_RESUME
      See Also:
    • TYPE_COMPLETE

      public static final int TYPE_COMPLETE
      See Also:
    • TYPE_ADD_ATTACHMENT

      public static final int TYPE_ADD_ATTACHMENT
      See Also:
    • TYPE_REMOVE_ATTACHMENT

      public static final int TYPE_REMOVE_ATTACHMENT
      See Also:
    • TYPE_ADD_NOTE

      public static final int TYPE_ADD_NOTE
      See Also:
    • TYPE_REMOVE_NOTE

      public static final int TYPE_REMOVE_NOTE
      See Also:
    • TYPE_MODIFY_NAME

      public static final int TYPE_MODIFY_NAME
      See Also:
    • TYPE_MODIFY_VARIABLE

      public static final int TYPE_MODIFY_VARIABLE
      See Also:
    • TYPE_ADD_VARIABLE

      public static final int TYPE_ADD_VARIABLE
      See Also:
    • TYPE_EVENT_ACTIVATE

      public static final int TYPE_EVENT_ACTIVATE
      See Also:
    • TYPE_EVENT_FIRE

      public static final int TYPE_EVENT_FIRE
      See Also:
    • TYPE_EVENT_CANCEL

      public static final int TYPE_EVENT_CANCEL
      See Also:
    • TYPE_EVENT_ABORT

      public static final int TYPE_EVENT_ABORT
      See Also:
    • TYPE_MODIFY_EXTERNAL_VARIABLE

      public static final int TYPE_MODIFY_EXTERNAL_VARIABLE
      See Also:
    • TYPE_EDIT_PROCESS

      public static final int TYPE_EDIT_PROCESS
      Represents an edit of a process from Edit Mode.
      See Also:
    • TYPE_UPGRADE_PROCESS

      public static final int TYPE_UPGRADE_PROCESS
      Represents an upgrade of a process to a new process model.
      See Also:
    • OBJECT_TYPE_PROCESS

      public static final int OBJECT_TYPE_PROCESS
      See Also:
    • OBJECT_TYPE_TASK

      public static final int OBJECT_TYPE_TASK
      See Also:
    • OBJECT_TYPE_VARIABLE

      public static final int OBJECT_TYPE_VARIABLE
      See Also:
    • SORT_BY_USER

      public static final Integer SORT_BY_USER
    • SORT_BY_TIMESTAMP

      public static final Integer SORT_BY_TIMESTAMP
    • SORT_BY_TYPE

      public static final Integer SORT_BY_TYPE
    • SORT_BY_OBJECT_TYPE

      public static final Integer SORT_BY_OBJECT_TYPE
    • SORT_BY_OBJECT_ID

      public static final Integer SORT_BY_OBJECT_ID
    • SORT_BY_OBJECT_NAME

      public static final Integer SORT_BY_OBJECT_NAME
    • SORT_BY_NEW_VALUE

      public static final Integer SORT_BY_NEW_VALUE
    • SORT_BY_NEW_NAME

      public static final Integer SORT_BY_NEW_NAME
    • SORT_BY_DATA_IDS

      public static final Integer SORT_BY_DATA_IDS
    • SORT_BY_USERS

      public static final Integer SORT_BY_USERS
    • SORT_BY_GROUPS

      public static final Integer SORT_BY_GROUPS
    • SORT_BY_NEW_TIMESTAMP

      public static final Integer SORT_BY_NEW_TIMESTAMP
    • SORT_BY_DIRECTION

      public static final Integer SORT_BY_DIRECTION
    • SORT_BY_NEW_PRIORITY

      public static final Integer SORT_BY_NEW_PRIORITY
    • SORT_BY_SAVED_AS_VERSION

      public static final Integer SORT_BY_SAVED_AS_VERSION
    • SORT_BY_SOURCE_MODEL_INFO

      public static final Integer SORT_BY_SOURCE_MODEL_INFO
    • SORT_BY_TARGET_MODEL_INFO

      public static final Integer SORT_BY_TARGET_MODEL_INFO
  • Constructor Details

    • HistoryRecord

      public HistoryRecord()
  • Method Details

    • getData

      public Object getData()
      Get the associated data for the history record; note, those history records that return multiple objects will return them as an Object[]. Null will be returned for those history types without associated data.
      Returns:
    • getType

      public int getType()
      Type of this history record (e.g., START is 6, MODIFY_VARIABLE is 17, etc.) See HistoryRecordConstants.
      Returns:
    • setType

      public void setType(int historyType_)
    • getTimestamp

      public Timestamp getTimestamp()
      Timestamp at which this modification occurred.
      Returns:
    • setTimestamp

      public void setTimestamp(Timestamp timestamp_)
    • getObjectId

      public Long getObjectId()
      Id of the object in the history record.
      Returns:
    • setObjectId

      public void setObjectId(Long objectId_)
    • getObjectName

      public String getObjectName()
      Name of the object in the history record.
      Returns:
    • setObjectName

      public void setObjectName(String objectName_)
    • getObjectType

      public int getObjectType()
      Type of the object in the history record.
      Returns:
    • setObjectType

      public void setObjectType(int objectType_)
    • getUser

      public String getUser()
      The user responsible for the history record.
      Returns:
    • setUser

      public void setUser(String user_)
    • getNewValue

      public TypedValue getNewValue()
      Set only by history type MODIFY_VARIABLE.
      Returns:
    • setNewValue

      public void setNewValue(TypedValue newValue_)
    • getDataIds

      public Long[] getDataIds()
      Set only by history types ADD_ATTACHMENT, REMOVE_ATTACHMENT, ADD_NOTE, REMOVE_NOTE
      Returns:
    • setDataIds

      public void setDataIds(Long[] dataIds_)
    • getDirection

      public Long getDirection()
      Set only by history type CHANGE_PRIORITY
      Returns:
    • setDirection

      public void setDirection(Long direction_)
    • getGroups

      public Long[] getGroups()
      Set only by history types ESCALATION_NOTIFICATION, REASSIGNED, ASSIGNED
      Returns:
    • setGroups

      public void setGroups(Long[] groups_)
    • getNewName

      public String getNewName()
    • setNewName

      public void setNewName(String newName_)
      Set only by history types ADD_VARIABLE, MODIFY_NAME
      Parameters:
      newName_ -
    • getNewPriority

      public Long getNewPriority()
      Set only by history type CHANGE_PRIORITY
      Returns:
    • setNewPriority

      public void setNewPriority(Long newPriority_)
    • getNewTimestamp

      public Timestamp getNewTimestamp()
      Set only by history type SCHEDULE
      Returns:
    • setNewTimestamp

      public void setNewTimestamp(Timestamp newTimestamp_)
    • getUsers

      public String[] getUsers()
      Set only by history types ESCALATION_NOTIFICATION, REASSIGNED, ASSIGNED
      Returns:
    • setUsers

      public void setUsers(String[] users_)
    • getSavedAsVersion

      public String getSavedAsVersion()
      Gets the resulting process model version that the edited process was saved as. Set only by EDIT_PROCESS, if the edited process was saved as a new version.
      Returns:
      the version that the edited process was saved as
    • setSavedAsVersion

      public void setSavedAsVersion(String savedAsVersion)
      Sets the process model version that the edited process was saved as. Only relevant for the EDIT_PROCESS history type.
      Parameters:
      savedAsVersion - the process model version that the edited process was saved as
    • getSourceModel

      public HistoryRecord.ProcessModelInfo getSourceModel()
      Gets a ProcessModelInfo object representing the source process model that was in use before the process upgrade. Only set by the UPGRADE_PROCESS history type.
      Returns:
      a ProcessModelInfo object representing the source process model
    • setSourceModel

      public void setSourceModel(HistoryRecord.ProcessModelInfo sourceModel)
      Sets the ProcessModelInfo object representing the source process model that was in use before the process upgrade. Only relevant for the UPGRADE_PROCESS history type.
      Parameters:
      sourceModel - a ProcessModelInfo object representing the source process model
    • getTargetModel

      public HistoryRecord.ProcessModelInfo getTargetModel()
      Gets a ProcessModelInfo object representing the target process model to which the process was upgraded. Only set by the UPGRADE_PROCESS history type.
      Returns:
      a ProcessModelInfo object representing the target process model
    • setTargetModel

      public void setTargetModel(HistoryRecord.ProcessModelInfo targetModel)
      Sets the ProcessModelInfo object representing the target process model to which the process was upgraded. Only relevant for the UPGRADE_PROCESS history type.
      Parameters:
      targetModel - a ProcessModelInfo object representing the target process model
    • getWriteIndex

      public long getWriteIndex()
      The writeIndex encapsulates both writeCounter and writeEpoch into a single value. Aside from rolling back to previous revisions, the writeIndex always increases once per write within a given execution engine. No writeIndexes are shared (at least until the writeEpoch wraps). This should be combined with the engineId to form the basis of external storage process history keys.
      Returns:
    • setWriteIndex

      public void setWriteIndex(long value)
      The writeIndex encapsulates both writeCounter and writeEpoch into a single value.
    • getWriteCounter

      public int getWriteCounter()
      This advances by one every time a write to external (set, modify, or delete) occurs within an engine.
      Returns:
      the writeCounter
    • setWriteCounter

      public void setWriteCounter(int writeCounter_)
      Parameters:
      writeCounter_ - the writeCounter to set
    • getWriteEpoch

      public int getWriteEpoch()
      Whenever the writeCounter advances beyond Integer.MAX_VALUE, it resets to 0, and the writeEpoch increases by one.
      Returns:
      the writeEpoch
    • setWriteEpoch

      public void setWriteEpoch(int writeEpoch_)
      Parameters:
      writeEpoch_ - the writeEpoch to set
    • getEngineId

      public int getEngineId()
      This is 0 for EXEC00, 1 for EXEC01, etc.
      Returns:
      the engineId
    • setEngineId

      public void setEngineId(int engineId_)
      This is 0 for EXEC00, 1 for EXEC01, etc.
      Parameters:
      engineId_ - the engineId to set
    • setIndex

      public void setIndex(Integer[] indices)
    • setIndex

      public void setIndex(int[] indices)
    • toString

      public String toString()
      Only intended to help debugging. The format of this String is not guaranteed and may change.
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • getComparator

      public static Comparator getComparator(int sortKey)
      Comparator for HistoryRecord
      Parameters:
      sortKey -
      Returns:
      Comparator based on given sortKey