请不要骂我,我在别人的基础上改的,但是可以跑通的。
servlet 处理1:
public class Huigao extends HttpServlet {
private static final long serialVersionUID = 1L;
public TaskService taskService = null;
public ProcessInstance processInstance = null;
public RepositoryService repositoryService = null;
public ExecutionService executionService = null;
public ProcessEngine processEngine = null ;
public void init() {
processEngine = Configuration.getProcessEngine();
taskService = Configuration.getProcessEngine().getTaskService();
repositoryService = Configuration.getProcessEngine()
.getRepositoryService();
executionService = Configuration.getProcessEngine()
.getExecutionService();
}
protected void doGet(HttpServletRequest request,
HttpServletResponse response) {
process(request, response);
}
protected void doPost(HttpServletRequest request,
HttpServletResponse response) {
process(request, response);
}
public void process(HttpServletRequest request, HttpServletResponse response) {
String buzou = request.getParameter("buzou");
String id = request.getParameter("id");
if ("deploy".equals(buzou)) {
deploy(request, response);
} else if ("getTaskList".equals(buzou)) {
String username = request.getParameter("username");
request.setAttribute("tasklist", getTaskList(username));
} else if ("start".equals(buzou)) {
startpd(id);
} else if ("delpd".equals(buzou)) {
delpd(id);
} else if ("delpi".equals(buzou)) {
delpi(id);
} else if ("endpi".equals(buzou)) {
endpi(id);
} else if ("tohuigao".equals(buzou)) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("select", "huigao");
taskService.setVariables(id, map);
taskService.completeTask(id);
} else if ("tobanwen".equals(buzou)) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("select", "banwen");
taskService.setVariables(id, map);
taskService.completeTask(id);
} else if ("huigao1".equals(buzou) || "huigao2".equals(buzou) || "huigao3".equals(buzou)) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("username", request.getParameter("username"));
String selectType = request.getParameter("selectType") ;
if(selectType == null)
{
selectType = "false" ;
}
boolean value = Boolean.valueOf(selectType) ;
// map.put("tempResult", value) ;
executionService.setVariable(id, "tempResult", value) ;
executionService.signalExecutionById(id, map);
} else if("guidang".equals(buzou)) {
taskService.completeTask(id);
}else if ("banwen".equals(buzou)) {
taskService.completeTask(id);
} else if ("addhuiqian3".equals(buzou)){
addhuiqian(id,request.getParameter("executionid"));
} else if ("editForm".equals(buzou)){
try {
request.getRequestDispatcher("/form_baowen.html").forward(
request, response);
} catch (ServletException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return ;
}
request.setAttribute("pdlist", getProcessDefinition(request, response));
request.setAttribute("pilist", getProcessInstance(request, response));
try {
request.getRequestDispatcher("/countersignature.jsp").forward(
request, response);
} catch (ServletException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
servlet 处理1:
public class Huigao extends HttpServlet {
private static final long serialVersionUID = 1L;
public TaskService taskService = null;
public ProcessInstance processInstance = null;
public RepositoryService repositoryService = null;
public ExecutionService executionService = null;
public ProcessEngine processEngine = null ;
public void init() {
processEngine = Configuration.getProcessEngine();
taskService = Configuration.getProcessEngine().getTaskService();
repositoryService = Configuration.getProcessEngine()
.getRepositoryService();
executionService = Configuration.getProcessEngine()
.getExecutionService();
}
protected void doGet(HttpServletRequest request,
HttpServletResponse response) {
process(request, response);
}
protected void doPost(HttpServletRequest request,
HttpServletResponse response) {
process(request, response);
}
public void process(HttpServletRequest request, HttpServletResponse response) {
String buzou = request.getParameter("buzou");
String id = request.getParameter("id");
if ("deploy".equals(buzou)) {
deploy(request, response);
} else if ("getTaskList".equals(buzou)) {
String username = request.getParameter("username");
request.setAttribute("tasklist", getTaskList(username));
} else if ("start".equals(buzou)) {
startpd(id);
} else if ("delpd".equals(buzou)) {
delpd(id);
} else if ("delpi".equals(buzou)) {
delpi(id);
} else if ("endpi".equals(buzou)) {
endpi(id);
} else if ("tohuigao".equals(buzou)) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("select", "huigao");
taskService.setVariables(id, map);
taskService.completeTask(id);
} else if ("tobanwen".equals(buzou)) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("select", "banwen");
taskService.setVariables(id, map);
taskService.completeTask(id);
} else if ("huigao1".equals(buzou) || "huigao2".equals(buzou) || "huigao3".equals(buzou)) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("username", request.getParameter("username"));
String selectType = request.getParameter("selectType") ;
if(selectType == null)
{
selectType = "false" ;
}
boolean value = Boolean.valueOf(selectType) ;
// map.put("tempResult", value) ;
executionService.setVariable(id, "tempResult", value) ;
executionService.signalExecutionById(id, map);
} else if("guidang".equals(buzou)) {
taskService.completeTask(id);
}else if ("banwen".equals(buzou)) {
taskService.completeTask(id);
} else if ("addhuiqian3".equals(buzou)){
addhuiqian(id,request.getParameter("executionid"));
} else if ("editForm".equals(buzou)){
try {
request.getRequestDispatcher("/form_baowen.html").forward(
request, response);
} catch (ServletException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return ;
}
request.setAttribute("pdlist", getProcessDefinition(request, response));
request.setAttribute("pilist", getProcessInstance(request, response));
try {
request.getRequestDispatcher("/countersignature.jsp").forward(
request, response);
} catch (ServletException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}