camunda嵌入式表单

10 篇文章 2 订阅
8 篇文章 13 订阅

User Task Forms | docs.camunda.org

首先,camunda平台的表单分为三种:

1、嵌入式任务表单允许您将自定义 HTML 和 JavaScript 表单嵌入到任务列表中。

2、Camunda Forms在 Camunda Modeler 中提供表单的可视化编辑,可用于不太复杂的表单。

3、外部任务表单可用于链接到自定义应用程序。表单不会嵌入到任务列表中。

首先在了解表单之前,我们先了解一下camunda设计器中的form key

 规则:FORM-TYPE:LOCATION:FORM.NAME

FORM-TYPE选项:embedded 、camunda-forms

LOCATION选项: deployment 、 app

今天我们只聊一下嵌入式表单的规则:

FormKey的例子:embedded:app:forms/request-loan.html

0、注意form文件的路径位置

<form name="requestLoan">
  <div class="form-group">
    <label for="customerId">Customer ID</label>
    <input class="form-control" cam-variable-type="String" cam-variable-name="customerId" name="customerId" />
  </div>
  <div class="form-group">
    <label for="amount">Amount</label>
    <input class="form-control" cam-variable-type="Double" cam-variable-name="amount" name ="amount" />
  </div>
</form>

1、需要保证forms/request-loan.html的路径能直接被访问到

http://localhost:82/forms/request-loan.html

2、bpmn文件部署文件只能在项目启动之前已经嵌入到程序中

<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="diagram_Process_1628040472856" targetNamespace="http://bpmn.io/schema/bpmn" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
  <bpmn2:process id="Process_1628040472856pp1111" name="请假流程表单部署" isExecutable="true">
    <bpmn2:startEvent id="Event_1q00b1i" camunda:formKey="embedded:app:forms/request-loan.html">
      <bpmn2:outgoing>Flow_1laqzgy</bpmn2:outgoing>
    </bpmn2:startEvent>
    <bpmn2:sequenceFlow id="Flow_1laqzgy" sourceRef="Event_1q00b1i" targetRef="Activity_0iut1cr" />
    <bpmn2:endEvent id="Event_08yjf05">
      <bpmn2:incoming>Flow_0necba9</bpmn2:incoming>
    </bpmn2:endEvent>
    <bpmn2:userTask id="Activity_0iut1cr" name="superAdmin">
      <bpmn2:incoming>Flow_1laqzgy</bpmn2:incoming>
      <bpmn2:outgoing>Flow_1d3pk4d</bpmn2:outgoing>
    </bpmn2:userTask>
    <bpmn2:sequenceFlow id="Flow_1d3pk4d" name="同意" sourceRef="Activity_0iut1cr" targetRef="Activity_00asycr" />
    <bpmn2:userTask id="Activity_00asycr" name="admin">
      <bpmn2:incoming>Flow_1d3pk4d</bpmn2:incoming>
      <bpmn2:outgoing>Flow_0necba9</bpmn2:outgoing>
    </bpmn2:userTask>
    <bpmn2:sequenceFlow id="Flow_0necba9" sourceRef="Activity_00asycr" targetRef="Event_08yjf05" />
  </bpmn2:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1628040472856pp">
      <bpmndi:BPMNEdge id="Flow_0necba9_di" bpmnElement="Flow_0necba9">
        <di:waypoint x="660" y="210" />
        <di:waypoint x="802" y="210" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1d3pk4d_di" bpmnElement="Flow_1d3pk4d">
        <di:waypoint x="450" y="210" />
        <di:waypoint x="560" y="210" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="494" y="192" width="23" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1laqzgy_di" bpmnElement="Flow_1laqzgy">
        <di:waypoint x="248" y="210" />
        <di:waypoint x="350" y="210" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="Event_1q00b1i_di" bpmnElement="Event_1q00b1i">
        <dc:Bounds x="212" y="192" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_08yjf05_di" bpmnElement="Event_08yjf05">
        <dc:Bounds x="802" y="192" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_1uu7lbh_di" bpmnElement="Activity_0iut1cr">
        <dc:Bounds x="350" y="170" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_0kmwnkq_di" bpmnElement="Activity_00asycr">
        <dc:Bounds x="560" y="170" width="100" height="80" />
      </bpmndi:BPMNShape>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn2:definitions>

3、springboot启动时需要使用@EnableProcessApplication注解

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

<每天一点>

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值