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)計

          常用鏈接

          留言簿

          隨筆檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 徐闻县| 武川县| 嘉兴市| 隆德县| 普定县| 杨浦区| 淮滨县| 中宁县| 出国| 苏州市| 闽清县| 明溪县| 宜州市| 札达县| 隆昌县| SHOW| 久治县| 万全县| 科技| 清水县| 黄陵县| 永年县| 东乡| 瑞丽市| 贵溪市| 浑源县| 英山县| 金门县| 渭源县| 崇阳县| 南木林县| 瓮安县| 馆陶县| 平武县| 遵化市| 将乐县| 焦作市| 永福县| 花莲县| 枞阳县| 金寨县|