Interface ExternalTask

  • All Known Implementing Classes:
    ExternalTaskImpl

    public interface ExternalTask

    Represents an external task

    Author:
    Tassilo Weidner
    • Method Detail

      • getActivityId

        java.lang.String getActivityId()
        Returns:
        the id of the activity that this external task belongs to
      • getActivityInstanceId

        java.lang.String getActivityInstanceId()
        Returns:
        the id of the activity instance that the external task belongs to
      • getErrorMessage

        java.lang.String getErrorMessage()
        Returns:
        the error message that was supplied when the last failure of this task was reported
      • getErrorDetails

        java.lang.String getErrorDetails()
        Returns:
        the error details submitted with the latest reported failure executing this task
      • getExecutionId

        java.lang.String getExecutionId()
        Returns:
        the id of the execution that the external task belongs to
      • getId

        java.lang.String getId()
        Returns:
        the id of the external task
      • getLockExpirationTime

        java.util.Date getLockExpirationTime()
        Returns:
        the date that the task's most recent lock expires or has expired
      • getProcessDefinitionId

        java.lang.String getProcessDefinitionId()
        Returns:
        the id of the process definition the external task is defined in
      • getProcessDefinitionKey

        java.lang.String getProcessDefinitionKey()
        Returns:
        the key of the process definition the external task is defined in
      • getProcessDefinitionVersionTag

        java.lang.String getProcessDefinitionVersionTag()
        Returns:
        the version tag of the process definition the tasks activity belongs to
      • getProcessInstanceId

        java.lang.String getProcessInstanceId()
        Returns:
        the id of the process instance the external task belongs to
      • getRetries

        java.lang.Integer getRetries()
        Returns:
        the number of retries the task currently has left
      • getWorkerId

        java.lang.String getWorkerId()
        Returns:
        the id of the worker that possesses or possessed the most recent lock
      • getTopicName

        java.lang.String getTopicName()
        Returns:
        the topic name of the external task
      • getTenantId

        java.lang.String getTenantId()
        Returns:
        the id of the tenant the external task belongs to
      • getPriority

        long getPriority()
        Returns:
        the priority of the external task
      • getVariable

        <T> T getVariable​(java.lang.String variableName)
        Returns an untyped variable of the task's ancestor execution hierarchy
        Type Parameters:
        T - the type of the variable
        Parameters:
        variableName - of the variable to be returned
        Returns:
        • an untyped variable if such a named variable exists
        • null if such a named variable not exists
        Throws:
        ValueMapperException - if an object cannot be deserialized
      • getVariableTyped

        <T extends TypedValue> T getVariableTyped​(java.lang.String variableName)
        Returns a typed variable of the task's ancestor execution hierarchy
        Type Parameters:
        T - the type of the variable
        Parameters:
        variableName - of the variable to be returned
        Returns:
        • a typed variable if such a named variable exists
        • null if such a named variable not exists
        Throws:
        ValueMapperException - if an object cannot be deserialized
      • getVariableTyped

        <T extends TypedValue> T getVariableTyped​(java.lang.String variableName,
                                                  boolean deserializeObjectValue)
        Returns a typed variable of the task's ancestor execution hierarchy
        Type Parameters:
        T - the type of the variable
        Parameters:
        variableName - of the variable to be returned
        deserializeObjectValue -
        • false to retrieve the object without deserialization
        • true to retrieve the deserialized object
        Returns:
        • a typed variable if such a named variable exists
        • null if such a named variable not exists
        Throws:
        ValueMapperException - if an object cannot be deserialized
      • getAllVariables

        java.util.Map<java.lang.String,​java.lang.Object> getAllVariables()
        Returns untyped variables that exist in the task's ancestor execution hierarchy
        Returns:
        a map of untyped variables that contains an entry for each variable
        Throws:
        ValueMapperException - if an object cannot be deserialized
      • getAllVariablesTyped

        VariableMap getAllVariablesTyped()
        Returns typed variables that exist in the task's ancestor execution hierarchy
        Returns:
        a map of typed variables that contains an entry for each variable
        Throws:
        ValueMapperException - if an object cannot be deserialized
      • getAllVariablesTyped

        VariableMap getAllVariablesTyped​(boolean deserializeObjectValues)
        Returns typed variables that exist in the task's ancestor execution hierarchy
        Parameters:
        deserializeObjectValues -
        • false to retrieve the object without deserialization
        • true to retrieve the deserialized object
        Returns:
        a map of typed variables that contains an entry for each variable
        Throws:
        ValueMapperException - if an object cannot be deserialized
      • getBusinessKey

        java.lang.String getBusinessKey()
        Returns the business key of the process instance the external task is associated with
        Returns:
        the business key
      • getExtensionProperty

        java.lang.String getExtensionProperty​(java.lang.String propertyKey)
        Returns the value of the extension property for a given key or null if the property was not available.
        Returns:
        the extension property, or null if not available
        See Also:
        getExtensionProperties()
      • getExtensionProperties

        java.util.Map<java.lang.String,​java.lang.String> getExtensionProperties()
        Returns all available extension properties. Extension properties must be defined at the external task activity inside the BPMN model and explicitly fetched (e.g. by calling TopicSubscriptionBuilder.includeExtensionProperties(boolean)) to be available. If no extension properties are available the returned map will be empty.
        Returns:
        a map of available extension properties, never null