<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ![](https://img.kancloud.cn/ae/3c/ae3c16005e6612fb273abd0be9095751_1225x174.png) 排他網關,用來在流程中實現決策。 當流程執行到這個網關,所有分支都會判斷條件是否為`true`,如果為`true`則執行該分支。 <br/> >[warning]注意:排他網關只會選擇一個為`true`的分支執行。如果有兩個分支條件都為`true`,排他網關會選擇 id 值較小的一條分支去執行。 為什么要用排他網關? 不用排他網關也可以實現分支,如在連線的 condition 條件上設置分支條件。 在連線設置 condition 條件的缺點:如果條件都不滿足,流程就異常結束了。 如果使用排他網關決定分支的走向,則從網關出去所有線的條件都不滿足則系統拋出異常。 ```java org.flowable.engine.common.api.FlowableException: No outgoing sequence flow of the exclusive gateway '_14' could be selected for continuing the process ``` <br/> 演示,步驟如下: **1. 流程定義** :-: ![](https://img.kancloud.cn/c0/b6/c0b67cd6156388749a00927ba73f8dd4_844x376.png) `evection-exclusive.bpmn` **2. java程序** ```java public class FlowableGatewayExclusive { /** * 1. 部署流程 */ @Test public void testDeployment() { //1、獲取ProcessEngine ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine(); //2、獲取RepositoryService RepositoryService repositoryService = processEngine.getRepositoryService(); //3、部署流程 Deployment deployment = repositoryService.createDeployment() .addClasspathResource("bpmn/evection-exclusive.bpmn") .name("出差申請流程") .deploy(); //流程部署id:45001 System.out.println("流程部署id:" + deployment.getId()); //流程部署名稱:出差申請流程 System.out.println("流程部署名稱:" + deployment.getName()); } /** * 2. 啟動流程實例,設置流程變量 */ @Test public void startProcess() { //獲取流程引擎 ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine(); //獲取RunTimeService RuntimeService runtimeService = processEngine.getRuntimeService(); //流程key String key = "evection-exclusive"; //創建變量集合 Map<String, Object> map = new HashMap<String, Object>(); //創建出差pojo對象 Evection evection = new Evection(); //設置出差天數為2天 evection.setNum(2d); //定義流程變量,把出差pojo對象放入map map.put("evection", evection); //根據流程key啟動流程實例,并設置流程變量的值 ProcessInstance processInstance = runtimeService .startProcessInstanceByKey(key, map); //流程定義id: evection-exclusive:1:52504 System.out.println("流程定義id: " + processInstance.getProcessDefinitionId()); //流程實例id: 流程實例id: 55001 System.out.println("流程實例id: " + processInstance.getProcessInstanceId()); //流程版本: 1 System.out.println("流程版本: " + processInstance.getProcessDefinitionVersion()); } /** * 3. 完成個人任務 */ @Test public void completTask() { //流程Key String key = "evection-exclusive"; //任務負責人 String assingee = "jerry"; //獲取流程引擎 ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine(); //獲取taskservice TaskService taskService = processEngine.getTaskService(); //查詢任務 Task task = taskService.createTaskQuery() .processDefinitionKey(key) .taskAssignee(assingee) .singleResult(); if (task != null) { //根據任務id來完成任務 taskService.complete(task.getId()); //jerry完成了任務{id=57502, name=部門經理審批} System.out.println(task.getAssignee() + "完成了任務{id=" + task.getId() + ", name=" + task.getName() + "}"); } } } ``` **3. 測試結果** 在部門經理審核后,走排他網關,從排他網關出來的分支有兩條,一條是判斷出差天數是否大于3天,另一條是判斷出差天數是否小于等于3天。 <br/> 上面設置的出差天數為兩天,所以從排他網關出來后直接到財務審批節點。 **** 參考文檔:https://tkjohn.github.io/flowable-userguide/#bpmnGateways
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看