流程引擎框架

SpiffWorkflow
python 流程引擎框架哪个好
Camunda 核心表介绍
https://zhuanlan.zhihu.com/p/645786758
camunda流程引擎基本使用(笔记)
https://blog.csdn.net/weixin_46949627/article/details/129255647
python连接FastDfs服务封装类
https://blog.csdn.net/weixin_57504427/article/details/139008166

https://blog.csdn.net/weixin_45118229/article/details/136218793

docker 查看默认仓库
docker info | grep “Registry”
修改默认仓库
https://blog.51cto.com/u_16213440/10332765

https://blog.csdn.net/weixin_41708548/article/details/119753413
https://www.jb51.net/server/294221m23.htm

https://lowcode.blog.csdn.net/article/details/136164213
https://blog.csdn.net/qq_45216885/article/details/132132430
https://docs.camunda.org/manual/latest/installation/docker/
https://blog.csdn.net/qq_46254997/article/details/122245164
https://blog.csdn.net/wxz258/article/details/117564836
https://blog.csdn.net/LCY133/article/details/132818421
pycamunda的官方文档:https://pycamunda.readthedocs.io/en/latest/src/usage.html

创建一个任务实例

#!/usr/bin/env python
# -*- coding:utf-8 -*-

# pycamunda==0.6.1

import pycamunda.processdef

url = 'http://localhost:8080/engine-rest'

start_instance = pycamunda.processdef.StartInstance(url=url, key="Process_09bggk7", tenant_id='demo')
start_instance.add_variable(name='api', value=1)
process_instance = start_instance()
print(process_instance.__dict__)

worker消费一个任务实例

pip install git+https://github.com/OpenAvikom/camunda-external-task-client-python3

成功运行

#!/usr/bin/env python
# -*- coding:utf-8 -*-

url = 'http://172.31.187.203:8080/engine-rest'
import aiohttp
import asyncio

from camunda.external_task.external_task import ExternalTask
from camunda.external_task.external_task_worker import ExternalTaskWorker
from camunda.external_task.external_task_result import ExternalTaskResult


async def main():
    # let's create an async http context with aiohttp
    # aiohttp will close the connection when the worker returns (it won't though)
    async with aiohttp.ClientSession() as session:
        # We create a worker with a task id and pass the http session as well as the REST endpoint of Camunda.
        # You need to change 'base_url' in case your Camunda engine is configured differently.
        worker = ExternalTaskWorker(
            worker_id=1, base_url=url, session=session
        )
        print("waiting for a task ...")
        # Subscribe is an async function which will block until the worker is cancelled with `worker.cancel()`,
        # In this example, no one will do this. We will stop the program with Ctrl+C instead
        # When the worker detects a new task for the topic assigned to `topic_name` it will trigger the
        # function/method passed to `action`.
        await worker.subscribe(topic_names="auto_task", action=process)


# this will be called when a task for the subscribed topic is available
async def process(task: ExternalTask) -> ExternalTaskResult:
    print("I got a task!")
    print(task.context_variables)
    # To communicate the successfull processing of a task, we return an ExternalTaskResult created by `task.complete` .
    # If we call `task.failure` instead, Camunda will publish the task again until
    # some client finally completes it or the maximum amount of retries is reached.
    return task.complete()


# run the main task
asyncio.run(main())

lockDuration与asyncResponseTimeout

在Camunda BPMN流程引擎中,多个工作人员(Worker)轮询获取任务是通过以下几种方式实现的:

  1. 使用External Task Client,可以配置客户端以轮询方式获取任务。
  2. http://localhost:8080/engine-rest
  3. 使用Job Executor,可以配置多个工作人员执行作业。

在 Camunda 中,可以使用 Camunda 提供的用户界面和 API 来监控流程的执行情况。以下是几种常用的监控流程执行的方式:

1、使用 Camunda Cockpit:Camunda Cockpit 是 Camunda 官方提供的流程监控和管理工具,可以在浏览器中访问 Cockpit 界面,查看流程定义、流程实例、任务等详细信息,并可以进行任务处理、流程实例挂起/恢复等操作。

2、使用 Camunda Tasklist:Camunda Tasklist 是 Camunda 官方提供的任务管理工具,可以在浏览器中访问 Tasklist 界面,查看待处理任务和已处理任务,进行任务处理和操作。

3、使用 Camunda REST API:使用 Camunda 提供的 REST API,可以通过 GET 请求查询流程定义、流程实例、任务等信息,并通过 POST 请求进行任务处理和操作。
https://blog.csdn.net/weixin_46949627/article/details/129255647
https://blog.csdn.net/wxz258/article/details/117564836
https://blog.csdn.net/wxz258/article/details/136442339

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值