hpcflow.sdk.persistence.base.StoreTask#

class hpcflow.sdk.persistence.base.StoreTask(id_, index, is_pending, element_IDs, task_template=None)#

Bases: Generic[SerFormT]

Represents a task in a persistent store.

Parameters:
  • id (int) – The ID of the task.

  • index (int) – The index of the task within its workflow.

  • is_pending (bool) – Whether the task has changes not yet persisted.

  • element_IDs (list[int]) – The IDs of elements in the task.

  • task_template (Mapping[str, Any] | None) – Description of the template for the task.

  • id_ (int) –

Methods

append_element_IDs

Return a copy, with additional element IDs.

decode

Initialise a StoreTask from store task data

encode

Prepare store task data for the persistent store.

Attributes

task_template

Description of the template for the task.

id_

The ID of the task.

index

The index of the task within its workflow.

is_pending

Whether the task has changes not yet persisted.

element_IDs

The IDs of elements in the task.

append_element_IDs(pend_IDs)#

Return a copy, with additional element IDs.

Parameters:

pend_IDs (list[int]) –

Return type:

Self

abstract classmethod decode(task_dat)#

Initialise a StoreTask from store task data

Note: the task_template is only needed for encoding because it is retrieved as part of the WorkflowTemplate so we don’t need to load it when decoding.

Parameters:

task_dat (SerFormT) –

Return type:

Self

element_IDs: list[int]#

The IDs of elements in the task.

abstract encode()#

Prepare store task data for the persistent store.

Return type:

tuple[int, SerFormT, dict[str, Any]]

id_: int#

The ID of the task.

index: int#

The index of the task within its workflow.

is_pending: bool#

Whether the task has changes not yet persisted.

task_template: Mapping[str, Any] | None = None#

Description of the template for the task.