Commit 8ccaa92a by 王厚康

Merge branch 'develop' of https://git.okayapps.com/wanghk/bpm

# Conflicts:
#	pom.xml
parents 3c2bd6ad 4695d424
package com.bbd.bpm;
import org.activiti.spring.boot.SecurityAutoConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@SpringBootApplication(exclude = SecurityAutoConfiguration.class)
public class BpmBackendApplication {
public static void main(String[] args) {
......
package com.bbd.bpm.controller;
import com.google.common.collect.Maps;
import org.activiti.engine.*;
import org.activiti.engine.form.FormProperty;
import org.activiti.engine.form.TaskFormData;
import org.activiti.engine.impl.form.DateFormType;
import org.activiti.engine.impl.form.StringFormType;
import org.activiti.engine.repository.Deployment;
import org.activiti.engine.repository.DeploymentBuilder;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Scanner;
/**
* 启动类
*/
public class DemoMain {
private static Logger logger = LoggerFactory.getLogger(DemoMain.class);
public static void main(String[] args) throws ParseException {
logger.info("启动我们的程序");
//创建流程引擎
ProcessEngine processEngine = getProcessEngine();
//部署流程定义文件
ProcessDefinition processDefinition = getProcessDefinition(processEngine);
//启动运行流程
ProcessInstance processInstance=getProcessInstance(processEngine, processDefinition);
//处理流程任务
processTask(processEngine, processInstance);
logger.info("结束我们的程序");
}
private static void processTask(ProcessEngine processEngine, ProcessInstance processInstance) throws ParseException {
Scanner scanner = new Scanner(System.in);
while (processInstance!=null && !processInstance.isEnded()){
TaskService taskService = processEngine.getTaskService();
List<Task> list = taskService.createTaskQuery().list();
logger.info("待处理人任务数量[{}]",list.size());
for (Task task:list) {
logger.info("待处理人任务[{}]",task.getName());
HashMap<String, Object> map = getMap(processEngine, scanner, task);
//提交表单
taskService.complete(task.getId(),map);
processInstance = processEngine.getRuntimeService().
createProcessInstanceQuery().
processInstanceId(processInstance.getId()).
singleResult();
}
}
scanner.close();
}
private static HashMap<String, Object> getMap(ProcessEngine processEngine, Scanner scanner, Task task) throws ParseException {
FormService formService = processEngine.getFormService();
TaskFormData taskFormData = formService.getTaskFormData(task.getId());
//获取属性表单
List<FormProperty> formProperties = taskFormData.getFormProperties();
HashMap<String, Object> map = Maps.newHashMap();
for (FormProperty property : formProperties) {
String line = null;
if(StringFormType.class.isInstance(property.getType())){
logger.info("请输入{} ?",property.getName());
line = scanner.nextLine();
map.put(property.getId(),line);
}else if(DateFormType.class.isInstance(property.getType())){
logger.info("请输入{} ? 格式(yyyy-MM-dd)",property.getName());
line = scanner.nextLine();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date date = dateFormat.parse(line);
map.put(property.getId(),date);
}else{
logger.info("类型暂不支持{}",property.getType());
}
logger.info("你输入的内容是[{}]",line);
}
return map;
}
private static ProcessInstance getProcessInstance(ProcessEngine processEngine, ProcessDefinition processDefinition) {
RuntimeService runtimeService = processEngine.getRuntimeService();
ProcessInstance processInstance = runtimeService.startProcessInstanceById(processDefinition.getId());
logger.info("启动流程[{}]",processInstance.getProcessDefinitionKey());
return processInstance;
}
private static ProcessDefinition getProcessDefinition(ProcessEngine processEngine) {
RepositoryService repositoryService = processEngine.getRepositoryService();
DeploymentBuilder deploymentBuilder = repositoryService.createDeployment();
deploymentBuilder.addClasspathResource("second_approve.bpmn20.xml");
Deployment deployment = deploymentBuilder.deploy();
String deploymentId = deployment.getId();
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().deploymentId(deploymentId).singleResult();
logger.info("流程定义文件[{}],流程id[{}]",processDefinition.getName(),processDefinition.getId() );
return processDefinition;
}
private static ProcessEngine getProcessEngine() {
ProcessEngineConfiguration cfg = ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration();
ProcessEngine processEngine = cfg.buildProcessEngine();
String name = processEngine.getName();
String version=processEngine.VERSION;
logger.info("流程引擎名称[{}],版本[{}]",name,version);
return processEngine;
}
}
package com.bbd.bpm.controller;
import com.bbd.bpm.domain.User;
import com.bbd.bpm.domain.VacationForm;
import com.bbd.bpm.service.MiaoService;
import com.bbd.bpm.util.ResultInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@Controller
public class MiaoController {
@Autowired
private MiaoService miaoService;
@GetMapping( "/")
public String login(){
return "login";
}
//申请者的首页
@GetMapping( "/home")
public String index(ModelMap model, HttpServletRequest request){
List<VacationForm> forms = miaoService.formList();
Cookie[] cookies = request.getCookies();
String user = "";
//从cookie中获取当前用户
if (cookies != null) {
for (Cookie cookie : cookies) {
if (cookie.getName().equals("userInfo")) {
user = cookie.getValue();
break;
}
}
}
List<HashMap<String, Object>> formsMap = new ArrayList<HashMap<String, Object>>();
for(VacationForm form : forms) {
//申请者只能看到自己申请的请假单信息
if(user.equals(form.getApplicant())) {
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("id", form.getId());
map.put("title", form.getTitle());
map.put("content", form.getContent());
map.put("applicant", form.getApplicant());
map.put("days", form.getDays());
map.put("state", form.getState());
formsMap.add(map);
}
}
//将forms参数返回
model.addAttribute("forms",formsMap);
return "index";
}
//审核者的首页
@GetMapping( "/homeApprover")
public String indexApprover(ModelMap model){
List<VacationForm> forms = miaoService.formList();
List<HashMap<String, Object>> formsMap = new ArrayList<HashMap<String, Object>>();
for(VacationForm form : forms) {
//审核者只能看到待审核状态的请假单
if("领导审核".equals(form.getState())) {
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("id", form.getId());
map.put("title", form.getTitle());
map.put("content", form.getContent());
map.put("applicant", form.getApplicant());
map.put("state", form.getState());
formsMap.add(map);
}
}
model.addAttribute("forms",formsMap);
return "indexApprover";
}
//管理层的首页
@GetMapping( "/homeApproverzjl")
public String homeApproverzjl(ModelMap model){
List<VacationForm> forms = miaoService.formList();
List<HashMap<String, Object>> formsMap = new ArrayList<HashMap<String, Object>>();
for(VacationForm form : forms) {
//审核者只能看到待审核状态的请假单
if("管理层审核".equals(form.getState())) {
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("id", form.getId());
map.put("title", form.getTitle());
map.put("content", form.getContent());
map.put("applicant", form.getApplicant());
map.put("state", form.getState());
formsMap.add(map);
}
}
model.addAttribute("forms",formsMap);
return "indexApproverzjl";
}
//人事的首页
@GetMapping( "/homeApproverHr")
public String homeApproverHr(ModelMap model){
List<VacationForm> forms = miaoService.formList();
List<HashMap<String, Object>> formsMap = new ArrayList<HashMap<String, Object>>();
for(VacationForm form : forms) {
//审核者只能看到待审核状态的请假单
if("通知人事".equals(form.getState())||"已结束".equals(form.getState())) {
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("id", form.getId());
map.put("title", form.getTitle());
map.put("content", form.getContent());
map.put("applicant", form.getApplicant());
map.put("state", form.getState());
map.put("approver",form.getApprover());
formsMap.add(map);
}
}
model.addAttribute("forms",formsMap);
return "indexApproverHr";
}
//请假单页面
@GetMapping( "/form")
public String form(){
return "form";
}
@PostMapping( "/login")
@ResponseBody
public ResultInfo login(HttpServletRequest request, HttpServletResponse response){
ResultInfo result = new ResultInfo();
String username = request.getParameter("username");
User user = miaoService.loginSuccess(username);
if(user != null) {
result.setCode(200);
result.setMsg("登录成功");
result.setInfo(user);
//用户信息存放在Cookie中,实际情况下保存在Redis更佳
Cookie cookie = new Cookie("userInfo", username);
cookie.setPath("/");
response.addCookie(cookie);
}else {
result.setCode(300);
result.setMsg("登录名不存在,登录失败");
}
return result;
}
@GetMapping("/logout")
@ResponseBody
public ResultInfo logout(HttpServletRequest request, HttpServletResponse response) {
ResultInfo result = new ResultInfo();
Cookie[] cookies = request.getCookies();
if (cookies != null) {
for (Cookie cookie : cookies) {
if (cookie.getName().equals("userInfo")) {
cookie.setValue(null);
// 立即销毁cookie
cookie.setMaxAge(0);
cookie.setPath("/");
response.addCookie(cookie);
break;
}
}
}
result.setCode(200);
return result;
}
//添加请假单
@GetMapping( "/writeForm")
@ResponseBody
public ResultInfo writeForm(HttpServletRequest request){
ResultInfo result = new ResultInfo();
String title = request.getParameter("title");
String days = request.getParameter("days");
String content = request.getParameter("content");
String operator = request.getParameter("operator");
VacationForm form = miaoService.writeForm(title,content,operator,days);
result.setCode(200);
result.setMsg("填写请假条成功");
result.setInfo(form);
return result;
}
//申请者放弃请假
@GetMapping( "/giveup")
@ResponseBody
public ResultInfo giveup(HttpServletRequest request){
ResultInfo result = new ResultInfo();
String formId = request.getParameter("formId");
String days = request.getParameter("days");
String operator = request.getParameter("operator");
miaoService.completeProcess(days,formId, operator, "giveup");
result.setCode(200);
result.setMsg("放弃请假成功");
return result;
}
//申请未通过
@GetMapping( "/giveups")
@ResponseBody
public ResultInfo giveups(HttpServletRequest request){
ResultInfo result = new ResultInfo();
String formId = request.getParameter("formId");
String days = request.getParameter("days");
String operator = request.getParameter("operator");
miaoService.completeProcesss(days,formId, operator, "giveup");
result.setCode(200);
result.setMsg("放弃请假成功");
return result;
}
//申请者申请请假
@GetMapping( "/apply")
@ResponseBody
public ResultInfo apply(HttpServletRequest request){
ResultInfo result = new ResultInfo();
String formId = request.getParameter("formId");
String operator = request.getParameter("operator");
String days = request.getParameter("days");
miaoService.completeProcess(days,formId, operator, "apply");
result.setCode(200);
result.setMsg("申请请假成功");
return result;
}
//审批者审核请假信息
@GetMapping( "/approve")
@ResponseBody
public ResultInfo approve(HttpServletRequest request){
ResultInfo result = new ResultInfo();
String formId = request.getParameter("formId");
String operator = request.getParameter("operator");
miaoService.approverVacation(formId, operator);
result.setCode(200);
result.setMsg("请假审核成功");
return result;
}
//获取某条请假信息当前状态
@GetMapping( "/currentState")
public HashMap<String,String> currentState(HttpServletRequest request){
String formId = request.getParameter("formId");
HashMap<String,String> map = new HashMap<String,String>();
map = miaoService.getCurrentState(formId);
return map;
}
@GetMapping( "/historyState")
@ResponseBody
public ResultInfo queryHistoricTask(HttpServletRequest request){
ResultInfo result = new ResultInfo();
String formId = request.getParameter("formId");
List process = miaoService.historyState(formId);
result.setCode(200);
result.setInfo(process);
return result;
}
}
package com.bbd.bpm.domain;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
//用户信息表
@Entity
@Table(name = "user")
public class User {
@Id
@GeneratedValue
private Integer id;
private String name;
//用户身份标识(1-申请者,2-审核者)
private Integer type;
private Integer delete_flag;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Integer getDelete_flag() {
return delete_flag;
}
public void setDelete_flag(Integer delete_flag) {
this.delete_flag = delete_flag;
}
}
\ No newline at end of file
package com.bbd.bpm.domain;
import javax.persistence.*;
//请假单信息表
@Entity
@Table(name = "vacation_form")
public class VacationForm {
@Id
@GeneratedValue
private Integer id;
private String title;
private String content;
//申请者
private String applicant;
//审批者
private String approver;
//申请所处状态
@Transient
private String state;
private Integer days;
public Integer getDays() {
return days;
}
public void setDays(Integer days) {
this.days = days;
}
public VacationForm(){
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getApplicant() {
return applicant;
}
public void setApplicant(String applicant) {
this.applicant = applicant;
}
public String getApprover() {
return approver;
}
public void setApprover(String approver) {
this.approver = approver;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
}
\ No newline at end of file
package com.bbd.bpm.service;
import com.bbd.bpm.domain.User;
import com.bbd.bpm.domain.VacationForm;
import java.util.HashMap;
import java.util.List;
public interface MiaoService {
public VacationForm writeForm(String title, String content, String applicant,String days);
public boolean giveupVacation(String formId, String operator);
public boolean applyVacation(String formId, String operator,String days);
public boolean approverVacation(String formId, String operator);
public void completeProcess(String days,String formId, String operator, String input);
public HashMap<String,String> getCurrentState(String formId);
public List<VacationForm> formList();
public User loginSuccess(String user);
public List historyState(String formId);
void completeProcesss(String days, String formId, String operator, String input);
}
package com.bbd.bpm.service;
import com.bbd.bpm.domain.User;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
public interface UserService extends JpaRepository<User, Long> {
public List<User> findByName(String name);
}
\ No newline at end of file
package com.bbd.bpm.service;
import org.springframework.data.jpa.repository.JpaRepository;
import com.bbd.bpm.domain.VacationForm;
public interface VacationFormService extends JpaRepository<VacationForm, Integer> {
}
\ No newline at end of file
package com.bbd.bpm.serviceImpl;
import com.bbd.bpm.domain.User;
import com.bbd.bpm.domain.VacationForm;
import com.bbd.bpm.service.MiaoService;
import com.bbd.bpm.service.UserService;
import com.bbd.bpm.service.VacationFormService;
import io.swagger.models.auth.In;
import org.activiti.engine.HistoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.history.HistoricTaskInstance;
import org.activiti.engine.task.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
@Service("miaoService")
public class MiaoServiceImpl implements MiaoService {
@Autowired
private RuntimeService runtimeService;
@Autowired
private TaskService taskService;
@Autowired
HistoryService historyService;
@Autowired
private VacationFormService vacationFormService;
@Autowired
private UserService userService;
//填写请假信息
@Override
public VacationForm writeForm(String title, String content, String applicant,String days) {
VacationForm form = new VacationForm();
String approver = "未知审批者";
form.setTitle(title);
form.setDays(Integer.valueOf(days));
form.setContent(content);
form.setApplicant(applicant);
form.setApprover(approver);
vacationFormService.save(form);
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("employee", form.getApplicant());
//开始请假流程,使用formId作为流程的businessKey
runtimeService.startProcessInstanceByKey("myProcee", form.getId().toString(), variables);
return form;
}
//根据选择,申请或放弃请假
@Override
public void completeProcess(String days,String formId, String operator, String input) {
//根据businessKey找到当前任务节点
Task task = taskService.createTaskQuery().processInstanceBusinessKey(formId).singleResult();
//设置输入参数,使流程自动流转到对应节点
taskService.setVariable(task.getId(), "input", input);
taskService.complete(task.getId());
if ("apply".equals(input)) {
applyVacation(formId, operator,days);
} else {
giveupVacation(formId, operator);
}
}
//放弃请假
@Override
public boolean giveupVacation(String formId, String operator) {
Task task = taskService.createTaskQuery().processInstanceBusinessKey(formId).singleResult();
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("employee", operator);
//认领任务
taskService.claim(task.getId(), operator);
//完成任务
taskService.complete(task.getId(), variables);
return true;
}
public boolean applyVacation(String formId, String operator,String days) {
Task task = taskService.createTaskQuery().processInstanceBusinessKey(formId).singleResult();
Map<String, Object> variables = new HashMap<String, Object>();
List<User> users = userService.findAll();
String managers = "";
//获取所有具有审核权限的用户
for (User user : users) {
if (user.getType().equals(2)) {
managers += user.getName() + ",";
}
}
managers = managers.substring(0, managers.length() - 1);
variables.put("employee", operator);
variables.put("managers", managers);
Integer day= Integer.valueOf(days);
variables.put("days",day);
taskService.claim(task.getId(), operator);
taskService.complete(task.getId(), variables);
return true;
}
@Override
public boolean approverVacation(String formId, String operator) {
Task task = taskService.createTaskQuery().processInstanceBusinessKey(formId).singleResult();
Map<String, Object> variables = new HashMap<String, Object>();
List<User> users = userService.findAll();
String managers = "";
//获取所有具有审核权限的用户
for (User user : users) {
if (user.getType().equals(3)) {
managers += user.getName() + ",";
}
}
managers = managers.substring(0, managers.length() - 1);
variables.put("employee", operator);
variables.put("managers", managers);
taskService.claim(task.getId(), operator);
taskService.complete(task.getId(),variables);
//更新请假信息的审核人
try{
VacationForm form = vacationFormService.findById(Integer.parseInt(formId)).get();
if (form != null) {
form.setApprover(operator);
vacationFormService.save(form);
}
}catch (Exception e){
e.printStackTrace();
}
return true;
}
//获取请假信息的当前流程状态
@Override
public HashMap<String, String> getCurrentState(String formId) {
HashMap<String, String> map = new HashMap<String, String>();
Task task = taskService.createTaskQuery().processInstanceBusinessKey(formId).singleResult();
if (task != null) {
map.put("status", "processing");
map.put("taskId", task.getId());
map.put("taskName", task.getName());
map.put("user", task.getAssignee());
} else {
map.put("status", "finish");
}
return map;
}
//请假列表
@Override
public List<VacationForm> formList() {
List<VacationForm> formList = vacationFormService.findAll();
for (VacationForm form : formList) {
Task task = taskService.createTaskQuery().processInstanceBusinessKey(form.getId().toString())
.singleResult();
if (task != null) {
String state = task.getName();
form.setState(state);
} else {
form.setState("已结束");
}
}
return formList;
}
//登录验证用户名是否存在
@Override
public User loginSuccess(String username) {
List<User> users = userService.findByName(username);
if (users != null && users.size() > 0) {
User user = users.get(0);
return user;
}
return null;
}
//获取当前登录用户
public String getCurrentUser(HttpServletRequest request) {
String user = "";
Cookie[] cookies = request.getCookies();
if (cookies != null) {
for (Cookie cookie : cookies) {
if (cookie.getName().equals("userInfo")) {
user = cookie.getValue();
}
}
}
return user;
}
//获取已执行的流程信息
@Override
public List historyState(String formId) {
List<HashMap<String, String>> processList = new ArrayList<HashMap<String, String>>();
List<HistoricTaskInstance> list = historyService.createHistoricTaskInstanceQuery()
.processInstanceBusinessKey(formId).list();
if (list != null && list.size() > 0) {
for (HistoricTaskInstance hti : list) {
HashMap<String, String> map = new HashMap<String, String>();
map.put("name", hti.getName());
map.put("operator", hti.getAssignee());
processList.add(map);
}
}
return processList;
}
@Override
public void completeProcesss(String days, String formId, String operator, String input) {
//根据businessKey找到当前任务节点
Task task = taskService.createTaskQuery().processInstanceBusinessKey(formId).singleResult();
//设置输入参数,使流程自动流转到对应节点
taskService.setVariable(task.getId(), "input", input);
taskService.complete(task.getId());
giveupVacations(formId, operator);
}
//放弃请假
public boolean giveupVacations(String formId, String operator) {
Task task = taskService.createTaskQuery().processInstanceBusinessKey(formId).singleResult();
Map<String, Object> variables = new HashMap<String, Object>();
VacationForm vacationForm = vacationFormService.getOne(Integer.valueOf(formId));
variables.put("employee", vacationForm.getApplicant());
variables.put("managers", operator);
//认领任务
taskService.claim(task.getId(), vacationForm.getApplicant());
return true;
}
}
package com.bbd.bpm.util;
/**
* 返回结果信息类
*/
public class ResultInfo {
// 返回状态
private Integer code;
//状态描述信息
private String msg;
//Info查询总数据量
private long count;
//返回数据列表
private Object info;
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public long getCount() {
return count;
}
public void setCount(long count) {
this.count = count;
}
public Object getInfo() {
return info;
}
public void setInfo(Object info) {
this.info = info;
}
public ResultInfo() {
super();
}
}
#端口
#�˿�
server.port=8081
spring.datasource.url=jdbc:mysql://localhost:3306/activititest?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.url=jdbc:mysql://106.75.97.50:3306/test?characterEncoding=UTF-8
spring.datasource.username=airuser
spring.datasource.password=!@JD@2016
#spring.datasource.url=jdbc:mysql://106.75.97.50:3306/test?characterEncoding=UTF-8
#spring.datasource.username=airuser
#spring.datasource.password=!@JD@2016
spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
spring.datasource.driverClassName=com.mysql.jdbc.Driver
##Druid##
#spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
#连接池启动时创建的连接数量的初始值
#���ӳ�����ʱ���������������ij�ʼֵ
spring.datasource.initialSize=5
#最小空闲值.当空闲的连接数少于阀值时,连接池就会预申请去一些连接,以免洪峰来时来不及申请
#��С����ֵ.�����е����������ڷ�ֵʱ�����ӳؾͻ�Ԥ����ȥһЩ���ӣ���������ʱ����������
spring.datasource.minIdle=5
#连接池的最大值,同一时间可以从池分配的最多连接数量,0时无限制
#���ӳص����ֵ��ͬһʱ����Դӳط�����������������0ʱ������
spring.datasource.maxActive=100
#最大建立连接等待时间。单位为 ms,如果超过此时间将接到异常。设为-1表示无限制
#��������ӵȴ�ʱ�䡣��λΪ ms�����������ʱ�佫�ӵ��쳣����Ϊ-1��ʾ������
spring.datasource.maxWait=60000
#1) Destroy线程会检测连接的间隔时间2) testWhileIdle的判断依据,详细看testWhileIdle属性的说明
#1) Destroy�̻߳������ӵļ��ʱ��2) testWhileIdle���ж����ݣ���ϸ��testWhileIdle���Ե�˵��
spring.datasource.timeBetweenEvictionRunsMillis=60000
#配置一个连接在池中最小生存的时间,单位是毫秒
#����һ�������ڳ�����С�����ʱ�䣬��λ�Ǻ���
spring.datasource.minEvictableIdleTimeMillis=300000
#用来检测连接是否有效的sql,要求是一个查询语句
#������������Ƿ���Ч��sql��Ҫ����һ����ѯ���
spring.datasource.validationQuery=SELECT 1
#建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效
#��������Ϊtrue����Ӱ�����ܣ����ұ�֤��ȫ�ԡ��������ӵ�ʱ���⣬�������ʱ�����timeBetweenEvictionRunsMillis��ִ��validationQuery��������Ƿ���Ч
spring.datasource.testWhileIdle=true
#申请连接时执行validationQuery检测连接是否有效,配置true会降低性能
#��������ʱִ��validationQuery��������Ƿ���Ч������true�ή������
spring.datasource.testOnBorrow=false
#归还连接时执行validationQuery检测连接是否有效,配置true会降低性能
#�黹����ʱִ��validationQuery��������Ƿ���Ч������true�ή������
spring.datasource.testOnReturn=false
#是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql5.5以下的版本中没有PSCache功能,建议关闭掉。
#�Ƿ񻺴�preparedStatement��Ҳ����PSCache��PSCache��֧���α�����ݿ����������޴󣬱���˵oracle����mysql5.5���µİ汾��û��PSCache���ܣ�����رյ���
spring.datasource.poolPreparedStatements=true
#指定每个连接上PSCache的大
��ÿ��������PSCache�Ĵ�С
spring.datasource.maxPoolPreparedStatementPerConnectionSize=20
#属性类型是字符串,通过别名的方式配置扩展插件,
#常用的插件有:监控统计用的filter:stat日志用的filter:log4j防御sql注入的filter:wall
#�����������ַ�����ͨ�������ķ�ʽ������չ�����
#���õIJ���У����ͳ���õ�filter:stat��־�õ�filter:log4j����sqlע���filter:wall
spring.datasource.filters=stat,wall,log4j
spring.datasource.useGlobalDataSourceStat=true
###############################
# Specify the DBMS
spring.jpa.database=MYSQL
# Hibernate ddl auto (create, create-drop, update)
# spring.jpa.hibernate.ddl-auto=update
spring.jpa.hibernate.ddl-auto=update
# Naming strategy
spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy
# stripped before adding them to the entity manager)
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration>
<configuration scan="true" scanPeriod="30 minutes" debug="false">
<!-- 日志存储根路径 -->
<!--<property name="log.dir.root" value="/data/vulcan/logs/web-platform" />-->
<!-- 控制台输出日志 -->
<appender name="INFO" class="ch.qos.logback.core.ConsoleAppender">
<encoder charset="utf-8"> <!-- encoder 可以指定字符集,对于中文输出有意义 -->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n
</pattern>
</encoder>
</appender>
<!-- 出错日志 appender -->
<appender name="ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${log.dir.root}/error/sys-error-%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 180天 -->
<maxHistory>180</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
</encoder>
</appender>
<!-- 访问日志 appender -->
<appender name="ACCESS" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${log.dir.root}/access/sys-access-%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 180天 -->
<maxHistory>180</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
</encoder>
</appender>
<!-- 下面配置一些第三方包的日志过滤级别 -->
<logger name="org.springframework" level="INFO"/>
<logger name="org.mybatis" level="INFO" />
<logger name="com.github.abel533" level="INFO" />
<logger name="tk.mybatis" level="INFO" />
<root level="INFO">
<appender-ref ref="INFO" />
<appender-ref ref="ACCESS" />
<appender-ref ref="ERROR" />
</root>
</configuration>
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsd="http://www.w3.org/2001/XMLSchema" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.processes.org/test">
<process id="myProcess" name="My process" isExecutable="true">
<startEvent id="start" name="Start"></startEvent>
<userTask id="usertask1" name="提出请假申请" activiti:assignee="${employee}"></userTask>
<sequenceFlow id="flow1" name="想请假" sourceRef="start" targetRef="usertask3"></sequenceFlow>
<userTask id="usertask2" name="领导审核" activiti:candidateUsers="${managers}"></userTask>
<sequenceFlow id="flow4" sourceRef="usertask1" targetRef="usertask2"></sequenceFlow>
<endEvent id="endevent1" name="End"></endEvent>
<userTask id="usertask3" name="填写请假单" activiti:assignee="${employee}"></userTask>
<userTask id="usertask4" name="放弃请假"></userTask>
<sequenceFlow id="flow6" name="想了想还是不请了" sourceRef="exclusivegateway1" targetRef="usertask4">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='giveup'}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow7" sourceRef="usertask4" targetRef="endevent1"></sequenceFlow>
<sequenceFlow id="flow3" name="下定决心准备请假" sourceRef="exclusivegateway1" targetRef="usertask1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='apply'}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow2" sourceRef="usertask3" targetRef="exclusivegateway1"></sequenceFlow>
<exclusiveGateway id="exclusivegateway2" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow8" sourceRef="usertask2" targetRef="exclusivegateway2"></sequenceFlow>
<sequenceFlow id="flow9" name="审核通过" sourceRef="exclusivegateway2" targetRef="endevent1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='apply'}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow10" name="审核未通过" sourceRef="exclusivegateway2" targetRef="usertask3">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='giveup'}]]></conditionExpression>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_myProcess">
<bpmndi:BPMNPlane bpmnElement="myProcess" id="BPMNPlane_myProcess">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start">
<omgdc:Bounds height="35.0" width="35.0" x="0.0" y="124.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
<omgdc:Bounds height="55.0" width="105.0" x="340.0" y="20.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask2" id="BPMNShape_usertask2">
<omgdc:Bounds height="55.0" width="105.0" x="502.0" y="22.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
<omgdc:Bounds height="35.0" width="35.0" x="537.0" y="240.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask3" id="BPMNShape_usertask3">
<omgdc:Bounds height="55.0" width="105.0" x="110.0" y="114.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask4" id="BPMNShape_usertask4">
<omgdc:Bounds height="55.0" width="105.0" x="340.0" y="230.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1">
<omgdc:Bounds height="40.0" width="40.0" x="250.0" y="121.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway2" id="BPMNShape_exclusivegateway2">
<omgdc:Bounds height="40.0" width="40.0" x="535.0" y="140.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="35.0" y="141.0"></omgdi:waypoint>
<omgdi:waypoint x="110.0" y="141.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="48.0" x="35.0" y="141.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="445.0" y="47.0"></omgdi:waypoint>
<omgdi:waypoint x="502.0" y="49.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="270.0" y="161.0"></omgdi:waypoint>
<omgdi:waypoint x="392.0" y="230.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="48.0" width="96.0" x="270.0" y="161.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
<omgdi:waypoint x="445.0" y="257.0"></omgdi:waypoint>
<omgdi:waypoint x="537.0" y="257.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="270.0" y="121.0"></omgdi:waypoint>
<omgdi:waypoint x="392.0" y="75.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="48.0" width="96.0" x="270.0" y="121.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="215.0" y="141.0"></omgdi:waypoint>
<omgdi:waypoint x="250.0" y="141.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
<omgdi:waypoint x="554.0" y="77.0"></omgdi:waypoint>
<omgdi:waypoint x="555.0" y="140.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
<omgdi:waypoint x="555.0" y="180.0"></omgdi:waypoint>
<omgdi:waypoint x="554.0" y="240.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="64.0" x="565.0" y="180.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
<omgdi:waypoint x="575.0" y="160.0"></omgdi:waypoint>
<omgdi:waypoint x="676.0" y="160.0"></omgdi:waypoint>
<omgdi:waypoint x="676.0" y="351.0"></omgdi:waypoint>
<omgdi:waypoint x="365.0" y="351.0"></omgdi:waypoint>
<omgdi:waypoint x="162.0" y="351.0"></omgdi:waypoint>
<omgdi:waypoint x="162.0" y="169.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="80.0" x="679.0" y="300.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsd="http://www.w3.org/2001/XMLSchema" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.processes.org/test">
<process id="myProcesss" name="My process" isExecutable="true">
<startEvent id="start" name="Start"></startEvent>
<userTask id="usertask1" name="提出请假申请" activiti:assignee="${employee}"></userTask>
<sequenceFlow id="flow1" name="想请假" sourceRef="start" targetRef="usertask3"></sequenceFlow>
<userTask id="usertask2" name="领导审核" activiti:candidateUsers="${managers}"></userTask>
<endEvent id="endevent1" name="End"></endEvent>
<userTask id="usertask3" name="填写请假单" activiti:assignee="${employee}"></userTask>
<userTask id="usertask4" name="放弃请假"></userTask>
<sequenceFlow id="flow6" name="想了想还是不请了" sourceRef="exclusivegateway1" targetRef="usertask4">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='giveup'}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow7" sourceRef="usertask4" targetRef="endevent1"></sequenceFlow>
<sequenceFlow id="flow3" name="下定决心准备请假" sourceRef="exclusivegateway1" targetRef="usertask1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='apply'}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow2" sourceRef="usertask3" targetRef="exclusivegateway1"></sequenceFlow>
<exclusiveGateway id="exclusivegateway2" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow8" sourceRef="usertask2" targetRef="exclusivegateway2"></sequenceFlow>
<sequenceFlow id="flow9" name="审核通过" sourceRef="exclusivegateway2" targetRef="endevent1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='apply'}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow10" name="审核未通过" sourceRef="exclusivegateway2" targetRef="usertask3">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='giveup'}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway id="exclusivegateway4" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow4" sourceRef="usertask1" targetRef="exclusivegateway4"></sequenceFlow>
<sequenceFlow id="flow5" sourceRef="exclusivegateway4" targetRef="usertask2">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${days>10}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow11" sourceRef="exclusivegateway4" targetRef="endevent1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${days<10}]]></conditionExpression>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_myProcesss">
<bpmndi:BPMNPlane bpmnElement="myProcesss" id="BPMNPlane_myProcesss">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start">
<omgdc:Bounds height="35.0" width="35.0" x="0.0" y="124.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
<omgdc:Bounds height="55.0" width="105.0" x="340.0" y="20.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask2" id="BPMNShape_usertask2">
<omgdc:Bounds height="55.0" width="105.0" x="655.0" y="20.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
<omgdc:Bounds height="35.0" width="35.0" x="537.0" y="240.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask3" id="BPMNShape_usertask3">
<omgdc:Bounds height="55.0" width="105.0" x="110.0" y="114.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask4" id="BPMNShape_usertask4">
<omgdc:Bounds height="55.0" width="105.0" x="340.0" y="230.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1">
<omgdc:Bounds height="40.0" width="40.0" x="250.0" y="121.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway2" id="BPMNShape_exclusivegateway2">
<omgdc:Bounds height="40.0" width="40.0" x="535.0" y="140.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway4" id="BPMNShape_exclusivegateway4">
<omgdc:Bounds height="40.0" width="40.0" x="490.0" y="28.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="35.0" y="141.0"></omgdi:waypoint>
<omgdi:waypoint x="110.0" y="141.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="48.0" x="35.0" y="141.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="270.0" y="161.0"></omgdi:waypoint>
<omgdi:waypoint x="392.0" y="230.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="48.0" width="96.0" x="270.0" y="161.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
<omgdi:waypoint x="445.0" y="257.0"></omgdi:waypoint>
<omgdi:waypoint x="537.0" y="257.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="270.0" y="121.0"></omgdi:waypoint>
<omgdi:waypoint x="392.0" y="75.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="48.0" width="96.0" x="270.0" y="121.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="215.0" y="141.0"></omgdi:waypoint>
<omgdi:waypoint x="250.0" y="141.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
<omgdi:waypoint x="707.0" y="75.0"></omgdi:waypoint>
<omgdi:waypoint x="555.0" y="140.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
<omgdi:waypoint x="555.0" y="180.0"></omgdi:waypoint>
<omgdi:waypoint x="554.0" y="240.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="64.0" x="565.0" y="180.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
<omgdi:waypoint x="575.0" y="160.0"></omgdi:waypoint>
<omgdi:waypoint x="676.0" y="160.0"></omgdi:waypoint>
<omgdi:waypoint x="676.0" y="351.0"></omgdi:waypoint>
<omgdi:waypoint x="365.0" y="351.0"></omgdi:waypoint>
<omgdi:waypoint x="162.0" y="351.0"></omgdi:waypoint>
<omgdi:waypoint x="162.0" y="169.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="80.0" x="679.0" y="300.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="445.0" y="47.0"></omgdi:waypoint>
<omgdi:waypoint x="490.0" y="48.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="530.0" y="48.0"></omgdi:waypoint>
<omgdi:waypoint x="655.0" y="47.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
<omgdi:waypoint x="510.0" y="68.0"></omgdi:waypoint>
<omgdi:waypoint x="510.0" y="257.0"></omgdi:waypoint>
<omgdi:waypoint x="537.0" y="257.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.processes.org/test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.w3.org/1999/XPath" id="m1548745879356" name="" targetNamespace="http://www.processes.org/test" typeLanguage="http://www.w3.org/2001/XMLSchema">
<process id="myProceeee" isClosed="false" isExecutable="true" name="My process" processType="None">
<startEvent id="start" name="Start"/>
<userTask activiti:assignee="${employee}" activiti:exclusive="true" id="usertask1" name="提出请假申请"/>
<sequenceFlow id="flow1" name="想请假" sourceRef="start" targetRef="usertask3"/>
<userTask activiti:candidateUsers="${managers}" activiti:exclusive="true" id="usertask2" name="领导审核"/>
<endEvent id="endevent1" name="End"/>
<userTask activiti:assignee="${employee}" activiti:exclusive="true" id="usertask3" name="填写请假单"/>
<userTask activiti:exclusive="true" id="usertask4" name="放弃请假"/>
<sequenceFlow id="flow6" name="想了想还是不请了" sourceRef="exclusivegateway1" targetRef="usertask4">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='giveup'}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow7" sourceRef="usertask4" targetRef="endevent1"/>
<sequenceFlow id="flow3" name="下定决心准备请假" sourceRef="exclusivegateway1" targetRef="usertask1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='apply'}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway gatewayDirection="Unspecified" id="exclusivegateway1" name="Exclusive Gateway"/>
<sequenceFlow id="flow2" sourceRef="usertask3" targetRef="exclusivegateway1"/>
<exclusiveGateway gatewayDirection="Unspecified" id="exclusivegateway2" name="Exclusive Gateway"/>
<sequenceFlow id="flow8" sourceRef="usertask2" targetRef="exclusivegateway2"/>
<sequenceFlow id="flow9" name="审核通过" sourceRef="exclusivegateway2" targetRef="endevent1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='apply'}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow10" name="审核未通过" sourceRef="exclusivegateway2" targetRef="usertask3">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='giveup'}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway gatewayDirection="Unspecified" id="exclusivegateway4" name="Exclusive Gateway"/>
<sequenceFlow id="flow4" sourceRef="usertask1" targetRef="exclusivegateway4"/>
<sequenceFlow id="flow5" sourceRef="exclusivegateway4" targetRef="usertask2">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${days<10 && days>=3}]]></conditionExpression>
</sequenceFlow>
<userTask activiti:exclusive="true" id="usertask5" name="领导审核1"/>
<sequenceFlow id="flow11" sourceRef="exclusivegateway4" targetRef="usertask5">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${days<3}]]></conditionExpression>
</sequenceFlow>
<userTask activiti:exclusive="true" id="usertask6" name="领导审核2"/>
<sequenceFlow id="flow13" sourceRef="exclusivegateway4" targetRef="usertask6">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${days>10}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow12" sourceRef="usertask5" targetRef="exclusivegateway2"/>
<sequenceFlow id="flow14" sourceRef="usertask6" targetRef="exclusivegateway2"/>
</process>
<bpmndi:BPMNDiagram documentation="background=#FFFFFF;count=1;horizontalcount=1;orientation=0;width=842.4;height=1195.2;imageableWidth=832.4;imageableHeight=1185.2;imageableX=5.0;imageableY=5.0" id="Diagram-_1" name="New Diagram">
<bpmndi:BPMNPlane bpmnElement="myProceeee">
<bpmndi:BPMNShape bpmnElement="start" id="Shape-start">
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="124.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask1" id="Shape-usertask1">
<omgdc:Bounds height="55.0" width="105.0" x="380.0" y="114.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="105.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask2" id="Shape-usertask2">
<omgdc:Bounds height="55.0" width="105.0" x="860.0" y="121.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="105.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="Shape-endevent1">
<omgdc:Bounds height="32.0" width="32.0" x="920.0" y="410.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask3" id="Shape-usertask3">
<omgdc:Bounds height="55.0" width="105.0" x="110.0" y="114.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="105.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask4" id="Shape-usertask4">
<omgdc:Bounds height="55.0" width="105.0" x="330.0" y="400.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="105.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="Shape-exclusivegateway1" isMarkerVisible="false">
<omgdc:Bounds height="32.0" width="32.0" x="250.0" y="121.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway2" id="Shape-exclusivegateway2" isMarkerVisible="false">
<omgdc:Bounds height="32.0" width="32.0" x="1120.0" y="220.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway4" id="Shape-exclusivegateway4" isMarkerVisible="false">
<omgdc:Bounds height="32.0" width="32.0" x="661.0" y="128.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask5" id="Shape-usertask5">
<omgdc:Bounds height="55.0" width="105.0" x="860.0" y="40.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="105.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask6" id="Shape-usertask6">
<omgdc:Bounds height="55.0" width="105.0" x="860.0" y="204.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="105.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1" sourceElement="start" targetElement="usertask3">
<omgdi:waypoint x="32.0" y="140.0"/>
<omgdi:waypoint x="110.0" y="141.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="48.0" x="35.0" y="141.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2" sourceElement="usertask3" targetElement="exclusivegateway1">
<omgdi:waypoint x="215.0" y="141.5"/>
<omgdi:waypoint x="250.0" y="137.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3" sourceElement="exclusivegateway1" targetElement="usertask1">
<omgdi:waypoint x="282.0" y="137.0"/>
<omgdi:waypoint x="380.0" y="141.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="48.0" width="96.0" x="290.0" y="141.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4" sourceElement="usertask1" targetElement="exclusivegateway4">
<omgdi:waypoint x="485.0" y="141.5"/>
<omgdi:waypoint x="661.0" y="144.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5" sourceElement="exclusivegateway4" targetElement="usertask2">
<omgdi:waypoint x="693.0" y="144.0"/>
<omgdi:waypoint x="860.0" y="148.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6" sourceElement="exclusivegateway1" targetElement="usertask4">
<omgdi:waypoint x="282.0" y="137.0"/>
<omgdi:waypoint x="330.0" y="427.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="48.0" width="96.0" x="270.0" y="161.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7" sourceElement="usertask4" targetElement="endevent1">
<omgdi:waypoint x="435.0" y="427.5"/>
<omgdi:waypoint x="920.0" y="426.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8" sourceElement="usertask2" targetElement="exclusivegateway2">
<omgdi:waypoint x="965.0" y="148.5"/>
<omgdi:waypoint x="1120.0" y="236.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9" sourceElement="exclusivegateway2" targetElement="endevent1">
<omgdi:waypoint x="1120.0" y="236.0"/>
<omgdi:waypoint x="952.0" y="426.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="64.0" x="997.0" y="312.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow13" id="BPMNEdge_flow13" sourceElement="exclusivegateway4" targetElement="usertask6">
<omgdi:waypoint x="693.0" y="144.0"/>
<omgdi:waypoint x="860.0" y="231.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow14" id="BPMNEdge_flow14" sourceElement="usertask6" targetElement="exclusivegateway2">
<omgdi:waypoint x="965.0" y="231.5"/>
<omgdi:waypoint x="1120.0" y="236.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10" sourceElement="exclusivegateway2" targetElement="usertask3">
<omgdi:waypoint x="1140.0" y="248.0"/>
<omgdi:waypoint x="1140.0" y="497.0"/>
<omgdi:waypoint x="676.0" y="497.0"/>
<omgdi:waypoint x="389.0" y="497.0"/>
<omgdi:waypoint x="162.0" y="497.0"/>
<omgdi:waypoint x="162.5" y="169.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="80.0" x="1020.0" y="509.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11" sourceElement="exclusivegateway4" targetElement="usertask5">
<omgdi:waypoint x="693.0" y="144.0"/>
<omgdi:waypoint x="860.0" y="67.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12" sourceElement="usertask5" targetElement="exclusivegateway2">
<omgdi:waypoint x="965.0" y="67.0"/>
<omgdi:waypoint x="1140.0" y="67.0"/>
<omgdi:waypoint x="1140.0" y="224.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="-1.0" width="-1.0" x="-1.0" y="-1.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.processes.org/test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.processes.org/test">
<process id="myProcee" name="My process" isExecutable="true" isClosed="false" processType="None">
<startEvent id="start" name="Start"></startEvent>
<userTask id="usertask1" name="提出请假申请" activiti:assignee="${employee}"></userTask>
<sequenceFlow id="flow1" name="想请假" sourceRef="start" targetRef="usertask3"></sequenceFlow>
<userTask id="usertask2" name="领导审核" activiti:candidateUsers="${managers}"></userTask>
<endEvent id="endevent1" name="End"></endEvent>
<userTask id="usertask3" name="填写请假单" activiti:assignee="${employee}"></userTask>
<userTask id="usertask4" name="放弃请假"></userTask>
<sequenceFlow id="flow6" name="想了想还是不请了" sourceRef="exclusivegateway1" targetRef="usertask4">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='giveup'}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow7" sourceRef="usertask4" targetRef="endevent1"></sequenceFlow>
<sequenceFlow id="flow3" name="下定决心准备请假" sourceRef="exclusivegateway1" targetRef="usertask1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='apply'}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow2" sourceRef="usertask3" targetRef="exclusivegateway1"></sequenceFlow>
<exclusiveGateway id="exclusivegateway2" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow10" name="审核未通过" sourceRef="exclusivegateway2" targetRef="usertask3">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='giveup'}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway id="exclusivegateway4" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow4" sourceRef="usertask1" targetRef="exclusivegateway4"></sequenceFlow>
<sequenceFlow id="flow5" sourceRef="exclusivegateway4" targetRef="usertask2">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${days<10 && days>=3}]]></conditionExpression>
</sequenceFlow>
<userTask id="usertask5" name="领导审核" activiti:candidateUsers="${managers}"></userTask>
<sequenceFlow id="flow11" sourceRef="exclusivegateway4" targetRef="usertask5">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${days<3}]]></conditionExpression>
</sequenceFlow>
<userTask id="usertask6" name="管理层审核" activiti:candidateUsers="${managers}"></userTask>
<sequenceFlow id="flow13" sourceRef="exclusivegateway4" targetRef="usertask6">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${days>10}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow12" sourceRef="usertask5" targetRef="exclusivegateway2"></sequenceFlow>
<sequenceFlow id="flow14" sourceRef="usertask6" targetRef="exclusivegateway2"></sequenceFlow>
<userTask id="usertask7" name="通知人事" activiti:candidateUsers="${managers}"></userTask>
<sequenceFlow id="flow15" sourceRef="exclusivegateway2" targetRef="usertask7">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='apply'}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow9" sourceRef="usertask7" targetRef="endevent1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='apply'}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway id="exclusivegateway5" name="Exclusive Gateway"></exclusiveGateway>
<sequenceFlow id="flow8" sourceRef="usertask2" targetRef="exclusivegateway5"></sequenceFlow>
<userTask id="usertask8" name="管理层审核" activiti:candidateUsers="${managers}"></userTask>
<sequenceFlow id="flow17" name="同意" sourceRef="exclusivegateway5" targetRef="usertask8">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='apply'}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow18" sourceRef="usertask8" targetRef="exclusivegateway2"></sequenceFlow>
<sequenceFlow id="flow19" sourceRef="exclusivegateway5" targetRef="usertask3">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${input=='giveup'}]]></conditionExpression>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_myProcee">
<bpmndi:BPMNPlane bpmnElement="myProcee" id="BPMNPlane_myProcee">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start">
<omgdc:Bounds height="35.0" width="35.0" x="0.0" y="124.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
<omgdc:Bounds height="55.0" width="105.0" x="380.0" y="114.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask2" id="BPMNShape_usertask2">
<omgdc:Bounds height="55.0" width="105.0" x="740.0" y="121.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
<omgdc:Bounds height="35.0" width="35.0" x="1370.0" y="413.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask3" id="BPMNShape_usertask3">
<omgdc:Bounds height="55.0" width="105.0" x="110.0" y="114.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask4" id="BPMNShape_usertask4">
<omgdc:Bounds height="55.0" width="105.0" x="386.0" y="402.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1">
<omgdc:Bounds height="32.0" width="32.0" x="250.0" y="121.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway2" id="BPMNShape_exclusivegateway2">
<omgdc:Bounds height="32.0" width="32.0" x="1260.0" y="122.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway4" id="BPMNShape_exclusivegateway4">
<omgdc:Bounds height="32.0" width="32.0" x="580.0" y="127.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask5" id="BPMNShape_usertask5">
<omgdc:Bounds height="55.0" width="105.0" x="750.0" y="27.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask6" id="BPMNShape_usertask6">
<omgdc:Bounds height="55.0" width="105.0" x="767.0" y="251.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask7" id="BPMNShape_usertask7">
<omgdc:Bounds height="55.0" width="105.0" x="1330.0" y="209.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway5" id="BPMNShape_exclusivegateway5">
<omgdc:Bounds height="40.0" width="40.0" x="890.0" y="129.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask8" id="BPMNShape_usertask8">
<omgdc:Bounds height="55.0" width="105.0" x="980.0" y="120.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="35.0" y="141.0"></omgdi:waypoint>
<omgdi:waypoint x="110.0" y="141.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="48.0" x="35.0" y="141.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="266.0" y="153.0"></omgdi:waypoint>
<omgdi:waypoint x="270.0" y="429.0"></omgdi:waypoint>
<omgdi:waypoint x="386.0" y="429.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="48.0" width="96.0" x="270.0" y="161.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
<omgdi:waypoint x="491.0" y="429.0"></omgdi:waypoint>
<omgdi:waypoint x="1370.0" y="430.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="282.0" y="137.0"></omgdi:waypoint>
<omgdi:waypoint x="380.0" y="141.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="48.0" width="96.0" x="290.0" y="141.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="215.0" y="141.0"></omgdi:waypoint>
<omgdi:waypoint x="250.0" y="137.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
<omgdi:waypoint x="1292.0" y="138.0"></omgdi:waypoint>
<omgdi:waypoint x="1377.0" y="147.0"></omgdi:waypoint>
<omgdi:waypoint x="1457.0" y="147.0"></omgdi:waypoint>
<omgdi:waypoint x="1457.0" y="497.0"></omgdi:waypoint>
<omgdi:waypoint x="1140.0" y="497.0"></omgdi:waypoint>
<omgdi:waypoint x="676.0" y="497.0"></omgdi:waypoint>
<omgdi:waypoint x="389.0" y="497.0"></omgdi:waypoint>
<omgdi:waypoint x="162.0" y="497.0"></omgdi:waypoint>
<omgdi:waypoint x="162.0" y="169.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="80.0" x="1071.0" y="432.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="485.0" y="141.0"></omgdi:waypoint>
<omgdi:waypoint x="580.0" y="143.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="612.0" y="143.0"></omgdi:waypoint>
<omgdi:waypoint x="740.0" y="148.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
<omgdi:waypoint x="596.0" y="127.0"></omgdi:waypoint>
<omgdi:waypoint x="600.0" y="54.0"></omgdi:waypoint>
<omgdi:waypoint x="750.0" y="54.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow13" id="BPMNEdge_flow13">
<omgdi:waypoint x="596.0" y="159.0"></omgdi:waypoint>
<omgdi:waypoint x="600.0" y="278.0"></omgdi:waypoint>
<omgdi:waypoint x="767.0" y="278.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
<omgdi:waypoint x="855.0" y="54.0"></omgdi:waypoint>
<omgdi:waypoint x="1279.0" y="54.0"></omgdi:waypoint>
<omgdi:waypoint x="1276.0" y="122.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow14" id="BPMNEdge_flow14">
<omgdi:waypoint x="872.0" y="278.0"></omgdi:waypoint>
<omgdi:waypoint x="1280.0" y="278.0"></omgdi:waypoint>
<omgdi:waypoint x="1276.0" y="154.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow15" id="BPMNEdge_flow15">
<omgdi:waypoint x="1276.0" y="154.0"></omgdi:waypoint>
<omgdi:waypoint x="1382.0" y="209.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
<omgdi:waypoint x="1382.0" y="264.0"></omgdi:waypoint>
<omgdi:waypoint x="1387.0" y="413.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
<omgdi:waypoint x="845.0" y="148.0"></omgdi:waypoint>
<omgdi:waypoint x="890.0" y="149.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow17" id="BPMNEdge_flow17">
<omgdi:waypoint x="930.0" y="149.0"></omgdi:waypoint>
<omgdi:waypoint x="980.0" y="147.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="16.0" width="100.0" x="919.0" y="158.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow18" id="BPMNEdge_flow18">
<omgdi:waypoint x="1085.0" y="147.0"></omgdi:waypoint>
<omgdi:waypoint x="1260.0" y="138.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow19" id="BPMNEdge_flow19">
<omgdi:waypoint x="910.0" y="129.0"></omgdi:waypoint>
<omgdi:waypoint x="910.0" y="12.0"></omgdi:waypoint>
<omgdi:waypoint x="558.0" y="12.0"></omgdi:waypoint>
<omgdi:waypoint x="162.0" y="12.0"></omgdi:waypoint>
<omgdi:waypoint x="162.0" y="114.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ No newline at end of file
<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8" />
<title>工作流</title>
</head>
<body>
<div>
<span>填写请假单</span>
<input id="title" placeholder="题目" /><br />
<input id="days" placeholder="请假天数" /><br />
<textarea id="content" placeholder="内容" rows="10"></textarea>
<button onclick="submit()">提交</button>
</div>
</body>
</html>
<style>
* {
font-family: "微软雅黑";
font-size: 15px;
margin: 0 auto;
}
div{
width: 400px;
margin-top:100px;
text-align:center;
padding-top:10px;
}
input,textarea,button{
padding: 3px;
margin-top:10px;
}
input, textarea {
width: 400px;
border: 1px solid #ccc;
border-radius: 4px;
}
button {
width: 408px;
}
</style>
<script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<script>
function submit() {
var operator = getUser();
if(operator == ""){
location.href = "/";
}
$.ajax({
url : "/writeForm",
data : {
"title" : $("#title").val(),
"content" : $("#content").val(),
"days" : $("#days").val(),
"operator" : operator
},
success : function(data) {
if(data.code == 200){
location.href="/home";
}
}
});
}
function getUser(){
var name="userInfo=";
var user = "";
var ca = document.cookie.split(';');
$.each(ca, function(i, item){
if(item.indexOf(name) != -1){
user = item.substring(name.length,item.length);
}
});
return user;
}
</script>
\ No newline at end of file
<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8" />
<title>工作流</title>
<link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css"/>
</head>
<body>
<div>
<button onclick="writeForm()">填写请假单</button>
<button class="log" onclick="logout()">退出</button>
</div>
<table th:if="${forms.size()}>0">
<thead>
<tr>
<td>请假标题</td>
<td>请假内容</td>
<td>请假人</td>
<td>请假天数</td>
<td>状态</td>
<td>操作</td>
</tr>
</thead>
<tr th:each="form:${forms}">
<td th:text="${form.title}"></td>
<td th:text="${form.content}"></td>
<td th:text="${form.days}"></td>
<td th:text="${form.applicant}"></td>
<td th:text="${form.state}"></td>
<td>
<button th:if="${form.state} == '填写请假单'"
th:onclick="'javascript:apply(\''+${form.id}+'\',\''+${form.days}+'\')'">申请请假</button>
<button th:if="${form.state} == '填写请假单'"
th:onclick="'javascript:giveup(\''+${form.id}+'\')'">放弃请假</button>
<button th:onclick="'javascript:checkState(\''+${form.id}+'\')'" data-toggle="modal" data-target="#myModal">查看流程</button>
</td>
</tr>
</table>
<div th:if="${forms.size()}==0">
<br />暂无请假数据
</div>
<!-- 模态框(Modal) -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">流程</h4>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
</div>
</div>
</div>
</div>
</body>
</html>
<style>
body{
margin:10px 10px 100px 10px;
}
* {
font-family: "微软雅黑";
font-size: 15px;
}
td {
padding: 5px 10px;
border: 1px solid #ccc;
}
button {
padding: 5px;
margin: 5px 0;
border: 1px solid #aaa;
border-radius: 4px;
}
.log {
float: right;
padding: 5px 8px;
background: #ec5757;
color: #fff;
}
</style>
<script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<script
src="http://apps.bdimg.com/libs/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script>
function writeForm() {
location.href = "/form";
}
function logout() {
$.ajax({
url : "/logout",
success : function(data) {
if (data.code == 200) {
location.href = "/";
}
}
});
}
function apply(formId,days) {
var operator = getUser();
if (operator == "") {
location.href = "/";
}
$.ajax({
url : "/apply",
data : {
"formId" : formId,
"operator" : operator,
"days":days
},
success : function(data) {
if (data.code == 200) {
location.href = "/home";
}
}
});
}
function giveup(formId) {
var operator = getUser();
if (operator == "") {
location.href = "/";
}
$.ajax({
url : "/giveup",
data : {
"formId" : formId,
"operator" : operator
},
success : function(data) {
if (data.code == 200) {
location.href = "/home";
}
}
});
}
function checkState(formId) {
$.ajax({
url : "/historyState",
data : {
"formId" : formId
},
success : function(data) {
if (data.code == 200) {
var processList = data.info;
var html = "";
$.each(processList, function(i,item){
html += "<span>"+item.name+"(操作人:"+item.operator+")"+"</span><br/><br/>";
});
$(".modal-body").html(html);
}
}
});
}
function getUser() {
var name = "userInfo=";
var user = "";
var ca = document.cookie.split(';');
$.each(ca, function(i, item) {
if (item.indexOf(name) != -1) {
user = item.substring(name.length, item.length);
}
});
return user;
}
</script>
\ No newline at end of file
<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8" />
<title>工作流</title>
</head>
<body>
<div>
<button class="log" onclick="logout()">退出</button>
</div>
<table th:if="${forms.size()}>0">
<thead>
<tr>
<td>请假标题</td>
<td>请假内容</td>
<td>请假人</td>
<td>状态</td>
<td>操作</td>
</tr>
</thead>
<tr th:each="form:${forms}">
<td th:text="${form.title}"></td>
<td th:text="${form.content}"></td>
<td th:text="${form.applicant}"></td>
<td th:text="${form.state}"></td>
<td>
<button th:onclick="'javascript:approve(\''+${form.id}+'\')'">审批通过</button>
<button th:onclick="'javascript:giveup(\''+${form.id}+'\')'">审批不通过</button>
</td>
</tr>
</table>
<div th:if="${forms.size()}==0">
<br />暂无请假数据
</div>
</body>
</html>
<style>
* {
font-family: "微软雅黑";
font-size: 15px;
}
td {
padding: 5px 10px;
border: 1px solid #ccc;
}
button {
padding: 5px;
margin: 5px 0;
border: 1px solid #aaa;
border-radius: 4px;
}
.log{
float:right;
padding:5px 8px;
background:#ec5757;
color:#fff;
}
</style>
<script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<script>
function writeForm(){
location.href = "/form";
}
function logout(){
$.ajax({
url : "/logout",
success : function(data) {
if(data.code == 200){
location.href="/";
}
}
});
}
function approve(formId){
var operator = getUser();
debugger;
if(operator == ""){
location.href = "/";
}
$.ajax({
url : "/approve",
data : {
"formId" : formId,
"operator" : operator
},
success : function(data) {
if(data.code == 200){
location.href="/homeApprover";
}
}
});
}
function giveup(formId) {
var operator = getUser();
if (operator == "") {
location.href = "/";
}
$.ajax({
url : "/giveups",
data : {
"formId" : formId,
"operator" : operator
},
success : function(data) {
if (data.code == 200) {
location.href = "/homeApprover";
}
}
});
}
//获取cookie中的用户信息
function getUser(){
var name="userInfo=";
var user = "";
var ca = document.cookie.split(';');
$.each(ca, function(i, item){
if(item.indexOf(name) != -1){
user = item.substring(name.length,item.length);
}
});
return user;
}
</script>
\ No newline at end of file
<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8" />
<title>工作流</title>
</head>
<body>
<div>
<button class="log" onclick="logout()">退出</button>
</div>
<table th:if="${forms.size()}>0">
<thead>
<tr>
<td>请假标题</td>
<td>请假内容</td>
<td>请假人</td>
<td>审批人</td>
<td>状态</td>
<td>操作</td>
</tr>
</thead>
<tr th:each="form:${forms}">
<td th:text="${form.title}"></td>
<td th:text="${form.content}"></td>
<td th:text="${form.applicant}"></td>
<td th:text="${form.approver}"></td>
<td th:text="${form.state}"></td>
<td>
<span th:if="${form.state!='已结束'}" ><button th:onclick="'javascript:approve(\''+${form.id}+'\')'">人事收到</button></span>
<span th:if="${form.state=='已结束'}" >完成</span>
</td>
</tr>
</table>
<div th:if="${forms.size()}==0">
<br />暂无请假数据
</div>
</body>
</html>
<style>
* {
font-family: "微软雅黑";
font-size: 15px;
}
td {
padding: 5px 10px;
border: 1px solid #ccc;
}
button {
padding: 5px;
margin: 5px 0;
border: 1px solid #aaa;
border-radius: 4px;
}
.log{
float:right;
padding:5px 8px;
background:#ec5757;
color:#fff;
}
</style>
<script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<script>
function writeForm(){
location.href = "/form";
}
function logout(){
$.ajax({
url : "/logout",
success : function(data) {
if(data.code == 200){
location.href="/";
}
}
});
}
function approve(formId){
var operator = getUser();
debugger;
if(operator == ""){
location.href = "/";
}
$.ajax({
url : "/approve",
data : {
"formId" : formId,
"operator" : operator
},
success : function(data) {
if(data.code == 200){
location.href="/homeApproverHr";
}
}
});
}
//获取cookie中的用户信息
function getUser(){
var name="userInfo=";
var user = "";
var ca = document.cookie.split(';');
$.each(ca, function(i, item){
if(item.indexOf(name) != -1){
user = item.substring(name.length,item.length);
}
});
return user;
}
</script>
\ No newline at end of file
<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8" />
<title>工作流</title>
</head>
<body>
<div>
<button class="log" onclick="logout()">退出</button>
</div>
<table th:if="${forms.size()}>0">
<thead>
<tr>
<td>请假标题</td>
<td>请假内容</td>
<td>请假人</td>
<td>状态</td>
<td>操作</td>
</tr>
</thead>
<tr th:each="form:${forms}">
<td th:text="${form.title}"></td>
<td th:text="${form.content}"></td>
<td th:text="${form.applicant}"></td>
<td th:text="${form.state}"></td>
<td>
<button th:onclick="'javascript:approve(\''+${form.id}+'\')'">审批通过</button>
<button th:onclick="'javascript:giveup(\''+${form.id}+'\')'">审批不通过</button>
</td>
</tr>
</table>
<div th:if="${forms.size()}==0">
<br />暂无请假数据
</div>
</body>
</html>
<style>
* {
font-family: "微软雅黑";
font-size: 15px;
}
td {
padding: 5px 10px;
border: 1px solid #ccc;
}
button {
padding: 5px;
margin: 5px 0;
border: 1px solid #aaa;
border-radius: 4px;
}
.log{
float:right;
padding:5px 8px;
background:#ec5757;
color:#fff;
}
</style>
<script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<script>
function writeForm(){
location.href = "/form";
}
function logout(){
$.ajax({
url : "/logout",
success : function(data) {
if(data.code == 200){
location.href="/";
}
}
});
}
function approve(formId){
var operator = getUser();
debugger;
if(operator == ""){
location.href = "/";
}
$.ajax({
url : "/approve",
data : {
"formId" : formId,
"operator" : operator
},
success : function(data) {
if(data.code == 200){
location.href="/homeApproverzjl";
}
}
});
}
function giveup(formId) {
var operator = getUser();
if (operator == "") {
location.href = "/";
}
$.ajax({
url : "/giveups",
data : {
"formId" : formId,
"operator" : operator
},
success : function(data) {
if (data.code == 200) {
location.href = "/homeApproverzjl";
}
}
});
}
//获取cookie中的用户信息
function getUser(){
var name="userInfo=";
var user = "";
var ca = document.cookie.split(';');
$.each(ca, function(i, item){
if(item.indexOf(name) != -1){
user = item.substring(name.length,item.length);
}
});
return user;
}
</script>
\ No newline at end of file
<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8"/>
<title>工作流</title>
</head>
<body>
<div>
<span>登录</span>
<input id="username" placeholder="用户名" /><br />
<button onclick="login()">提交</button>
</div>
</body>
</html>
<style>
* {
font-family: "微软雅黑";
font-size: 15px;
margin: 0 auto;
}
div{
width: 400px;
margin-top:100px;
text-align:center;
padding-top:10px;
}
input,button{
margin-top:10px;
}
input{
width: 400px;
padding: 5px 3px;
border: 1px solid #ccc;
border-radius: 4px;
}
button {
padding:5px 0;
width: 408px;
}
</style>
<script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<script>
function login(){
$.ajax({
url : "/login",
type: "POST",
data : {
"username" : $("#username").val()
},
success : function(data) {
console.log(data)
if(data.code == 200){
if(data.info.type == 1){
location.href="/home";
}else if(data.info.type == 2){
location.href="/homeApprover";
}else if(data.info.type == 3){
location.href="/homeApproverHr";
}else{
location.href="/homeApproverzjl";
}
}else{
alert(data.msg);
}
}
});
}
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment