camunda
2021/8/10 23:35:46
本文主要是介绍camunda,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
这个是别人翻译的官方文档: https://blog.csdn.net/zoollcar/article/details/117351192
这个是官方文档: Get started with Camunda | docs.camunda.org
任务列表:http://localhost:8080/camunda/app/tasklist/
查看部署结果: http://localhost:8080/camunda/app/cockpit/default/#/processes
step:
抄官方文档的:
pom:
<dependency> <groupId>org.camunda.bpm</groupId> <artifactId>camunda-external-task-client</artifactId> <version>7.15.0</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> <version>1.6.1</version> </dependency> <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.3.1</version> </dependency>
java:
public class ChargeCardWorker { private final static Logger LOGGER = Logger.getLogger(ChargeCardWorker.class.getName()); public static void main(String[] args) { ExternalTaskClient client = ExternalTaskClient.create() .baseUrl("http://localhost:8080/engine-rest") .asyncResponseTimeout(10000) // long polling timeout .build(); // subscribe to an external task topic as specified in the process client.subscribe("charge-card") .lockDuration(1000) // the default lock duration is 20 seconds, but you can override this .handler((externalTask, externalTaskService) -> { // Put your business logic here // Get a process variable String item = (String) externalTask.getVariable("item"); Long amount = (Long) externalTask.getVariable("amount"); LOGGER.info("Charging credit card with an amount of '" + amount + "'€ for the item '" + item + "'..."); try { Desktop.getDesktop().browse(new URI("https://docs.camunda.org/get-started/quick-start/complete")); } catch (Exception e) { e.printStackTrace(); } // Complete the task externalTaskService.complete(externalTask); }) .open(); } }
下载这两个东西:
打开1 里面的start.bat
使用2 的画布画, 要填这个: http://localhost:8080/engine-rest
画完保存并部署
再看部署结果(http://localhost:8080/camunda/app/cockpit/default/#/processes)
启动流程:
tasklist里:
启动后这个金额大于1000,就要人工审批,就在task里看的到(如果下于1000,就不会出现在task里)
能看到卡在批准付款里:
问题来了:
怎么批准呢?这个按钮置灰的,到这里不会了。待续。。。
这篇关于camunda的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-10-04el-table 开启定时器下,表格的选中状态会消失是什么原因-icode9专业技术文章分享
- 2024-10-03如何安装和初始化飞牛私有云 fnOS?-icode9专业技术文章分享
- 2024-10-03如何安装 App 并连接到飞牛 NAS?-icode9专业技术文章分享
- 2024-10-03如何安装飞牛 TV 并连接到影视服务器?-icode9专业技术文章分享
- 2024-10-03如何在PVE和ESXI上安装飞牛私有云 fnOS?-icode9专业技术文章分享
- 2024-10-03fnOS国产最强NAS安装系统异常情况处理-icode9专业技术文章分享
- 2024-10-03飞牛NAS如何创建存储空间?-icode9专业技术文章分享
- 2024-10-03fnOS国产最强NAS硬盘会自动休眠吗?-icode9专业技术文章分享
- 2024-10-03fnOS国产最强NAS如何安装飞牛影视和创建媒体库?-icode9专业技术文章分享
- 2024-10-03fnOS国产最强NAS如何为家人朋友开通影视账号?-icode9专业技术文章分享