kappa_sdk.user_tasks.Context#
- class kappa_sdk.user_tasks.Context(field_id=None, well_id=None, context_dict=None, workflow_id=None)[source]#
User task context.
Provides an ability to persist values between different runs of the User Task.
- Parameters:
field_id (str | None)
well_id (str | None)
context_dict (Dict[str, Any] | None)
workflow_id (str | None)
- __getitem__(key)[source]#
Gets the value associated with the specified string key.
If the value could not be found, a default one is returned. Only string keys are supported.
- Parameters:
key (str) – The name of the key.
- Raises:
TypeError – If key has an unexpected type.
- Return type:
Any | None
- __setitem__(key, value)[source]#
Sets the value for the specified string key.
Only string keys are supported.
- Parameters:
key (str) – The name of the key.
value (Any) – The value to save.
- Raises:
TypeError – If key has an unexpected type.
- Return type:
None
Attributes
Gets the field id.
Gets the well id.
Gets the workflow id.
Methods
- __init__(field_id=None, well_id=None, context_dict=None, workflow_id=None)[source]#
- Parameters:
field_id (str | None)
well_id (str | None)
context_dict (Dict[str, Any] | None)
workflow_id (str | None)
- Return type:
None
- property field_id: str | None#
Gets the field id.
- property well_id: str | None#
Gets the well id.
- property workflow_id: str | None#
Gets the workflow id.
- __getitem__(key)[source]#
Gets the value associated with the specified string key.
If the value could not be found, a default one is returned. Only string keys are supported.
- Parameters:
key (str) – The name of the key.
- Raises:
TypeError – If key has an unexpected type.
- Return type:
Any | None