Class ExternalTaskQueryTopicBuilderImpl
- java.lang.Object
-
- org.camunda.bpm.engine.impl.externaltask.ExternalTaskQueryTopicBuilderImpl
-
- All Implemented Interfaces:
ExternalTaskQueryBuilder
,ExternalTaskQueryTopicBuilder
public class ExternalTaskQueryTopicBuilderImpl extends java.lang.Object implements ExternalTaskQueryTopicBuilder
- Author:
- Thorben Lindhauer, Christopher Zell
-
-
Field Summary
Fields Modifier and Type Field Description protected CommandExecutor
commandExecutor
protected TopicFetchInstruction
currentInstruction
protected java.util.Map<java.lang.String,TopicFetchInstruction>
instructions
protected int
maxTasks
protected boolean
usePriority
Indicates that priority is enabled.protected java.lang.String
workerId
-
Constructor Summary
Constructors Constructor Description ExternalTaskQueryTopicBuilderImpl(CommandExecutor commandExecutor, java.lang.String workerId, int maxTasks, boolean usePriority)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExternalTaskQueryTopicBuilder
businessKey(java.lang.String businessKey)
Define business key value to filter external tasks by (Process Instance) Business Key.ExternalTaskQueryTopicBuilder
enableCustomObjectDeserialization()
Enable deserialization of variable values that are custom objects.java.util.List<LockedExternalTask>
execute()
Performs the fetching.ExternalTaskQueryTopicBuilder
includeExtensionProperties()
Configure the query to include custom extension properties, if available, for all fetched tasks.ExternalTaskQueryTopicBuilder
localVariables()
Define whether only local variables will be fetched with all tasks for the current topic.ExternalTaskQueryTopicBuilder
processDefinitionId(java.lang.String processDefinitionId)
Define process definition id to filter external tasks by.ExternalTaskQueryTopicBuilder
processDefinitionIdIn(java.lang.String... processDefinitionIds)
Define process definition ids to filter external tasksb by.ExternalTaskQueryTopicBuilder
processDefinitionKey(java.lang.String processDefinitionKey)
Define process definition key to filter external tasks by.ExternalTaskQueryTopicBuilder
processDefinitionKeyIn(java.lang.String... processDefinitionKeys)
Define process definition keys to filter external tasks by.ExternalTaskQueryTopicBuilder
processDefinitionVersionTag(java.lang.String processDefinitionVersionTag)
Define a process definition version tag to filter external tasks by.ExternalTaskQueryTopicBuilder
processInstanceVariableEquals(java.lang.String name, java.lang.Object value)
Define a single variable and its name to filter tasks in a topic.ExternalTaskQueryTopicBuilder
processInstanceVariableEquals(java.util.Map<java.lang.String,java.lang.Object> variables)
Define a HashMap of variables and their values to filter correlated tasks.protected void
submitCurrentInstruction()
ExternalTaskQueryTopicBuilder
tenantIdIn(java.lang.String... tenantIds)
Define tenant ids to filter external tasks by.ExternalTaskQueryTopicBuilder
topic(java.lang.String topicName, long lockDuration)
Specifies that tasks of a topic should be fetched and locked for a certain amount of timeExternalTaskQueryTopicBuilder
variables(java.lang.String... variables)
Define variables to fetch with all tasks for the current topic.ExternalTaskQueryTopicBuilder
variables(java.util.List<java.lang.String> variables)
Define variables to fetch with all tasks for the current topic.ExternalTaskQueryTopicBuilder
withoutTenantId()
Filter external tasks only with null tenant id.
-
-
-
Field Detail
-
commandExecutor
protected CommandExecutor commandExecutor
-
workerId
protected java.lang.String workerId
-
maxTasks
protected int maxTasks
-
usePriority
protected boolean usePriority
Indicates that priority is enabled.
-
instructions
protected java.util.Map<java.lang.String,TopicFetchInstruction> instructions
-
currentInstruction
protected TopicFetchInstruction currentInstruction
-
-
Constructor Detail
-
ExternalTaskQueryTopicBuilderImpl
public ExternalTaskQueryTopicBuilderImpl(CommandExecutor commandExecutor, java.lang.String workerId, int maxTasks, boolean usePriority)
-
-
Method Detail
-
execute
public java.util.List<LockedExternalTask> execute()
Description copied from interface:ExternalTaskQueryBuilder
Performs the fetching. Locks candidate tasks of the given topics for the specified duration.- Specified by:
execute
in interfaceExternalTaskQueryBuilder
- Returns:
- fetched external tasks that match the topic and that can be successfully locked
-
topic
public ExternalTaskQueryTopicBuilder topic(java.lang.String topicName, long lockDuration)
Description copied from interface:ExternalTaskQueryBuilder
Specifies that tasks of a topic should be fetched and locked for a certain amount of time- Specified by:
topic
in interfaceExternalTaskQueryBuilder
- Parameters:
topicName
- the name of the topiclockDuration
- the duration in milliseconds for which tasks should be locked; begins at the time of fetching- Returns:
-
variables
public ExternalTaskQueryTopicBuilder variables(java.lang.String... variables)
Description copied from interface:ExternalTaskQueryTopicBuilder
Define variables to fetch with all tasks for the current topic. Calling this method multiple times overrides the previously specified variables.- Specified by:
variables
in interfaceExternalTaskQueryTopicBuilder
- Parameters:
variables
- the variable names to fetch, if null all variables will be fetched- Returns:
- this builder
-
variables
public ExternalTaskQueryTopicBuilder variables(java.util.List<java.lang.String> variables)
Description copied from interface:ExternalTaskQueryTopicBuilder
Define variables to fetch with all tasks for the current topic. Calling this method multiple times overrides the previously specified variables.- Specified by:
variables
in interfaceExternalTaskQueryTopicBuilder
- Parameters:
variables
- the variable names to fetch, if null all variables will be fetched- Returns:
- this builder
-
processInstanceVariableEquals
public ExternalTaskQueryTopicBuilder processInstanceVariableEquals(java.util.Map<java.lang.String,java.lang.Object> variables)
Description copied from interface:ExternalTaskQueryTopicBuilder
Define a HashMap of variables and their values to filter correlated tasks. Calling this method multiple times overrides the previously specified variables.- Specified by:
processInstanceVariableEquals
in interfaceExternalTaskQueryTopicBuilder
- Parameters:
variables
- a HashMap of the variable names (keys) and the values to filter by- Returns:
- this builder
-
processInstanceVariableEquals
public ExternalTaskQueryTopicBuilder processInstanceVariableEquals(java.lang.String name, java.lang.Object value)
Description copied from interface:ExternalTaskQueryTopicBuilder
Define a single variable and its name to filter tasks in a topic. Multiple calls to this method add to the existing "variable filters".- Specified by:
processInstanceVariableEquals
in interfaceExternalTaskQueryTopicBuilder
- Parameters:
name
- the name of the variable you want to fetch and query byvalue
- the value of the variable which you want to filter- Returns:
- this builder
-
businessKey
public ExternalTaskQueryTopicBuilder businessKey(java.lang.String businessKey)
Description copied from interface:ExternalTaskQueryTopicBuilder
Define business key value to filter external tasks by (Process Instance) Business Key.- Specified by:
businessKey
in interfaceExternalTaskQueryTopicBuilder
- Parameters:
businessKey
- the value of the Business Key to filter by- Returns:
- this builder
-
processDefinitionId
public ExternalTaskQueryTopicBuilder processDefinitionId(java.lang.String processDefinitionId)
Description copied from interface:ExternalTaskQueryTopicBuilder
Define process definition id to filter external tasks by.- Specified by:
processDefinitionId
in interfaceExternalTaskQueryTopicBuilder
- Parameters:
processDefinitionId
- the definition id to filter by- Returns:
- this builder
-
processDefinitionIdIn
public ExternalTaskQueryTopicBuilder processDefinitionIdIn(java.lang.String... processDefinitionIds)
Description copied from interface:ExternalTaskQueryTopicBuilder
Define process definition ids to filter external tasksb by.- Specified by:
processDefinitionIdIn
in interfaceExternalTaskQueryTopicBuilder
- Parameters:
processDefinitionIds
- the definition ids to filter by- Returns:
- this builder
-
processDefinitionKey
public ExternalTaskQueryTopicBuilder processDefinitionKey(java.lang.String processDefinitionKey)
Description copied from interface:ExternalTaskQueryTopicBuilder
Define process definition key to filter external tasks by.- Specified by:
processDefinitionKey
in interfaceExternalTaskQueryTopicBuilder
- Parameters:
processDefinitionKey
- the definition key to filter by- Returns:
- this builder
-
processDefinitionKeyIn
public ExternalTaskQueryTopicBuilder processDefinitionKeyIn(java.lang.String... processDefinitionKeys)
Description copied from interface:ExternalTaskQueryTopicBuilder
Define process definition keys to filter external tasks by.- Specified by:
processDefinitionKeyIn
in interfaceExternalTaskQueryTopicBuilder
- Returns:
- this builder
-
processDefinitionVersionTag
public ExternalTaskQueryTopicBuilder processDefinitionVersionTag(java.lang.String processDefinitionVersionTag)
Description copied from interface:ExternalTaskQueryTopicBuilder
Define a process definition version tag to filter external tasks by.- Specified by:
processDefinitionVersionTag
in interfaceExternalTaskQueryTopicBuilder
- Parameters:
processDefinitionVersionTag
- the version tag to filter by- Returns:
- this builder
-
withoutTenantId
public ExternalTaskQueryTopicBuilder withoutTenantId()
Description copied from interface:ExternalTaskQueryTopicBuilder
Filter external tasks only with null tenant id.- Specified by:
withoutTenantId
in interfaceExternalTaskQueryTopicBuilder
- Returns:
- this builder
-
tenantIdIn
public ExternalTaskQueryTopicBuilder tenantIdIn(java.lang.String... tenantIds)
Description copied from interface:ExternalTaskQueryTopicBuilder
Define tenant ids to filter external tasks by.- Specified by:
tenantIdIn
in interfaceExternalTaskQueryTopicBuilder
- Parameters:
tenantIds
- the tenant ids to filter by- Returns:
- this builder
-
submitCurrentInstruction
protected void submitCurrentInstruction()
-
enableCustomObjectDeserialization
public ExternalTaskQueryTopicBuilder enableCustomObjectDeserialization()
Description copied from interface:ExternalTaskQueryTopicBuilder
Enable deserialization of variable values that are custom objects. By default, the query will not attempt to deserialize the value of these variables.- Specified by:
enableCustomObjectDeserialization
in interfaceExternalTaskQueryTopicBuilder
- Returns:
- this builder
-
localVariables
public ExternalTaskQueryTopicBuilder localVariables()
Description copied from interface:ExternalTaskQueryTopicBuilder
Define whether only local variables will be fetched with all tasks for the current topic.- Specified by:
localVariables
in interfaceExternalTaskQueryTopicBuilder
- Returns:
- this builder
-
includeExtensionProperties
public ExternalTaskQueryTopicBuilder includeExtensionProperties()
Description copied from interface:ExternalTaskQueryTopicBuilder
Configure the query to include custom extension properties, if available, for all fetched tasks.- Specified by:
includeExtensionProperties
in interfaceExternalTaskQueryTopicBuilder
- Returns:
- this builder
-
-