Case Instance

This module provides access to the case instance REST api of Camunda.

CaseInstance

class pycamunda.caseinst.CaseInstance(id_: str, definition_id: str, tenant_id: str, business_key: str, active: bool, completed: Optional[bool] = None)

Data class of case instance as returned by the REST api of Camunda.

completed = None

GetList

class pycamunda.caseinst.GetList(url: str, case_instance_id: Optional[str] = None, business_key: Optional[str] = None, case_definition_id: Optional[str] = None, case_definition_key: Optional[str] = None, deployment_id: Optional[str] = None, super_process_instance: Optional[str] = None, sub_process_instance: Optional[str] = None, super_case_instance: Optional[str] = None, sub_case_instance: Optional[str] = None, active: bool = False, completed: bool = False, tenant_id_in: Optional[Iterable[str]] = None, without_tenant_id: bool = False, variable_names_ignore_case: bool = False, variable_values_ignore_case: bool = False, sort_by: Optional[str] = None, ascending: bool = True, first_result: Optional[int] = None, max_results: Optional[int] = None)

Get a list of case instances.

Parameters:
  • url – Camunda Rest engine URL.
  • case_instance_id – Filter by case instance id.
  • business_key – Filter by business key.
  • case_definition_id – Filter by case definition id.
  • case_definition_key – Filter by case definition key.
  • deployment_id – Filter by deployment id.
  • super_process_instance – Filter by the id of the super process instance.
  • sub_process_instance – Filter by the id of sub process instance.
  • super_case_instance – Filter by the id of the super case instance.
  • sub_case_instance – Filter by the id of sub case instance.
  • active – Whether to include only active case instances.
  • completed – Whether to include only complete case instances.
  • tenant_id_in – Filter whether the tenant id is one of multiple ones.
  • without_tenant_id – Whether to include only case instances that belong to no tenant.
  • variable_names_ignore_case – Whether to match variables names case-insensitively.
  • variable_values_ignore_case – Whether to match variables values case-insensitively.
  • sort_by – Sort the results by ‘batch_id’ or ‘tenant_id’.
  • 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.caseinst.CaseInstance]

Send the request.

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

Only include case instances with variables with specific values.

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.

Count

class pycamunda.caseinst.Count(url: str, case_instance_id: Optional[str] = None, business_key: Optional[str] = None, case_definition_id: Optional[str] = None, case_definition_key: Optional[str] = None, deployment_id: Optional[str] = None, super_process_instance: Optional[str] = None, sub_process_instance: Optional[str] = None, super_case_instance: Optional[str] = None, sub_case_instance: Optional[str] = None, active: bool = False, completed: bool = False, tenant_id_in: Optional[Iterable[str]] = None, without_tenant_id: bool = False, variable_names_ignore_case: bool = False, variable_values_ignore_case: bool = False)

Count a list of case instances.

Parameters:
  • url – Camunda Rest engine URL.
  • case_instance_id – Filter by case instance id.
  • business_key – Filter by business key.
  • case_definition_id – Filter by case definition id.
  • case_definition_key – Filter by case definition key.
  • deployment_id – Filter by deployment id.
  • super_process_instance – Filter by the id of the super process instance.
  • sub_process_instance – Filter by the id of sub process instance.
  • super_case_instance – Filter by the id of the super case instance.
  • sub_case_instance – Filter by the id of sub case instance.
  • active – Whether to include only active case instances.
  • completed – Whether to include only complete case instances.
  • tenant_id_in – Filter whether the tenant id is one of multiple ones.
  • without_tenant_id – Whether to include only case instances that belong to no tenant.
  • variable_names_ignore_case – Whether to match variables names case-insensitively.
  • variable_values_ignore_case – Whether to match variables values case-insensitively.
__call__(*args, **kwargs) → int

Send the request.

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

Only count case instances with variables with specific values.

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.

Get

class pycamunda.caseinst.Get(url: str, id_: str, case_definition_id: Optional[str] = None, business_key: Optional[str] = None, active: bool = False, completed: bool = False, tenant_id: Optional[Iterable[str]] = None)

Get a case instance.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the case instance.
  • case_definition_id – Id of the case definition the case instance belongs to.
  • business_key – The business key of the case instance.
  • active – Whether the case instance is active.
  • completed – Whether the case instance is completed.
  • tenant_id – The tenant id of the case instance.
__call__(*args, **kwargs) → pycamunda.caseinst.CaseInstance

Send the request.

Complete

class pycamunda.caseinst.Complete(url: str, id_: str, deletions: Optional[Iterable[str]] = None)

Performs a transition from ACTIVE state to COMPLETED state. In addition to that, case instance variables can be updated and deleted.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the case instance.
  • deletions – Variables to delete. Is executed for creating or updating variables.
__call__(*args, **kwargs) → None

Send the request.

Close

class pycamunda.caseinst.Close(url: str, id_: str, deletions: Optional[Iterable[str]] = None)

Performs a transition from COMPLETED state to CLOSED state. In addition to that, case instance variables can be updated and deleted.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the case instance.
  • deletions – Variables to delete. Is executed for creating or updating variables.
__call__(*args, **kwargs) → None

Send the request.

Terminate

class pycamunda.caseinst.Terminate(url: str, id_: str, deletions: Optional[Iterable[str]] = None)

Performs a transition from ACTIVE state to TERMINATED state. In addition to that, case instance variables can be updated and deleted.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the case instance.
  • deletions – Variables to delete. Is executed for creating or updating variables.
__call__(*args, **kwargs) → None

Send the request.