Package org.flowable.job.api
Interface ExternalWorkerJobAcquireBuilder
public interface ExternalWorkerJobAcquireBuilder
- Author:
- Filip Hrisafov
-
Method Summary
Modifier and TypeMethodDescriptiondefault List<AcquiredExternalWorkerJob>
acquireAndLock
(int numberOfTasks, String workerId) Acquire and lock the given number of jobs for the given worker id.acquireAndLock
(int numberOfTasks, String workerId, int numberOfRetries) Acquire and lock the given number of jobs for the given worker id.forUserOrGroups
(String userId, Collection<String> groups) Acquire only jobs where the given user or groups are authorized to execute.onlyBpmn()
Acquire only jobs which are linked to a process instance.onlyCmmn()
Acquire only jobs which are linked to a case instance.Acquire only jobs which are linked to the given scope type.Acquire only jobs which are within the given tenant.The topic and lock duration for the requested jobs
-
Method Details
-
topic
The topic and lock duration for the requested jobs- Parameters:
topic
- the topic of the jobslockDuration
- the duration for locking the jobs
-
onlyBpmn
ExternalWorkerJobAcquireBuilder onlyBpmn()Acquire only jobs which are linked to a process instance. Cannot be combined withonlyCmmn()
andscopeType(String)
-
onlyCmmn
ExternalWorkerJobAcquireBuilder onlyCmmn()Acquire only jobs which are linked to a case instance. Cannot be combined withonlyBpmn()
andscopeType(String)
-
scopeType
Acquire only jobs which are linked to the given scope type. Cannot be combined withonlyBpmn()
oronlyCmmn()
-
tenantId
Acquire only jobs which are within the given tenant. -
forUserOrGroups
Acquire only jobs where the given user or groups are authorized to execute. -
acquireAndLock
Acquire and lock the given number of jobs for the given worker id. By default it will try to acquire jobs 5 times. UseacquireAndLock(int, String, int)
if you need more retries. If it fails to lock the jobs / scope after 5 retries it will return an empty list- Parameters:
numberOfTasks
- the number of jobs to acquireworkerId
- the id of the worker acquiring the jobs
-
acquireAndLock
List<AcquiredExternalWorkerJob> acquireAndLock(int numberOfTasks, String workerId, int numberOfRetries) Acquire and lock the given number of jobs for the given worker id. If it fails to lock the jobs / scope afternumberOfRetries
it will return an empty list- Parameters:
numberOfTasks
- the number of jobs to acquireworkerId
- the id of the worker acquiring the jobsnumberOfRetries
- the number of retries if an optimistic lock exception occurs during acquiring
-