Class ExternalTaskQueryTopicBuilderImpl
java.lang.Object
org.camunda.bpm.engine.impl.externaltask.ExternalTaskQueryTopicBuilderImpl
- All Implemented Interfaces:
ExternalTaskQueryBuilder,ExternalTaskQueryTopicBuilder
public class ExternalTaskQueryTopicBuilderImpl
extends Object
implements ExternalTaskQueryTopicBuilder
- Author:
- Thorben Lindhauer, Christopher Zell
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CommandExecutorprotected TopicFetchInstructionprotected Map<String,TopicFetchInstruction> protected intprotected List<QueryOrderingProperty>protected booleanIndicates that priority is enabled.protected String -
Constructor Summary
ConstructorsConstructorDescriptionCopy constructorExternalTaskQueryTopicBuilderImpl(CommandExecutor commandExecutor, String workerId, int maxTasks, boolean usePriority) Constructor using priority.ExternalTaskQueryTopicBuilderImpl(CommandExecutor commandExecutor, String workerId, int maxTasks, boolean usePriority, List<QueryOrderingProperty> orderingProperties) Constructor using priority & createTime.ExternalTaskQueryTopicBuilderImpl(CommandExecutor commandExecutor, String workerId, int maxTasks, boolean usePriority, List<QueryOrderingProperty> orderingProperties, Map<String, TopicFetchInstruction> instructions, TopicFetchInstruction currentInstruction) All args constructor. -
Method Summary
Modifier and TypeMethodDescriptionbusinessKey(String businessKey) Define business key value to filter external tasks by (Process Instance) Business Key.Enable deserialization of variable values that are custom objects.execute()Performs the fetching.Configure the query to include custom extension properties, if available, for all fetched tasks.Define whether only local variables will be fetched with all tasks for the current topic.processDefinitionId(String processDefinitionId) Define process definition id to filter external tasks by.processDefinitionIdIn(String... processDefinitionIds) Define process definition ids to filter external tasksb by.processDefinitionKey(String processDefinitionKey) Define process definition key to filter external tasks by.processDefinitionKeyIn(String... processDefinitionKeys) Define process definition keys to filter external tasks by.processDefinitionVersionTag(String processDefinitionVersionTag) Define a process definition version tag to filter external tasks by.processInstanceVariableEquals(String name, Object value) Define a single variable and its name to filter tasks in a topic.processInstanceVariableEquals(Map<String, Object> variables) Define a HashMap of variables and their values to filter correlated tasks.protected voidtenantIdIn(String... tenantIds) Define tenant ids to filter external tasks by.Specifies that tasks of a topic should be fetched and locked for a certain amount of timeDefine variables to fetch with all tasks for the current topic.Define variables to fetch with all tasks for the current topic.Filter external tasks only with null tenant id.
-
Field Details
-
commandExecutor
-
workerId
-
maxTasks
protected int maxTasks -
usePriority
protected boolean usePriorityIndicates that priority is enabled. -
orderingProperties
-
instructions
-
currentInstruction
-
-
Constructor Details
-
ExternalTaskQueryTopicBuilderImpl
public ExternalTaskQueryTopicBuilderImpl(CommandExecutor commandExecutor, String workerId, int maxTasks, boolean usePriority, List<QueryOrderingProperty> orderingProperties, Map<String, TopicFetchInstruction> instructions, TopicFetchInstruction currentInstruction) All args constructor. -
ExternalTaskQueryTopicBuilderImpl
public ExternalTaskQueryTopicBuilderImpl(CommandExecutor commandExecutor, String workerId, int maxTasks, boolean usePriority, List<QueryOrderingProperty> orderingProperties) Constructor using priority & createTime. -
ExternalTaskQueryTopicBuilderImpl
public ExternalTaskQueryTopicBuilderImpl(CommandExecutor commandExecutor, String workerId, int maxTasks, boolean usePriority) Constructor using priority. -
ExternalTaskQueryTopicBuilderImpl
Copy constructor
-
-
Method Details
-
execute
Description copied from interface:ExternalTaskQueryBuilderPerforms the fetching. Locks candidate tasks of the given topics for the specified duration.- Specified by:
executein interfaceExternalTaskQueryBuilder- Returns:
- fetched external tasks that match the topic and that can be successfully locked
-
topic
Description copied from interface:ExternalTaskQueryBuilderSpecifies that tasks of a topic should be fetched and locked for a certain amount of time- Specified by:
topicin 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
Description copied from interface:ExternalTaskQueryTopicBuilderDefine variables to fetch with all tasks for the current topic. Calling this method multiple times overrides the previously specified variables.- Specified by:
variablesin interfaceExternalTaskQueryTopicBuilder- Parameters:
variables- the variable names to fetch, if null all variables will be fetched- Returns:
- this builder
-
variables
Description copied from interface:ExternalTaskQueryTopicBuilderDefine variables to fetch with all tasks for the current topic. Calling this method multiple times overrides the previously specified variables.- Specified by:
variablesin interfaceExternalTaskQueryTopicBuilder- Parameters:
variables- the variable names to fetch, if null all variables will be fetched- Returns:
- this builder
-
processInstanceVariableEquals
Description copied from interface:ExternalTaskQueryTopicBuilderDefine a HashMap of variables and their values to filter correlated tasks. Calling this method multiple times overrides the previously specified variables.- Specified by:
processInstanceVariableEqualsin interfaceExternalTaskQueryTopicBuilder- Parameters:
variables- a HashMap of the variable names (keys) and the values to filter by- Returns:
- this builder
-
processInstanceVariableEquals
Description copied from interface:ExternalTaskQueryTopicBuilderDefine 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:
processInstanceVariableEqualsin 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
Description copied from interface:ExternalTaskQueryTopicBuilderDefine business key value to filter external tasks by (Process Instance) Business Key.- Specified by:
businessKeyin interfaceExternalTaskQueryTopicBuilder- Parameters:
businessKey- the value of the Business Key to filter by- Returns:
- this builder
-
processDefinitionId
Description copied from interface:ExternalTaskQueryTopicBuilderDefine process definition id to filter external tasks by.- Specified by:
processDefinitionIdin interfaceExternalTaskQueryTopicBuilder- Parameters:
processDefinitionId- the definition id to filter by- Returns:
- this builder
-
processDefinitionIdIn
Description copied from interface:ExternalTaskQueryTopicBuilderDefine process definition ids to filter external tasksb by.- Specified by:
processDefinitionIdInin interfaceExternalTaskQueryTopicBuilder- Parameters:
processDefinitionIds- the definition ids to filter by- Returns:
- this builder
-
processDefinitionKey
Description copied from interface:ExternalTaskQueryTopicBuilderDefine process definition key to filter external tasks by.- Specified by:
processDefinitionKeyin interfaceExternalTaskQueryTopicBuilder- Parameters:
processDefinitionKey- the definition key to filter by- Returns:
- this builder
-
processDefinitionKeyIn
Description copied from interface:ExternalTaskQueryTopicBuilderDefine process definition keys to filter external tasks by.- Specified by:
processDefinitionKeyInin interfaceExternalTaskQueryTopicBuilder- Returns:
- this builder
-
processDefinitionVersionTag
public ExternalTaskQueryTopicBuilder processDefinitionVersionTag(String processDefinitionVersionTag) Description copied from interface:ExternalTaskQueryTopicBuilderDefine a process definition version tag to filter external tasks by.- Specified by:
processDefinitionVersionTagin interfaceExternalTaskQueryTopicBuilder- Parameters:
processDefinitionVersionTag- the version tag to filter by- Returns:
- this builder
-
withoutTenantId
Description copied from interface:ExternalTaskQueryTopicBuilderFilter external tasks only with null tenant id.- Specified by:
withoutTenantIdin interfaceExternalTaskQueryTopicBuilder- Returns:
- this builder
-
tenantIdIn
Description copied from interface:ExternalTaskQueryTopicBuilderDefine tenant ids to filter external tasks by.- Specified by:
tenantIdInin interfaceExternalTaskQueryTopicBuilder- Parameters:
tenantIds- the tenant ids to filter by- Returns:
- this builder
-
submitCurrentInstruction
protected void submitCurrentInstruction() -
enableCustomObjectDeserialization
Description copied from interface:ExternalTaskQueryTopicBuilderEnable deserialization of variable values that are custom objects. By default, the query will not attempt to deserialize the value of these variables.- Specified by:
enableCustomObjectDeserializationin interfaceExternalTaskQueryTopicBuilder- Returns:
- this builder
-
localVariables
Description copied from interface:ExternalTaskQueryTopicBuilderDefine whether only local variables will be fetched with all tasks for the current topic.- Specified by:
localVariablesin interfaceExternalTaskQueryTopicBuilder- Returns:
- this builder
-
includeExtensionProperties
Description copied from interface:ExternalTaskQueryTopicBuilderConfigure the query to include custom extension properties, if available, for all fetched tasks.- Specified by:
includeExtensionPropertiesin interfaceExternalTaskQueryTopicBuilder- Returns:
- this builder
-