java學(xué)習(xí)

          java學(xué)習(xí)

           

          activiti設(shè)置流程變量的4中方案

          /**
          * 在啟動流程實例時設(shè)置流程變量
          */
          @org.junit.Test
          public void testStartProcessInstanceByKey(){
          String processDefinitionKey="qjlc";
          Map<String,Object> variables = new HashMap<String, Object>();
          variables.put("k1", 11);
          variables.put("k2", 22);
          ProcessInstance query = processEngine.getRuntimeService().startProcessInstanceByKey(processDefinitionKey, variables);
          }
          /**
          * 在辦理任務(wù)時設(shè)置流程變量
          */
          @org.junit.Test
          public void testTaskComplete(){
          String taskId="6002";
          Map<String,Object> variables = new HashMap<String, Object>();
          variables.put("k3", 11);
          variables.put("k4", 22);
          processEngine.getTaskService().complete(taskId, variables);
          }
          /**
          * RuntimeService設(shè)置流程變量
          */
          @org.junit.Test
          public void testRuntimeService(){
          String executionId="5701";
          Map<String,Object> variables = new HashMap<String, Object>();
          variables.put("k5", 3);
          variables.put("k6", 4);
          processEngine.getRuntimeService().setVariables(executionId, variables);
          }
          /**
          * taskService設(shè)置流程變量
          */
          @org.junit.Test
          public void testTaskService(){
          String taskId="5804";
          Map<String,Object> variables = new HashMap<String, Object>();
          variables.put("k5", 31);
          variables.put("k6", 41);
          processEngine.getTaskService().setVariables(taskId, variables);
          }

          posted on 2017-08-28 17:15 楊軍威 閱讀(296) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           

          導(dǎo)航

          統(tǒng)計

          常用鏈接

          留言簿

          隨筆檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 松溪县| 得荣县| 大宁县| 和龙市| 仙游县| 嵊州市| 旌德县| 营山县| 永兴县| 晋城| 泗水县| 申扎县| 南开区| 台州市| 怀集县| 简阳市| 巴林右旗| 黄平县| 新龙县| 凤凰县| 张掖市| 犍为县| 河津市| 商都县| 台东县| 阿勒泰市| 酒泉市| 泰和县| 章丘市| 喀什市| 行唐县| 六枝特区| 德清县| 江北区| 高唐县| 浑源县| 黄石市| 通渭县| 民乐县| 布尔津县| 南京市|