JBPM4.3 流程處理中設定流程中變數值

tiantangqiu發表於2014-07-29
1.發起時:

Map<String, Object> variables = new HashMap<String, Object>();
variables.put("var1", "1");
variables.put("var2", "Malt");
Execution execution = executionService.startProcessInstanceByKey("流程key", variables);


2.處理時候

variables = new HashMap<String, Object>();
variables.put("var1", 2);
variables.put("var2", "Malt2");
taskService.completeTask(taskId, variables);


3.任務存在時

variables = new HashMap<String, Object>();
variables.put("var1", 3);
variables.put("var2", "Malt3");
taskService.setVariables(taskId, variables);


4.在任何時候都可以設定全域性變數

variables = new HashMap<String, Object>();
variables.put("var1", 4);
variables.put("var2", "Malt4");
executionService.setVariable(execution.getId(),variables);

相關文章