Class TaskEntity

    • Field Detail

      • DELETE_REASON_COMPLETED

        public static final java.lang.String DELETE_REASON_COMPLETED
        See Also:
        Constant Field Values
      • DELETE_REASON_DELETED

        public static final java.lang.String DELETE_REASON_DELETED
        See Also:
        Constant Field Values
      • id

        protected java.lang.String id
      • revision

        protected int revision
      • owner

        protected java.lang.String owner
      • assignee

        protected java.lang.String assignee
      • parentTaskId

        protected java.lang.String parentTaskId
      • parentTask

        protected transient TaskEntity parentTask
      • name

        protected java.lang.String name
      • description

        protected java.lang.String description
      • priority

        protected int priority
      • createTime

        protected java.util.Date createTime
      • lastUpdated

        protected java.util.Date lastUpdated
      • dueDate

        protected java.util.Date dueDate
      • followUpDate

        protected java.util.Date followUpDate
      • suspensionState

        protected int suspensionState
      • tenantId

        protected java.lang.String tenantId
      • isIdentityLinksInitialized

        protected boolean isIdentityLinksInitialized
      • taskIdentityLinkEntities

        protected transient java.util.List<IdentityLinkEntity> taskIdentityLinkEntities
      • executionId

        protected java.lang.String executionId
      • processInstanceId

        protected java.lang.String processInstanceId
      • processDefinitionId

        protected java.lang.String processDefinitionId
      • caseExecutionId

        protected java.lang.String caseExecutionId
      • caseInstanceId

        protected java.lang.String caseInstanceId
      • caseDefinitionId

        protected java.lang.String caseDefinitionId
      • taskDefinitionKey

        protected java.lang.String taskDefinitionKey
      • isDeleted

        protected boolean isDeleted
      • deleteReason

        protected java.lang.String deleteReason
      • eventName

        protected java.lang.String eventName
      • isFormKeyInitialized

        protected boolean isFormKeyInitialized
      • formKey

        protected java.lang.String formKey
      • skipCustomListeners

        protected transient boolean skipCustomListeners
      • propertyChanges

        protected transient java.util.Map<java.lang.String,​PropertyChange> propertyChanges
        contains all changed properties of this entity
      • identityLinkChanges

        protected transient java.util.List<PropertyChange> identityLinkChanges
      • CASE_INSTANCE_ID

        public static final java.lang.String CASE_INSTANCE_ID
        See Also:
        Constant Field Values
    • Constructor Detail

      • TaskEntity

        public TaskEntity()
        Mybatis constructor
      • TaskEntity

        public TaskEntity​(java.lang.String id)
        Standalone task constructor
      • TaskEntity

        public TaskEntity​(ExecutionEntity execution)
        BPMN execution constructor
      • TaskEntity

        public TaskEntity​(CaseExecutionEntity caseExecution)
        CMMN execution constructor
    • Method Detail

      • insert

        public void insert()
      • propagateExecutionTenantId

        protected void propagateExecutionTenantId​(ExecutionEntity execution)
      • propagateParentTaskTenantId

        public void propagateParentTaskTenantId()
      • update

        public void update()
      • ensureTenantIdNotChanged

        protected void ensureTenantIdNotChanged()
      • tenantIdIsSame

        protected boolean tenantIdIsSame​(TaskEntity otherTask)
      • caseExecutionCompleted

        public void caseExecutionCompleted()
      • delete

        public void delete​(java.lang.String deleteReason,
                           boolean cascade)
      • delete

        public void delete​(java.lang.String deleteReason,
                           boolean cascade,
                           boolean skipCustomListeners)
      • delegate

        public void delegate​(java.lang.String userId)
        Description copied from interface: Task
        delegates this task to the given user and sets the delegationState to DelegationState.PENDING. If no owner is set on the task, the owner is set to the current assignee of the task.
        Specified by:
        delegate in interface Task
      • resolve

        public void resolve()
      • getPersistentState

        public java.lang.Object getPersistentState()
        Description copied from interface: DbEntity
        Returns a representation of the object, as would be stored in the database. Used when deciding if updates have occurred to the object or not since it was last loaded.
        Specified by:
        getPersistentState in interface DbEntity
      • ensureParentTaskActive

        public void ensureParentTaskActive()
      • ensureTaskActive

        protected void ensureTaskActive()
      • getParentTask

        public TaskEntity getParentTask()
      • ensureCaseExecutionInitialized

        protected void ensureCaseExecutionInitialized()
      • getCaseExecutionId

        public java.lang.String getCaseExecutionId()
        Description copied from interface: Task
        Reference to the path of case execution or null if it is not related to a case instance.
        Specified by:
        getCaseExecutionId in interface DelegateTask
        Specified by:
        getCaseExecutionId in interface Task
      • setCaseExecutionId

        public void setCaseExecutionId​(java.lang.String caseExecutionId)
      • getCaseInstanceId

        public java.lang.String getCaseInstanceId()
        Description copied from interface: Task
        Reference to the case instance or null if it is not related to a case instance.
        Specified by:
        getCaseInstanceId in interface DelegateTask
        Specified by:
        getCaseInstanceId in interface Task
      • setCaseInstanceId

        public void setCaseInstanceId​(java.lang.String caseInstanceId)
        Description copied from interface: Task
        The case instance id for which this task is associated for.
        Specified by:
        setCaseInstanceId in interface Task
      • getCaseDefinitionId

        public java.lang.String getCaseDefinitionId()
        Description copied from interface: Task
        Reference to the case definition or null if it is not related to a case.
        Specified by:
        getCaseDefinitionId in interface DelegateTask
        Specified by:
        getCaseDefinitionId in interface Task
      • setCaseDefinitionId

        public void setCaseDefinitionId​(java.lang.String caseDefinitionId)
      • addIdentityLink

        public IdentityLinkEntity addIdentityLink​(java.lang.String userId,
                                                  java.lang.String groupId,
                                                  java.lang.String type)
      • fireIdentityLinkHistoryEvents

        public void fireIdentityLinkHistoryEvents​(java.lang.String userId,
                                                  java.lang.String groupId,
                                                  java.lang.String type,
                                                  HistoryEventTypes historyEventType)
      • newIdentityLink

        public IdentityLinkEntity newIdentityLink​(java.lang.String userId,
                                                  java.lang.String groupId,
                                                  java.lang.String type)
      • deleteIdentityLink

        public void deleteIdentityLink​(java.lang.String userId,
                                       java.lang.String groupId,
                                       java.lang.String type)
      • deleteIdentityLinks

        public void deleteIdentityLinks()
      • addCandidateUser

        public void addCandidateUser​(java.lang.String userId)
        Description copied from interface: DelegateTask
        Adds the given user as a candidate user to this task.
        Specified by:
        addCandidateUser in interface DelegateTask
      • addCandidateUsers

        public void addCandidateUsers​(java.util.Collection<java.lang.String> candidateUsers)
        Description copied from interface: DelegateTask
        Adds multiple users as candidate user to this task.
        Specified by:
        addCandidateUsers in interface DelegateTask
      • addCandidateGroup

        public void addCandidateGroup​(java.lang.String groupId)
        Description copied from interface: DelegateTask
        Adds the given group as candidate group to this task
        Specified by:
        addCandidateGroup in interface DelegateTask
      • addCandidateGroups

        public void addCandidateGroups​(java.util.Collection<java.lang.String> candidateGroups)
        Description copied from interface: DelegateTask
        Adds multiple groups as candidate group to this task.
        Specified by:
        addCandidateGroups in interface DelegateTask
      • addGroupIdentityLink

        public void addGroupIdentityLink​(java.lang.String groupId,
                                         java.lang.String identityLinkType)
        Description copied from interface: DelegateTask
        Involves a group with group task. The type of identityLink is defined by the given identityLink.
        Specified by:
        addGroupIdentityLink in interface DelegateTask
        Parameters:
        groupId - id of the group to involve, cannot be null.
        identityLinkType - type of identity, cannot be null (@see IdentityLinkType).
      • addUserIdentityLink

        public void addUserIdentityLink​(java.lang.String userId,
                                        java.lang.String identityLinkType)
        Description copied from interface: DelegateTask
        Involves a user with a task. The type of identity link is defined by the given identityLinkType.
        Specified by:
        addUserIdentityLink in interface DelegateTask
        Parameters:
        userId - id of the user involve, cannot be null.
        identityLinkType - type of identityLink, cannot be null (@see IdentityLinkType).
      • deleteCandidateGroup

        public void deleteCandidateGroup​(java.lang.String groupId)
        Description copied from interface: DelegateTask
        Convenience shorthand for #deleteGroupIdentityLink(String, String, String); with type IdentityLinkType.CANDIDATE
        Specified by:
        deleteCandidateGroup in interface DelegateTask
        Parameters:
        groupId - id of the group to use as candidate, cannot be null.
      • deleteGroupIdentityLink

        public void deleteGroupIdentityLink​(java.lang.String groupId,
                                            java.lang.String identityLinkType)
        Description copied from interface: DelegateTask
        Removes the association between a group and a task for the given identityLinkType.
        Specified by:
        deleteGroupIdentityLink in interface DelegateTask
        Parameters:
        groupId - id of the group to involve, cannot be null.
        identityLinkType - type of identity, cannot be null (@see IdentityLinkType).
      • deleteUserIdentityLink

        public void deleteUserIdentityLink​(java.lang.String userId,
                                           java.lang.String identityLinkType)
        Description copied from interface: DelegateTask
        Removes the association between a user and a task for the given identityLinkType.
        Specified by:
        deleteUserIdentityLink in interface DelegateTask
        Parameters:
        userId - id of the user involve, cannot be null.
        identityLinkType - type of identityLink, cannot be null (@see IdentityLinkType).
      • getActivityInstanceVariables

        public java.util.Map<java.lang.String,​java.lang.Object> getActivityInstanceVariables()
      • setExecutionVariables

        public void setExecutionVariables​(java.util.Map<java.lang.String,​java.lang.Object> parameters)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • setName

        public void setName​(java.lang.String taskName)
        Description copied from interface: Task
        Name or title of the task.
        Specified by:
        setName in interface DelegateTask
        Specified by:
        setName in interface Task
      • setDescription

        public void setDescription​(java.lang.String description)
        Description copied from interface: Task
        Change the description of the task
        Specified by:
        setDescription in interface DelegateTask
        Specified by:
        setDescription in interface Task
      • setOwner

        public void setOwner​(java.lang.String owner)
        Description copied from interface: Task
        The userId of the person that is responsible for this task. This is used when a task is delegated.
        Specified by:
        setOwner in interface DelegateTask
        Specified by:
        setOwner in interface Task
      • setDueDate

        public void setDueDate​(java.util.Date dueDate)
        Description copied from interface: Task
        Change due date of the task.
        Specified by:
        setDueDate in interface DelegateTask
        Specified by:
        setDueDate in interface Task
      • setPriority

        public void setPriority​(int priority)
        Description copied from interface: Task
        indication of how important/urgent this task is with a number between 0 and 100 where higher values mean a higher priority and lower values mean lower priority: [0..19] lowest, [20..39] low, [40..59] normal, [60..79] high [80..100] highest
        Specified by:
        setPriority in interface DelegateTask
        Specified by:
        setPriority in interface Task
      • setParentTaskId

        public void setParentTaskId​(java.lang.String parentTaskId)
        Description copied from interface: Task
        the parent task for which this task is a subtask
        Specified by:
        setParentTaskId in interface Task
      • setNameWithoutCascade

        public void setNameWithoutCascade​(java.lang.String taskName)
      • setDescriptionWithoutCascade

        public void setDescriptionWithoutCascade​(java.lang.String description)
      • setAssigneeWithoutCascade

        public void setAssigneeWithoutCascade​(java.lang.String assignee)
      • setOwnerWithoutCascade

        public void setOwnerWithoutCascade​(java.lang.String owner)
      • setDueDateWithoutCascade

        public void setDueDateWithoutCascade​(java.util.Date dueDate)
      • setPriorityWithoutCascade

        public void setPriorityWithoutCascade​(int priority)
      • setCaseInstanceIdWithoutCascade

        public void setCaseInstanceIdWithoutCascade​(java.lang.String caseInstanceId)
      • setParentTaskIdWithoutCascade

        public void setParentTaskIdWithoutCascade​(java.lang.String parentTaskId)
      • setTaskDefinitionKeyWithoutCascade

        public void setTaskDefinitionKeyWithoutCascade​(java.lang.String taskDefinitionKey)
      • setDelegationStateWithoutCascade

        public void setDelegationStateWithoutCascade​(DelegationState delegationState)
      • setDelegationStateString

        public void setDelegationStateString​(java.lang.String delegationState)
        Setter for mybatis mapper.
        Parameters:
        delegationState - the delegation state as string
      • setFollowUpDateWithoutCascade

        public void setFollowUpDateWithoutCascade​(java.util.Date followUpDate)
      • fireEvent

        public boolean fireEvent​(java.lang.String taskEventName)
        Returns:
        true if invoking the listener was successful; if not successful, either false is returned (case: BPMN error propagation) or an exception is thrown
      • getListenersForEvent

        protected java.util.List<TaskListener> getListenersForEvent​(java.lang.String event)
      • getTimeoutListener

        protected TaskListener getTimeoutListener​(java.lang.String timeoutId)
      • invokeListener

        protected boolean invokeListener​(java.lang.String taskEventName,
                                         TaskListener taskListener)
      • invokeListener

        protected boolean invokeListener​(CoreExecution currentExecution,
                                         java.lang.String eventName,
                                         TaskListener taskListener)
                                  throws java.lang.Exception
        Returns:
        true if the next listener can be invoked; false if not
        Throws:
        java.lang.Exception
      • propertyChanged

        protected void propertyChanged​(java.lang.String propertyName,
                                       java.lang.Object orgValue,
                                       java.lang.Object newValue)
        Tracks a property change. Therefore the original and new value are stored in a map. It tracks multiple changes and if a property finally is changed back to the original value, then the change is removed.
        Parameters:
        propertyName -
        orgValue -
        newValue -
      • fireAuthorizationProvider

        public void fireAuthorizationProvider()
      • triggerUpdateEvent

        public boolean triggerUpdateEvent()
      • triggerTimeoutEvent

        public boolean triggerTimeoutEvent​(java.lang.String timeoutId)
        Returns:
        true if invoking the listener was successful; if not successful, either false is returned (case: BPMN error propagation) or an exception is thrown
      • fireAssignmentEvent

        protected boolean fireAssignmentEvent()
      • fireAssigneeAuthorizationProvider

        protected void fireAssigneeAuthorizationProvider​(java.lang.String oldAssignee,
                                                         java.lang.String newAssignee)
      • fireOwnerAuthorizationProvider

        protected void fireOwnerAuthorizationProvider​(java.lang.String oldOwner,
                                                      java.lang.String newOwner)
      • fireAuthorizationProvider

        protected void fireAuthorizationProvider​(java.lang.String property,
                                                 java.lang.String oldValue,
                                                 java.lang.String newValue)
      • fireAddIdentityLinkAuthorizationProvider

        protected void fireAddIdentityLinkAuthorizationProvider​(java.lang.String type,
                                                                java.lang.String userId,
                                                                java.lang.String groupId)
      • fireDeleteIdentityLinkAuthorizationProvider

        protected void fireDeleteIdentityLinkAuthorizationProvider​(java.lang.String type,
                                                                   java.lang.String userId,
                                                                   java.lang.String groupId)
      • saveAuthorizations

        protected void saveAuthorizations​(AuthorizationEntity[] authorizations)
      • deleteAuthorizations

        protected void deleteAuthorizations​(AuthorizationEntity[] authorizations)
      • isAuthorizationEnabled

        protected boolean isAuthorizationEnabled()
      • setTaskDefinition

        public void setTaskDefinition​(TaskDefinition taskDefinition)
      • getId

        public java.lang.String getId()
        Description copied from interface: Task
        DB id of the task.
        Specified by:
        getId in interface DbEntity
        Specified by:
        getId in interface DelegateTask
        Specified by:
        getId in interface Task
      • setId

        public void setId​(java.lang.String id)
        Specified by:
        setId in interface DbEntity
      • getName

        public java.lang.String getName()
        Description copied from interface: Task
        Name or title of the task.
        Specified by:
        getName in interface DelegateTask
        Specified by:
        getName in interface Task
      • getDescription

        public java.lang.String getDescription()
        Description copied from interface: Task
        Free text description of the task.
        Specified by:
        getDescription in interface DelegateTask
        Specified by:
        getDescription in interface Task
      • getDueDate

        public java.util.Date getDueDate()
        Description copied from interface: Task
        Due date of the task.
        Specified by:
        getDueDate in interface DelegateTask
        Specified by:
        getDueDate in interface Task
      • getPriority

        public int getPriority()
        Description copied from interface: Task
        indication of how important/urgent this task is with a number between 0 and 100 where higher values mean a higher priority and lower values mean lower priority: [0..19] lowest, [20..39] low, [40..59] normal, [60..79] high [80..100] highest
        Specified by:
        getPriority in interface DelegateTask
        Specified by:
        getPriority in interface Task
      • getCreateTime

        public java.util.Date getCreateTime()
        Description copied from interface: Task
        The date/time when this task was created
        Specified by:
        getCreateTime in interface DelegateTask
        Specified by:
        getCreateTime in interface Task
      • setCreateTime

        public void setCreateTime​(java.util.Date createTime)
      • getLastUpdated

        public java.util.Date getLastUpdated()
        Description copied from interface: Task
        The date/time when this task was last updated. All operations that fire TaskListener.EVENTNAME_UPDATE count as an update to the task. Returns null if the task was never updated before (i.e. it was only created).
        Specified by:
        getLastUpdated in interface Task
      • setLastUpdated

        public void setLastUpdated​(java.util.Date lastUpdated)
      • getExecutionId

        public java.lang.String getExecutionId()
        Description copied from interface: Task
        Reference to the path of execution or null if it is not related to a process instance.
        Specified by:
        getExecutionId in interface DelegateTask
        Specified by:
        getExecutionId in interface Task
      • getProcessInstanceId

        public java.lang.String getProcessInstanceId()
        Description copied from interface: Task
        Reference to the process instance or null if it is not related to a process instance.
        Specified by:
        getProcessInstanceId in interface DelegateTask
        Specified by:
        getProcessInstanceId in interface Task
      • isStandaloneTask

        public boolean isStandaloneTask()
      • initializeFormKey

        public void initializeFormKey()
      • setProcessDefinitionId

        public void setProcessDefinitionId​(java.lang.String processDefinitionId)
      • getTaskDefinitionKey

        public java.lang.String getTaskDefinitionKey()
        Description copied from interface: Task
        The id of the activity in the process defining this task or null if this is not related to a process
        Specified by:
        getTaskDefinitionKey in interface DelegateTask
        Specified by:
        getTaskDefinitionKey in interface Task
      • setTaskDefinitionKey

        public void setTaskDefinitionKey​(java.lang.String taskDefinitionKey)
      • getEventName

        public java.lang.String getEventName()
        Description copied from interface: DelegateTask
        Returns the event name which triggered the task listener to fire for this task.
        Specified by:
        getEventName in interface DelegateTask
      • setEventName

        public void setEventName​(java.lang.String eventName)
      • setExecutionId

        public void setExecutionId​(java.lang.String executionId)
      • setProcessInstance

        public void setProcessInstance​(ExecutionEntity processInstance)
      • setProcessInstanceId

        public void setProcessInstanceId​(java.lang.String processInstanceId)
      • getOwner

        public java.lang.String getOwner()
        Description copied from interface: Task
        The userId of the person that is responsible for this task. This is used when a task is delegated.
        Specified by:
        getOwner in interface DelegateTask
        Specified by:
        getOwner in interface Task
      • getDelegationStateString

        public java.lang.String getDelegationStateString()
      • isDeleted

        public boolean isDeleted()
      • getDeleteReason

        public java.lang.String getDeleteReason()
        Description copied from interface: DelegateTask
        Get delete reason of the task.
        Specified by:
        getDeleteReason in interface DelegateTask
      • setDeleted

        public void setDeleted​(boolean isDeleted)
      • getParentTaskId

        public java.lang.String getParentTaskId()
        Description copied from interface: Task
        the parent task for which this task is a subtask
        Specified by:
        getParentTaskId in interface Task
      • getSuspensionState

        public int getSuspensionState()
      • setSuspensionState

        public void setSuspensionState​(int suspensionState)
      • isSuspended

        public boolean isSuspended()
        Description copied from interface: Task
        Indicated whether this task is suspended or not.
        Specified by:
        isSuspended in interface Task
      • getTenantId

        public java.lang.String getTenantId()
        Description copied from interface: Task
        Returns the task's tenant id or null in case this task does not belong to a tenant.
        Specified by:
        getTenantId in interface DelegateTask
        Specified by:
        getTenantId in interface Task
        Returns:
        the task's tenant id or null
      • setTenantId

        public void setTenantId​(java.lang.String tenantId)
        Description copied from interface: Task
        Sets the tenant id for this task.
        Specified by:
        setTenantId in interface Task
        Parameters:
        tenantId - the tenant id to set
      • setFollowUpDate

        public void setFollowUpDate​(java.util.Date followUpDate)
        Description copied from interface: Task
        Change follow-up date of the task.
        Specified by:
        setFollowUpDate in interface DelegateTask
        Specified by:
        setFollowUpDate in interface Task
      • registerCommandContextCloseListener

        protected void registerCommandContextCloseListener()
      • getPropertyChanges

        public java.util.Map<java.lang.String,​PropertyChange> getPropertyChanges()
      • logUserOperation

        public void logUserOperation​(java.lang.String operation)
      • fireHistoricIdentityLinks

        public void fireHistoricIdentityLinks()
      • hashCode

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • executeMetrics

        public void executeMetrics​(java.lang.String metricsName,
                                   CommandContext commandContext)
      • addIdentityLinkChanges

        public void addIdentityLinkChanges​(java.lang.String type,
                                           java.lang.String oldProperty,
                                           java.lang.String newProperty)
      • setVariablesLocal

        public void setVariablesLocal​(java.util.Map<java.lang.String,​?> variables,
                                      boolean skipJavaSerializationFormatCheck)
        Overrides:
        setVariablesLocal in class AbstractVariableScope
      • getReferencedEntityIds

        public java.util.Set<java.lang.String> getReferencedEntityIds()
        Description copied from interface: HasDbReferences

        Scope: IN-MEMORY references

        Specified by:
        getReferencedEntityIds in interface HasDbReferences
        Returns:
        the ids of the entities that this entity references. Should only return ids for entities of the same type
      • getReferencedEntitiesIdAndClass

        public java.util.Map<java.lang.String,​java.lang.Class> getReferencedEntitiesIdAndClass()
        Description copied from interface: HasDbReferences

        Scope: IN-MEMORY references

        Specified by:
        getReferencedEntitiesIdAndClass in interface HasDbReferences
        Returns:
        a map of the ids and the entities' classes that this entity references. It's used when trying to determine if there was an Optimistic Locking occurrence on an INSERT or UPDATE of an object of this type.
      • bpmnError

        public void bpmnError​(java.lang.String errorCode,
                              java.lang.String errorMessage,
                              java.util.Map<java.lang.String,​java.lang.Object> variables)
      • escalation

        public void escalation​(java.lang.String escalationCode,
                               java.util.Map<java.lang.String,​java.lang.Object> variables)