资源简介
该代码实现画流程图,申请请假,领导审核,重新申请流程等
代码片段和文件信息
package com.activiti;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.activiti.engine.FormService;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.form.FormProperty;
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.junit.jupiter.api.Test;
public class LeaveTest {
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
/**部署流程定义*/
@Test
public void deploymentProcessDefinition(){
RepositoryService repositoryService = processEngine.getRepositoryService();
DeploymentBuilder deploymentBuilder=repositoryService.createDeployment();
deploymentBuilder.name(“请假流程“);
deploymentBuilder.addClasspathResource(“diagrams/LeaveProcess.bpmn“);
deploymentBuilder.addClasspathResource(“diagrams/LeaveProcess.png“);
Deployment deployment = deploymentBuilder.deploy();
//打印我们的流程信息
System.out.println(“流程Id:“+deployment.getId());
System.out.println(“流程Name:“+deployment.getName());
System.out.println(“——————————————————————————————————————————————————“);
}
/**启动流程引擎*/
@Test
public void startProcessInstance(){
RepositoryService repositoryService = processEngine.getRepositoryService();
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionKey(“LeaveProcess“).singleResult();
//设置动态表单
processEngine.getIdentityService().setAuthenticatedUserId(“zhaoliu“);
Map params = new HashMap();
SimpleDateFormat sdt = new SimpleDateFormat(“yyyy-MM-dd“);
Calendar calendar = Calendar.getInstance();
String startDate = sdt.format(calendar.getTime());
calendar.add(Calendar.DAY_OF_MONTH 2);
String endDate = sdt.format(calendar.getTime());
params.put(“startDate“ startDate);
params.put(“endDate“ endDate);
params.put(“reason“ “我要休息“);
FormService formService = processEngine.getFormService();
ProcessInstance processInstance = formService.submitStartFormData(processDefinition.getId() params);
System.out.println(“流程实例ID:“+processInstance.getId());
System.out.println(“流程定义ID:“+processInstance.getProcessDefinitionId());
System.out.println(“——————————————————————————————————————————————————“);
}
/**部门领导审批通过**/
@Test
public void deptLeaderAuditPass(){
String assi
相关资源
- Activiti工作流引擎web设计器activiti-we
- Activiti5.8+SpringMVC整合工作流案例
- activiti ssm
- Activiti5.20.0整合spring4.15,整合流程编
- Activiti实战(咖啡兔)-高清带目录
- activiti-app.war
- Activiti插件
- activiti 工作流详细文档教程+eclipse安装
- activiti工作流流程设计器插件,activ
- SpringMVC+Redis+Activiti+Fastdfs+Thirft+Websoc
- activiti6.0官网war包
- Activiti 实战闫洪磊版-带完整目录
- 基于ssh框架的activiti实战请假流程代码
- spring boot整合activiti
- 《Activiti实战》高清完整中文PDF版(含
- 书-疯狂工作流讲义-中源码.zip
- 疯狂Workflow讲义 基于Activiti的工作流
- Activiti实战PDF电子书及源代码.zip
- Activiti实战(咖啡兔)-含目录
- spring-boot-activiti集成
- 使用activiti工作流引擎显示流程图时高
- Activiti6工作流视频整合SpringBoot2.0
- Activiti6-流程跟踪监控图-节点-流程线
- activiti5.22 pdm模型
- Activiti最新工作流教学及项目源码网盘
- activiti将用户输入框修改为弹出选择框
- Drools.zip
- activiti工作流高亮图配置.zip
- activiti-5.22-API
- 传智播客 activiti 视频资料及代码 第
评论
共有 条评论