Package org.flowable.job.api
Interface ExternalWorkerJobAcquireBuilder
-
public interface ExternalWorkerJobAcquireBuilder
- Author:
- Filip Hrisafov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default List<AcquiredExternalWorkerJob>
acquireAndLock(int numberOfTasks, String workerId)
Acquire and lock the given number of jobs for the given worker id.List<AcquiredExternalWorkerJob>
acquireAndLock(int numberOfTasks, String workerId, int numberOfRetries)
Acquire and lock the given number of jobs for the given worker id.ExternalWorkerJobAcquireBuilder
forUserOrGroups(String userId, Collection<String> groups)
Acquire only jobs where the given user or groups are authorized to execute.ExternalWorkerJobAcquireBuilder
onlyBpmn()
Acquire only jobs which are linked to a process instance.ExternalWorkerJobAcquireBuilder
onlyCmmn()
Acquire only jobs which are linked to a case instance.ExternalWorkerJobAcquireBuilder
scopeType(String scopeType)
Acquire only jobs which are linked to the given scope type.ExternalWorkerJobAcquireBuilder
tenantId(String tenantId)
Acquire only jobs which are within the given tenant.ExternalWorkerJobAcquireBuilder
topic(String topic, Duration lockDuration)
The topic and lock duration for the requested jobs
-
-
-
Method Detail
-
topic
ExternalWorkerJobAcquireBuilder topic(String topic, Duration lockDuration)
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
ExternalWorkerJobAcquireBuilder scopeType(String scopeType)
Acquire only jobs which are linked to the given scope type. Cannot be combined withonlyBpmn()
oronlyCmmn()
-
tenantId
ExternalWorkerJobAcquireBuilder tenantId(String tenantId)
Acquire only jobs which are within the given tenant.
-
forUserOrGroups
ExternalWorkerJobAcquireBuilder forUserOrGroups(String userId, Collection<String> groups)
Acquire only jobs where the given user or groups are authorized to execute.
-
acquireAndLock
default List<AcquiredExternalWorkerJob> acquireAndLock(int numberOfTasks, String workerId)
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
-
-