Task

This module provides access to the task REST api of Camunda.

Task

class pycamunda.task.Task(assignee: str, case_definition_id: str, case_execution_id: str, case_instance_id: str, delegation_state: str, description: str, execution_id: str, form_key: str, id_: str, name: str, owner: str, parent_task_id: str, priority: str, process_definition_id: str, process_instance_id: str, suspended: bool, task_definition_key: str, created: Optional[str] = None, due: Optional[str] = None, follow_up: Optional[str] = None)

Data class of task as returned by the REST api of Camunda.

created = None
due = None
follow_up = None

DelegationState

class pycamunda.task.DelegationState

An enumeration.

pending = 'PENDING'
resolved = 'RESOLVED'

Comment

class pycamunda.task.Comment(id_: str, user_id: str, task_id: str, message: str, root_process_instance_id: str, time: Optional[datetime.datetime] = None, removal_time: Optional[datetime.datetime] = None)

Data class of a comment that is attached to an user task.

removal_time = None
time = None

CountByCandidateGroup

class pycamunda.task.CountByCandidateGroup(group_name: Optional[str], task_count: int)

Data class of task count by candidate group.

Get

class pycamunda.task.Get(url: str, id_: str)

Get an user task.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the user task.
__call__(*args, **kwargs) → pycamunda.task.Task

Send the request.

GetList

class pycamunda.task.GetList(url: str, process_instance_id: Optional[str] = None, process_instance_id_in: Optional[Iterable[str]] = None, process_instance_business_key: Optional[str] = None, process_instance_business_key_in: Optional[Iterable[str]] = None, process_instance_business_key_like: Optional[str] = None, process_definition_id: Optional[str] = None, process_definition_key: Optional[str] = None, process_definition_key_in: Optional[Iterable[str]] = None, process_definition_name: Optional[str] = None, process_definition_name_like: Optional[str] = None, execution_id: Optional[str] = None, case_instance_id: Optional[str] = None, case_instance_business_key: Optional[str] = None, case_instance_business_key_like: Optional[str] = None, case_definition_id: Optional[str] = None, case_definition_key: Optional[str] = None, case_instance_name: Optional[str] = None, case_instance_name_like: Optional[str] = None, case_execution_id: Optional[str] = None, activity_instance_id_in: Optional[Iterable[str]] = None, tenant_id_in: Optional[Iterable[str]] = None, without_tenant_id: bool = False, assignee: Optional[str] = None, assignee_like: Optional[str] = None, assignee_in: Optional[Iterable[str]] = None, owner: Optional[str] = None, candidate_group: Optional[str] = None, candidate_user: Optional[str] = None, include_assigned_tasks: Optional[bool] = None, involved_user: Optional[str] = None, assigned: Optional[bool] = None, unassigned: Optional[bool] = None, task_definition_key: Optional[str] = None, task_definition_key_in: Optional[Iterable[str]] = None, task_definition_key_like: Optional[str] = None, name: Optional[str] = None, name_not_equal: Optional[str] = None, name_like: Optional[str] = None, name_not_like: Optional[str] = None, description: Optional[str] = None, description_like: Optional[str] = None, priority: Optional[int] = None, max_priority: Optional[int] = None, min_priority: Optional[int] = None, due_date: Optional[datetime.datetime] = None, due_after: Optional[datetime.datetime] = None, due_before: Optional[datetime.datetime] = None, follow_up_date: Optional[datetime.datetime] = None, follow_up_after: Optional[datetime.datetime] = None, follow_up_before: Optional[datetime.datetime] = None, follow_up_before_or_not_existent: Optional[datetime.datetime] = None, created_on: Optional[datetime.datetime] = None, created_after: Optional[datetime.datetime] = None, created_before: Optional[datetime.datetime] = None, delegation_state: Union[str, pycamunda.task.DelegationState, None] = None, candidate_groups: Optional[Iterable[str]] = None, with_candidate_groups: bool = False, without_candidate_groups: bool = False, with_candidate_users: bool = False, without_candidate_users: bool = False, active: bool = False, suspended: bool = False, parent_task_id: Optional[str] = None, sort_by: Optional[str] = None, ascending: bool = True, first_result: Optional[int] = None, max_results: Optional[int] = None)

Get a list of user tasks.

Parameters:
  • url – Camunda Rest engine URL.
  • process_instance_id – Filter by the process instance id.
  • process_instance_id_in – Filter whether the process instance id is one of mutliple ones.
  • process_instance_business_key – Filter by the business key of the process instance.
  • process_instance_business_key_in – Filter whether the process instance business key is one of multiple ones.
  • process_instance_business_key_like – Filter by a substring of the process instance business key.
  • process_definition_id – Filter by the process definition id.
  • process_definition_key – Filter by the process definition key.
  • process_definition_key_in – Filter whether the the process definition key is one of multiple ones.
  • process_definition_name – Filter by the process definition name.
  • process_definition_name_like – Filter by a substring of the process definition name.
  • execution_id – Filter by execution id.
  • case_instance_id – Filter by case instance id.
  • case_instance_business_key – Filter by case instance business key.
  • case_instance_business_key_like – Filter by a substring of the case instance business key.
  • case_definition_id – Filter by case definition id.
  • case_definition_key – Filter by case definition key.
  • case_instance_name – Filter by case instance name.
  • case_instance_name_like – Filter by a substring of the case instance name.
  • case_execution_id – Filter by case execution id.
  • activity_instance_id_in – Filter whether the activity instance id is one of multiple ones.
  • tenant_id_in – Filter whether the tenant id is one of multiple ones.
  • without_tenant_id – Whether to include only tasks that belong to no tenant.
  • assignee – Filter by assignee.
  • assignee_like – Filter by a substring of the assignee.
  • assignee_in – Filter whether the assignee is one of multiple ones.
  • owner – Filter by owner.
  • candidate_group – Filter by candidate group.
  • candidate_user – Filter by candidate user.
  • include_assigned_tasks – Include only tasks that are assigned to an user.
  • involved_user – Filter whether a user is involved in the task in some way. (e.g. assigned)
  • assigned – Filter whether the task is assigned.
  • unassigned – Filter whether the task is unassigned.
  • task_definition_key – Filter by task definition key.
  • task_definition_key_in – Filter whether the task definition key is one of multiple ones.
  • task_definition_key_like – Filter by a substring of the task definition key.
  • name – Filter by name.
  • name_not_equal – Filter tasks whose names are not equal the provided value.
  • name_like – Filter by a substring of the name.
  • name_not_like – Filter tasks whose names do not have the provided value as substring.
  • description – Filter by description.
  • description_like – Filter by a substring of the description.
  • priority – Filter by priority.
  • max_priority – Filter tasks whose priority is less than or equal the provided value.
  • min_priority – Filter tasks whose priority is greater than or equal the provided value.
  • due_date – Filter by due date.
  • due_after – Include only tasks whose due date expires after the provided date.
  • due_before – Include only tasks whose due date expires before the provided date.
  • follow_up_date – Filter by follow up date.
  • follow_up_after – Include only tasks whose follow up date expires after the provided date.
  • follow_up_before – Include only tasks whose follow up date expires before the provided date.
  • follow_up_before_or_not_existent – Include only tasks whose follow up date expires before the provided date or have no follow up date.
  • created_on – Filter by the creation date.
  • created_after – Include only tasks whose creation date expires after the provided date.
  • created_before – Include only tasks whose creation date expires before the provided date.
  • delegation_state – Filter by delegation state. Valid values are ‘PENDING’ and ‘RESOLVED’.
  • candidate_groups – Filter whether the candidate group is one of multiple ones.
  • with_candidate_groups – Filter whether the task has a candidate group.
  • without_candidate_groups – Filter whether the task has no candidate group.
  • with_candidate_users – Filter whether the task has candidate users.
  • without_candidate_users – Filter whether the nas no candidate users.
  • active – Filter whether the task is active.
  • suspended – Filter whether the is suspended.
  • parent_task_id – Filter by parent task id.
  • sort_by – Sort the results by ‘instance_id’, ‘case_instance_id’, ‘due_date’, ‘execution_id’, ‘case_execution_id’, ‘assignee’, ‘created’, ‘description’, ‘id’, ‘name’, ‘name_case_insensitive’ or ‘priority’.
  • ascending – Sort order.
  • first_result – Pagination of results. Index of the first result to return.
  • max_results – Pagination of results. Maximum number of results to return.
__call__(*args, **kwargs) → Tuple[pycamunda.task.Task]

Send the request.

Claim

class pycamunda.task.Claim(url: str, id_: str, user_id: str)

Claim a user task for a specific user. Only tasks that are not already claimed by other users can be claimed. To change the assignee of a task independently on whether it is already claimed by an user, the class ‘SetAssignee’ can be used.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the user task.
  • user_id – Id of the user to set as assignee for the task.
__call__(*args, **kwargs) → None

Send the request.

Unclaim

class pycamunda.task.Unclaim(url: str, id_: str)

Unclaim an user task.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the user task.
__call__(*args, **kwargs) → None

Send the request.

Complete

class pycamunda.task.Complete(url: str, id_: str, with_variables_in_return: bool = False)

Complete an user task.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the user task.
__call__(*args, **kwargs) → Optional[Dict[str, pycamunda.variable.Variable]]

Send the request.

add_variable(name: str, value: Any, type_: Optional[str] = None, value_info: Optional[Any] = None) → None

Add a variable to send to the Camunda process instance.

Parameters:
  • name – Name of the variable.
  • value – Value of the variable.
  • type – Value type of the variable.
  • value_info – Additional information regarding the value type.

Resolve

class pycamunda.task.Resolve(url: str, id_: str)

Resolve an user task that was delegated to the current assignee and send it back to the original owner. It is necessary that the task was delegated. The assignee of the user task will be set back to the owner of the task.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the user task.
__call__(*args, **kwargs) → None

Send the request.

add_variable(name: str, value: Any, type_: Optional[str] = None, value_info: Optional[Any] = None) → None

Add a variable to send to the Camunda process instance.

Parameters:
  • name – Name of the variable.
  • value – Value of the variable.
  • type – Value type of the variable.
  • value_info – Additional information regarding the value type.

SetAssignee

class pycamunda.task.SetAssignee(url: str, id_: str, user_id: str)

Set the assignee for an user task. Overwrites existing assignees.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the user task.
  • user_id – Id of the user to set as assignee for the task.
__call__(*args, **kwargs) → None

Send the request.

Delegate

class pycamunda.task.Delegate(url: str, id_: str, user_id: str)

Delegate an user task to an user.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the user task.
  • user_id – Id of the user.
__call__(*args, **kwargs) → None

Send the request.

Create

class pycamunda.task.Create(url: str, id_: str, name: Optional[str] = None, description: Optional[str] = None, assignee: Optional[str] = None, owner: Optional[str] = None, delegation_state: Union[str, pycamunda.task.DelegationState, None] = None, due: Optional[datetime.datetime] = None, follow_up: Optional[datetime.datetime] = None, priority: Optional[int] = None, parent_task_id: Optional[str] = None, case_instance_id: Optional[str] = None, tenant_id: Optional[str] = None)

Create an user task.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the task.
  • name – Name of the task.
  • description – Description of the task.
  • assignee – The user the task is assigned to.
  • owner – The owner of the task.
  • delegation_state – The delegation state. Valid values are ‘RESOLVED’ and ‘PENDING’.
  • due – Due date of the task.
  • follow_up – Follow up date of the task.
  • priority – Priority of the task.
  • parent_task_id – Id of the parent task in case this task is a subtask.
  • case_instance_id – Id of the case instance.
  • tenant_id – Id of the tenant.
__call__(*args, **kwargs) → None

Send the request.

Update

class pycamunda.task.Update(url: str, id_: str, name: str, description: str, assignee: str, owner: str, delegation_state: Union[str, pycamunda.task.DelegationState], due: datetime.datetime, follow_up: datetime.datetime, priority: int, parent_task_id: str, case_instance_id: str, tenant_id: str)

Update an user task.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the task.
  • name – Name of the task.
  • description – Description of the task.
  • assignee – The user the task is assigned to.
  • owner – The owner of the task.
  • delegation_state – The delegation state. Valid values are ‘RESOLVED’ and ‘PENDING’.
  • due – Due date of the task.
  • follow_up – Follow up date of the task.
  • priority – Priority of the task.
  • parent_task_id – Id of the parent task in case this task is a subtask.
  • case_instance_id – Id of the case instance.
  • tenant_id – Id of the tenant. Cannot be changed. Has to be the same value as the task already has.
__call__(*args, **kwargs) → None

Send the request.

IdentityLinksGetList

class pycamunda.task.IdentityLinksGetList(url: str, task_id: Optional[str] = None, type_: Optional[str] = None)

Get the identity links of an user task.

An identity link is a relationship between an user task and an user or a group. E.g. when the user is the assignee / owner or one of the candidate users of the task.

Parameters:
  • url – Camunda Rest engine URL.
  • task_id – Id of the task.
  • type – Type of the identity link. Can be any custom string. Pre-defined types are ‘assignee’ (user), ‘owner’ (user) and ‘candidate’ (user / group).
__call__(*args, **kwargs) → Tuple[pycamunda.task.IdentityLink]

Send the request.

IdentityLinksAdd

class pycamunda.task.IdentityLinksAdd(url: str, task_id: str, type_: str, user_id: Optional[str] = None, group_id: Optional[str] = None)

Add an identity link to an user task.

An identity link is a relationship between an user task and an user or a group. E.g. when the user is the assignee / owner or one of the candidate users of the task.

Parameters:
  • url – Camunda Rest engine URL.
  • task_id – Id of the task.
  • user_id – Id of the user. Can not be provided if group_id is provided.
  • group_id – Id of the groupt. Can not be provided if user_id is provided.
  • type – Type of the identity link. Can be any custom string. Pre-defined types are ‘assignee’ (user), ‘owner’ (user) and ‘candidate’ (user / group).
__call__(*args, **kwargs) → None

Send the request.

IdentityLinksDelete

class pycamunda.task.IdentityLinksDelete(url: str, task_id: str, type_: str, user_id: Optional[str] = None, group_id: Optional[str] = None)

Delete an identity link of an user task.

An identity link is a relationship between an user task and an user or a group. E.g. when the user is the assignee / owner or one of the candidate users of the task.

Parameters:
  • url – Camunda Rest engine URL.
  • task_id – Id of the task.
  • user_id – Id of the user. Can not be provided if group_id is provided.
  • group_id – Id of the groupt. Can not be provided if user_id is provided.
  • type – Type of the identity link. Can be any custom string. Pre-defined types are ‘assignee’ (user), ‘owner’ (user) and ‘candidate’ (user / group).
__call__(*args, **kwargs) → None

Send the request.

CommentGetList

class pycamunda.task.CommentGetList(url: str, task_id: str)

Get the comments for an user task.

Parameters:
  • url – Camunda Rest engine URL.
  • task_id – Id of the task.
__call__(*args, **kwargs) → Tuple[pycamunda.task.Comment]

Send the request.

CommentGet

class pycamunda.task.CommentGet(url: str, task_id: str, comment_id: str)

Get a comment for an user task.

Parameters:
  • url – Camunda Rest engine URL.
  • task_id – Id of the task.
  • comment_id – Id of the comment.
__call__(*args, **kwargs) → pycamunda.task.Comment

Send the request.

CommentCreate

class pycamunda.task.CommentCreate(url: str, task_id: str, message: str)

Create a comment for an user task.

Parameters:
  • url – Camunda Rest engine URL.
  • task_id – Id of the task.
  • message – Message of the task.
__call__(*args, **kwargs) → pycamunda.task.Comment

Send the request.

LocalVariablesGet

class pycamunda.task.LocalVariablesGet(url: str, task_id: str, var_name: str, deserialize_value: bool = False, binary: bool = False)

Get a local variable of an user task.

Local variables are variables that do only exist in the context of a task.

Parameters:
  • url – Camunda Rest engine URL.
  • task_id – Id of the task.
  • var_name – Name of the variable.
  • deserialize_value – Whether serializable variable values are deserialized on server side.
  • binary – Whether the requested variable is a binary array or file variable.
__call__(*args, **kwargs) → pycamunda.variable.Variable

Send the request.

LocalVariablesGetList

class pycamunda.task.LocalVariablesGetList(url: str, task_id: str, deserialize_values: bool = False)

Get local variables of an user task.

Local variables are variables that do only exist in the context of a task.

Parameters:
  • url – Camunda Rest engine URL.
  • task_id – Id of the task.
  • deserialize_values – Whether serializable variable values are deserialized on server side.
__call__(*args, **kwargs) → Dict[str, pycamunda.variable.Variable]

Send the request.

LocalVariablesModify

class pycamunda.task.LocalVariablesModify(url: str, task_id: str, deletions: Optional[Iterable[str]] = None)

Modify local variables of an user task. This can be either updating or deleting variables.

Local variables are variables that do only exist in the context of a task.

Parameters:
  • url – Camunda Rest engine URL.
  • task_id – Id of the task.
  • deletions – Variables to delete.
__call__(*args, **kwargs) → None

Send the request.

add_variable(name: str, value: Any, type_: Optional[str] = None, value_info: Optional[Any] = None) → None

Add a variable to modify.

Parameters:
  • name – Name of the variable.
  • value – Value of the variable.
  • type – Value type of the variable.
  • value_info – Additional information regarding the value type.

LocalVariablesUpdate

class pycamunda.task.LocalVariablesUpdate(url: str, task_id: str, var_name: str, value: Any, type_: Optional[str] = None, value_info: Optional[Any] = None)

Update a local variable. May be used with binary and file variables.

Local variables are variables that do only exist in the context of a task.

Parameters:
  • url – Camunda Rest engine URL.
  • task_id – Id of the task.
  • var_name – Name of the variable.
  • value – Value of the variable.
  • type – Value type of the variable. To send binary variables use the value ‘Bytes’ and to send the binary value of a file variable use the value ‘File’ for this parameter.
  • value_info – Additional information regarding the value type. Ignored if ‘type_’ is ‘Bytes’ or ‘File’.
__call__(*args, **kwargs) → None

Send the request.

LocalVariablesDelete

class pycamunda.task.LocalVariablesDelete(url: str, task_id: str, var_name: str)

Delete a local variable.

Local variables are variables that do only exist in the context of a task.

Parameters:
  • url – Camunda Rest engine URL.
  • task_id – Id of the task.
  • var_name – Name of the variable.
__call__(*args, **kwargs) → None

Send the request.

GetCountByCandidateGroup

class pycamunda.task.GetCountByCandidateGroup(url: str)

Get the number of tasks for each candidate group.

Parameters:url – Camunda Rest engine URL.
__call__(*args, **kwargs) → Tuple[pycamunda.task.CountByCandidateGroup]

Send the request.