Package io.camunda.client.api.response
Interface ActivatedJob
- All Known Implementing Classes:
ActivatedJobImpl
public interface ActivatedJob
-
Method Summary
Modifier and TypeMethodDescriptionThe business ID of the owning process instance, inherited when the job was created.longgetDocumentReferences(String name) longlonggetKey()getKind()The lease token identifying this activation.intlongintlongintThe key of the root process instance.getTags()getType()getVariable(String name) <T> TgetVariablesAsType(Class<T> variableType) toJson()
-
Method Details
-
getKey
long getKey()- Returns:
- the unique key of the job
-
getType
String getType()- Returns:
- the type of the job
-
getProcessInstanceKey
long getProcessInstanceKey()- Returns:
- key of the process instance
-
getBpmnProcessId
String getBpmnProcessId()- Returns:
- BPMN process id of the process
-
getProcessDefinitionVersion
int getProcessDefinitionVersion()- Returns:
- version of the process
-
getProcessDefinitionKey
long getProcessDefinitionKey()- Returns:
- key of the process
-
getElementId
String getElementId()- Returns:
- id of the process element
-
getElementInstanceKey
long getElementInstanceKey()- Returns:
- key of the element instance
-
getCustomHeaders
- Returns:
- user-defined headers associated with this job
-
getWorker
String getWorker()- Returns:
- the assigned worker to complete the job
-
getRetries
int getRetries()- Returns:
- remaining retries
-
getPriority
int getPriority()- Returns:
- the priority of the job; higher values indicate higher priority
-
getDeadline
long getDeadline()- Returns:
- the unix timestamp until when the job is exclusively assigned to this worker (time unit * is milliseconds since unix epoch). If the deadline is exceeded, it can happen that the job is handed to another worker and the work is performed twice.
-
getVariables
String getVariables()- Returns:
- JSON-formatted variables
-
getVariablesAsMap
- Returns:
- de-serialized variables as map
-
getVariablesAsType
- Returns:
- de-serialized variables as the given type
-
getVariable
- Returns:
- de-serialized variable value or null if the provided variable name is present among the available variables
- Throws:
ClientException- if the variable is missing
-
getUserTask
UserTaskProperties getUserTask()- Returns:
- user task properties associated with this job. Present only if the job is of kind
TASK_LISTENER; returnsnullfor other job kinds such asBPMN_ELEMENTorEXECUTION_LISTENER.
-
getKind
JobKind getKind()- Returns:
- the kind of the job.
-
getListenerEventType
ListenerEventType getListenerEventType()- Returns:
- the listener event type of the job.
-
toJson
String toJson()- Returns:
- the record encoded as JSON
-
getTenantId
String getTenantId()- Returns:
- the identifier of the tenant that owns the job
-
getPhysicalTenantId
String getPhysicalTenantId()- Returns:
- the identifier of the physical tenant that the job-activation request was routed to; the default physical tenant when the request did not specify one
-
getDocumentReferences
- Returns:
- de-serialized document references if the provided variable name is present among the available variables and can be parsed as document reference
- Throws:
ClientException- if the variable is missing or if the variable cannot be parsed * as document reference list
-
getTags
- Returns:
- the tags associated with the job inherited from the process instance on job creation.
-
getRootProcessInstanceKey
Long getRootProcessInstanceKey()The key of the root process instance. This is the key of the top-level process instance that started the process instance hierarchy containing this job. For jobs in top-level process instances, this is the same asgetProcessInstanceKey().Note: This field is only available when using the REST API. When using the gRPC API, this method returns
null.- Returns:
- the key of the root process instance, or
nullif not available (gRPC API or pre-8.9 data)
-
getBusinessId
String getBusinessId()The business ID of the owning process instance, inherited when the job was created.Note: This field is only available when using the REST API. When using the gRPC API, this method returns
null.- Returns:
- the business ID, or
nullif not available (gRPC API, jobs created before version 8.10, or when the owning process instance has no business ID)
-
getLeaseToken
String getLeaseToken()The lease token identifying this activation. Pass it along to commands (e.g. complete, fail, throw-error, update-timeout) to fence them against superseded activations of the same job.- Returns:
- the lease token, or
nullif the job was activated without a lease
-