【问题标题】:Camunda Spring Boot starter with embedded forms带有嵌入式表单的 Camunda Spring Boot 启动器
【发布时间】:2018-06-03 03:17:00
【问题描述】:

我正在尝试通过 Camunda spring boot starter 使用带有启动事件的嵌入式表单。

我的 startEvent 是这样描述的:

<bpmn:startEvent id="StartEvent_1" name="Rechnungseingang" camunda:formKey="embedded:app:forms/rechnungseingang.html">
  <bpmn:outgoing>SequenceFlow_0dtfc1a</bpmn:outgoing>
</bpmn:startEvent>

表单本身位于“src/main/webapp/forms/rechnungseingang.html”下,据我了解,这应该是正确的路径。

如果我在启动 spring boot 应用程序后尝试启动进程,我会收到错误消息:“表单失败:上下文路径为空或未定义。”

在浏览器控制台中,我可以看到对http://localhost:8080/test/api/engine/engine/default/process-definition/Rechnungseingang:1:927f0aa4-e590-11e7-973d-e2cbd8678b9f/startForm 的请求以及响应:

{"key":"embedded:app:forms/rechnungseingang.html","contextPath":null}

显然应用程序无法处理 contextPath 中的空值。如何在 Spring Boot 中为 Camunda 设置 contextPath?在 application.properties 中我已经尝试设置 server.context-path 无效。

【问题讨论】:

    标签: java spring-boot camunda


    【解决方案1】:

    1.) Spring Boot 应用程序没有 src/main/webapp,使用 src/main/resources/static

    2.) 要让 camunda 将资源链接到引擎,您将需要一个流程应用程序。这可以通过将“@EnableProcessApplication”添加到您的 Spring Boot 应用程序来轻松完成。

    3.) 自动部署需要 src/main/resources/META-INF/processes.xml 文件,但您可以将其留空

    4.) 这里有一个带有 camunda spring boot 的嵌入式表单的完整示例:https://github.com/camunda/camunda-bpm-examples/tree/master/spring-boot-starter/example-twitter

    【讨论】:

    • 感谢您的回答,您的观点的结合起到了作用。我期待启动器为我进行配置(因为已经部署了流程定义并且可以启动),但似乎仍然存在一些配置开销。
    • 新版本有什么变化吗?我必须将 Embedded:app:forms/rechnungseingang.html(使用 OP 的示例)更改为 Embedded:/forms/rechnungseingang.html,使用完整路径而不是应用程序密钥才能工作。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-03
    • 1970-01-01
    • 2016-08-19
    • 1970-01-01
    • 2017-09-20
    • 1970-01-01
    相关资源
    最近更新 更多