Process Definition

This module provides access to the process definition REST api of Camunda.

ProcessDefinition

class pycamunda.processdef.ProcessDefinition(id_: str, key: str, category: str, description: str, name: str, version: int, resource: str, deployment_id: str, diagram: str, suspended: bool, tenant_id: str, version_tag: str, history_time_to_live: int, startable_in_tasklist: bool)

Data class of process definition as returned by the REST api of Camunda.

ActivityStats

class pycamunda.processdef.ActivityStats(id_: str, instances: int, failed_jobs: int, incidents: Iterable[pycamunda.incident.IncidentTypeCount])

Data class of activity statistics as returned by the REST api of Camunda.

ProcessInstanceStats

class pycamunda.processdef.ProcessInstanceStats(id_: str, instances: int, failed_jobs: int, definition: pycamunda.processdef.ProcessDefinition, incidents: Iterable[pycamunda.incident.IncidentTypeCount])

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

GetActivityInstanceStats

class pycamunda.processdef.GetActivityInstanceStats(url: str, id_: Optional[str] = None, key: Optional[str] = None, tenant_id: Optional[str] = None, failed_jobs: Optional[bool] = None, incidents: bool = False, incidents_for_type: Union[str, pycamunda.incident.IncidentType, None] = None)

Get runtime statistics for a process definition. Does not include historic data.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the process definition.
  • key – Key of the process definition.
  • tenant_id – Id of the tenant the process definition belongs to.
  • failed_jobs – Whether the number of failed jobs should be included.
  • incidents – Whether to include the number of incidents.
  • incidents_for_type – Include only incidents of a specific type.
__call__(*args, **kwargs) → Tuple[pycamunda.processdef.ActivityStats]

Send the request.

GetProcessDiagram

class pycamunda.processdef.GetProcessDiagram(url: str, id_: Optional[str] = None, key: Optional[str] = None, tenant_id: Optional[str] = None)

Get the diagram of a process definition.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the process definition.
  • key – Key of the process definition.
__call__(*args, **kwargs)

Send the request.

Count

class pycamunda.processdef.Count(url: str, id_: Optional[str] = None, id_in: Optional[Iterable[str]] = None, name: Optional[str] = None, name_like: Optional[str] = None, deployment_id: Optional[str] = None, key: Optional[str] = None, key_in: Optional[Iterable[str]] = None, key_like: Optional[str] = None, category: Optional[str] = None, category_like: Optional[str] = None, version: Optional[int] = None, latest_version: bool = False, resource_name: Optional[str] = None, resource_name_like: Optional[str] = None, startable_by: Optional[str] = None, active: bool = False, suspended: bool = False, incident_id: Optional[str] = None, incident_type: Union[str, pycamunda.incident.IncidentType, None] = None, incident_message: Optional[str] = None, incident_message_like: Optional[str] = None, tenant_id_in: Optional[Iterable[str]] = None, without_tenant_id: bool = False, include_without_tenant_id: bool = False, version_tag: Optional[str] = None, version_tag_like: Optional[str] = None, without_version_tag: Optional[bool] = None, startable_in_tasklist: Optional[bool] = None, startable_permission_check: Optional[bool] = None, not_startable_in_tasklist: Optional[bool] = None)

Count process definitions.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Filter by id.
  • id_in – Filter whether the id is one of multiple ones.
  • name – Filter by name.
  • name_like – Filter by a substring of the name.
  • deployment_id – Filter by deployment id.
  • key – Key of the process definition.
  • key_in – Filter whether the key is one of multiple ones.
  • key_like – Filter by a substring of the key.
  • category – Filter by category.
  • category_like – Filter by a substring of the category.
  • version – Filter by version.
  • latest_version – Whether to include only the latest versions.
  • resource_name – Filter by resource name.
  • resource_name_like – Filter by a substring of the resource name.
  • startable_by – Filter by user names that are allowed to start an instance of the process definition.
  • active – Whether to include only active process definitions.
  • suspended – Whether to include only suspended process definitions.
  • incident_id – Filter by incident id.
  • incident_type – Filter by incident type.
  • incident_message – Filter by the incident message.
  • incident_message_like – Filter by a substring the incident message.
  • tenant_id_in – Filter whether the tenant id is one of multiple ones.
  • without_tenant_id – Whether to include only process definitions that belong to no tenant.
  • include_without_tenant_id – Whether to include process definitions that belong to no tenant.
  • version_tag – Filter by the version tag.
  • version_tag_like – Filter by a substring of the version tag.
  • without_version_tag – Whether to include only process definition without a version tag.
  • startable_in_tasklist – Filter by process definition that are startable in tasklist.
  • not_startable_in_tasklist – Filter by process definitions that are not startable in tasklist.
  • startable_permission_check – Filter by process definitions that the user is allowed to start.
__call__(*args, **kwargs) → int

Send the request.

GetList

class pycamunda.processdef.GetList(url: str, id_: Optional[str] = None, id_in: Optional[Iterable[str]] = None, name: Optional[str] = None, name_like: Optional[str] = None, deployment_id: Optional[str] = None, key: Optional[str] = None, key_in: Optional[Iterable[str]] = None, key_like: Optional[str] = None, category: Optional[str] = None, category_like: Optional[str] = None, version: Optional[str] = None, latest_version: bool = False, resource_name: Optional[str] = None, resource_name_like: Optional[str] = None, startable_by: Optional[str] = None, active: bool = False, suspended: bool = False, incident_id: Optional[str] = None, incident_type: Union[str, pycamunda.incident.IncidentType, None] = None, incident_message: Optional[str] = None, incident_message_like: Optional[str] = None, tenant_id_in: Optional[Iterable[str]] = None, without_tenant_id: bool = False, include_without_tenant_id: bool = False, version_tag: Optional[str] = None, version_tag_like: Optional[str] = None, without_version_tag: Optional[bool] = None, startable_in_tasklist: Optional[bool] = None, startable_permission_check: Optional[bool] = None, not_startable_in_tasklist: Optional[bool] = None, sort_by: Optional[str] = None, ascending: bool = True, first_result: Optional[int] = None, max_results: Optional[int] = None)

Query for a list of process definitions using a list of parameters. The size of the result set can be retrieved by using the Get List Count method.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Filter by id.
  • id_in – Filter whether the id is one of multiple ones.
  • name – Filter by name.
  • name_like – Filter by a substring of the name.
  • deployment_id – Filter by deployment id.
  • key – Key of the process definition.
  • key_in – Filter whether the key is one of multiple ones.
  • key_like – Filter by a substring of the key.
  • category – Filter by category.
  • category_like – Filter by a substring of the category.
  • version – Filter by version.
  • latest_version – Whether to include only the latest versions.
  • resource_name – Filter by resource name.
  • resource_name_like – Filter by a substring of the resource name.
  • startable_by – Filter by user names that are allowed to start an instance of the process definition.
  • active – Whether to include only active process definitions.
  • suspended – Whether to include only suspended process definitions.
  • incident_id – Filter by incident id.
  • incident_type – Filter by incident type.
  • incident_message – Filter by the incident message.
  • incident_message_like – Filter by a substring the incident message.
  • tenant_id_in – Filter whether the tenant id is one of multiple ones.
  • without_tenant_id – Whether to include only process definitions that belong to no tenant.
  • include_without_tenant_id – Whether to include process definitions that belong to no tenant.
  • version_tag – Filter by the version tag.
  • version_tag_like – Filter by a substring of the version tag.
  • without_version_tag – Whether to include only process definition without a version tag.
  • startable_in_tasklist – Filter by process definition that are startable in tasklist.
  • not_startable_in_tasklist – Filter by process definitions that are not startable in tasklist.
  • startable_permission_check – Filter by process definitions that the user is allowed to start.
  • sort_by – Sort the results by ‘category’, ‘key’, ‘id_’, ‘name’, ‘version’, ‘deployment_id’, ‘tenant_id’ or version_tag. Sorting by ‘version_tag’ is string-based.
  • 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.processdef.ProcessDefinition]

Send the request.

GetProcessInstanceStats

class pycamunda.processdef.GetProcessInstanceStats(url: str, failed_jobs: bool = False, incidents: bool = False, root_incidents: bool = False, incidents_for_type: Union[str, pycamunda.incident.IncidentType, None] = None)

Get runtime statistics grouped by process definition. Does not include historic data.

Parameters:
  • url – Camunda Rest engine URL.
  • failed_jobs – Whether the number of failed jobs should be included.
  • incidents – Whether to include the number of incidents.
  • root_incidents – Whether to include the corresponding number of root incidents for each incident type.
  • incidents_for_type – Include only incidents of a specific type.
__call__(*args, **kwargs) → Tuple[pycamunda.processdef.ProcessInstanceStats]

Send the request.

GetXML

class pycamunda.processdef.GetXML(url: str, id_: Optional[str] = None, key: Optional[str] = None, tenant_id: Optional[str] = None)

Get the BPMN xml diagram of a process definition.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the process definition.
  • key – Key of the process definition.
  • tenant_id – Id of the tenant the process definition belongs to.
__call__(*args, **kwargs) → str

Send the request.

Get

class pycamunda.processdef.Get(url: str, id_: Optional[str] = None, key: Optional[str] = None, tenant_id: Optional[str] = None)

Get a process definition.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the process definition.
  • key – Key of the process definition.
  • tenant_id – Id of the tenant the process definition belongs to.
__call__(*args, **kwargs) → pycamunda.processdef.ProcessDefinition

Send the request.

StartInstance

class pycamunda.processdef.StartInstance(url: str, id_: Optional[str] = None, key: Optional[str] = None, tenant_id: Optional[str] = None, business_key: Optional[str] = None, case_instance_id: Optional[str] = None, skip_custom_listeners: bool = False, skip_io_mappings: bool = False, with_variables_in_return: bool = False)

Start a process instance of a specific process definition.

The process definition can be chosen by providing either the id or the key of the process definition. If chosen by key the latest version of that process definition is used. In case the key of the process definition is provided, the tenant id can be provided aswell.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the process definition.
  • key – Key of the process definition.
  • tenant_id – Id of the tenant the process definition belongs to.
  • business_key – The business key to initialize the process instance with.
  • case_instance_id – The case instance id to initialize the process instance with.
  • skip_custom_listeners – Whether to skip custom listeners and notify only builtin ones.
  • skip_io_mappings – Whether to skip input/output mappings.
  • with_variables_in_return – Whether the variable that were used by the process instance during execution should be returned.
__call__(*args, **kwargs) → pycamunda.processinst.ProcessInstance

Send the request.

add_start_after_activity_instruction(id_: str, variables: Optional[Mapping[str, pycamunda.variable.Variable]] = None) → None

Add an instruction to start execution at the single outgoing sequence flow of an activity.

Parameters:
  • id – Id of the activity.
  • variables – Mapping from names to the corresponding variables.
add_start_before_activity_instruction(id_: str, variables: Optional[Mapping[str, pycamunda.variable.Variable]] = None) → None

Add an instruction to start execution before a given activity is entered.

Parameters:
  • id – Id of the activity.
  • variables – Mapping from names to the corresponding variables.
add_start_transition_instruction(id_: str, variables: Optional[Mapping[str, pycamunda.variable.Variable]] = None) → None

Add an instruction to start execution at the single outgoing sequence flow of an activity.

Parameters:
  • id – Id of the sequence flow to start.
  • variables – Mapping from names to the corresponding variables.
add_variable(name: str, value: Any, type_: Optional[str] = None, value_info: Optional[str] = None) → None

Add a variable to initialize the process instance with.

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.

Activate

class pycamunda.processdef.Activate(url: str, id_: Optional[str] = None, key: Optional[str] = None, tenant_id: Optional[str] = None, include_process_instances: Optional[bool] = None, execution_datetime: Optional[datetime.datetime] = None)

Activate a process definition.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the process definition.
  • key – Key of the process definition.
  • tenant_id – Id of the tenant the process definition belongs to.
  • include_process_instances – Whether to cascade the action to process instances.
  • execution_datetime – When to execute the action. If ‘None’ the action is immediately.
__call__(*args, **kwargs) → None

Send the request.

Suspend

class pycamunda.processdef.Suspend(url: str, id_: Optional[str] = None, key: Optional[str] = None, tenant_id: Optional[str] = None, include_process_instances: Optional[bool] = None, execution_datetime: Optional[datetime.datetime] = None)

Suspend a process definition.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the process definition.
  • key – Key of the process definition.
  • tenant_id – Id of the tenant the process definition belongs to.
  • include_process_instances – Whether to cascade the action to process instances.
  • execution_datetime – When to execute the action. If ‘None’ the action is immediately.
__call__(*args, **kwargs) → None

Send the request.

UpdateHistoryTimeToLive

class pycamunda.processdef.UpdateHistoryTimeToLive(url: str, history_time_to_live: int, id_: Optional[str] = None, key: Optional[str] = None, tenant_id: Optional[str] = None)

Update the history time to live of a process definition.

Parameters:
  • url – Camunda Rest engine URL.
  • history_time_to_live – New history time to live. Can be set to ‘None’.
  • id – Id of the process definition.
  • key – Key of the process definition.
  • tenant_id – Id of the tenant the process definition belongs to.
__call__(*args, **kwargs) → None

Send the request.

Delete

class pycamunda.processdef.Delete(url: str, id_: Optional[str] = None, key: Optional[str] = None, tenant_id: Optional[str] = None, cascade: bool = False, skip_custom_listeners: bool = False, skip_io_mappings: bool = False)

Delete a process definition.

Parameters:
  • url – Camunda Rest engine URL.
  • id – Id of the process definition.
  • key – Key of the process definition.
  • tenant_id – Id of the tenant the process definition belongs to.
  • cascade – Whether to cascade the deletion to process instances of the definition.
  • skip_custom_listeners – Whether to skip custom listeners and notify only builtin ones.
  • skip_io_mappings – Whether to skip input/output mappings.
__call__(*args, **kwargs) → None

Send the request.

RestartProcessInstance

class pycamunda.processdef.RestartProcessInstance(url: str, id_: str, process_instance_ids: Iterable[str], async_: bool = False, skip_custom_listeners: bool = False, skip_io_mappings: bool = False, initial_variables: bool = True, without_business_key: bool = False)

Restart process instances of a specific process definition.

Parameters:
  • url – Camunda Rest engine url.
  • id – Id of the process definition.
  • process_instance_ids – Ids of the process instances to restart.
  • async – Whether to restart the processes asynchronously.
  • skip_custom_listeners – Whether to skip custom listeners and notify only builtin ones.
  • skip_io_mappings – Whether to skip input/output mappings.
  • initial_variables – Whether to set the initial set of variables.
  • without_business_key – Whether not to add the business key of the process instance.
__call__(*args, **kwargs) → Optional[pycamunda.batch.Batch]

Send the request.

add_after_activity_instruction(id_: str) → None

Add an instruction to start execution at the single outgoing sequence flow of an activity.

Parameters:id – Id of the activity.
add_before_activity_instruction(id_: str) → None

Add an instruction to start execution before a given activity is entered.

Parameters:id – Id of the activity.
add_transition_instruction(id_: str) → None

Add an instruction to start execution at the single outgoing sequence flow of an activity.

Parameters:id – Id of the sequence flow to start.