Skip to main content

openIMIS Backend tasks_management reference module

This repository holds the files of the openIMIS Backend Task Managemet reference module. It is dedicated to be deployed as a module of openimis-be_py.

ORM mapping:

  • task_management_task, task_management_historicaltask > Task
  • task_management_taskgroup, task_management_historicaltaskgroup > TaskGroup
  • task_management_taskexecutor, task_management_historicaltaskexecutor > TaskExecutor

GraphQl Queries

  • task, taskGroup, taskExecutor

Services

  • Task
    • create
    • update
    • delete
    • complete_task
    • resolve_task
  • TaskGroup
    • create
    • update
    • delete
  • TaskExecutor
    • create
    • update
    • delete
  • CheckerLogicServiceMixin
    • create
    • update
    • delete
  • on_task_complete_service_handler

Configuration options (can be changed via core.ModuleConfiguration)

  • gql_task_group_search_perms: 190001
  • gql_task_group_create_perms: 190002
  • gql_task_group_update_perms: 190003
  • gql_task_group_delete_perms: 190004
  • gql_task_search_perms: 191001
  • gql_task_create_perms: 191002
  • gql_task_update_perms: 191003
  • gql_task_delete_perms: 191004
  • default_executor_event: default

openIMIS Modules Dependencies

  • core

Creating execution action handlers and business event handlers

When user action specified by the task is being passed to backend, the task service sends task_service.resolve_task signal. The approach for handler is to bind to after signal and check the specific executor_action_event of the task. The same approach is used for business event handlers, being required to bind on task_service.complete_task.

# in signals.py in any module
def bind_service_signals():
    bind_service_signal(
        'task_service.resolve_task',
        handler_hook,
        bind_type=ServiceSignalBindType.AFTER
    )

def handler_hook(**kwargs):
    pass

Creating tasks for BaseService implementations

CheckerLogicServiceMixin allows implementations of core.services.BaseService to generate tasks for create, update and delete actions. this adds create__task methods to the service, with the same API as the methods. Additionally the on_task_complete_service_handler service method allows to generate complete_task handlers for core.services.BaseService implementations.

# In service definition
class ExampleService(BaseService, CheckerLogicServiceMixin):
    ...

# to create a task instead of performing create operation, instead of:
# ExampleService(user).create(data)
ExampleService(user).create_create_task(data)
`
#in signals.py (any module, but the same module as service preferred)
def bind_service_signals():
    bind_service_signal(
        'task_service.complete_task',
        on_task_complete_service_handler(ExampleService),
        bind_type=ServiceSignalBindType.AFTER
    )

Metadata

Release files for openimis-be-tasks-management 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openimis-be-tasks-management 1.5.0
File Size Uploaded
openimis_be_tasks_management-1.5.0.tar.gz 18.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openimis-be-tasks-management 1.5.0
File Interpreter ABI Platform
openimis_be_tasks_management-1.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 48.0 kB

Release files / openimis_be_tasks_management-1.5.0.tar.gz

Download URL openimis_be_tasks_management-1.5.0.tar.gz
Size 18.4 kB
Tags Source
SHA-256 checksum
How to use checksums
cc2902e9cb13d93ab6459fe8eece0ba7e5e01355ced9fc92103b6e5cad4929f0
BLAKE2b-256 checksum
How to use checksums
56aa53ea37d24786099d968bde63b00d830b576263a6ee8d8b52df7033aefa7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / openimis_be_tasks_management-1.5.0-py3-none-any.whl

Download URL openimis_be_tasks_management-1.5.0-py3-none-any.whl
Size 29.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82c85575141721eb4a6eb6066fd7c3b4ce34b0cf0a029782311e9d4f73d061b8
BLAKE2b-256 checksum
How to use checksums
fab505db5f6545e4f20996ac5ab064d005a823cce824210c6bc1a037d7fa8087
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release history Release notifications | RSS feed

This release

1.5.0 This release

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page