一款简单的工作流设计器
@ProcessEntity(table = "leaves", process = "请假流程")
@Data
@Accessors(chain = true)
public class Leaves {
@PrimaryKey
@TableId(value = "sid", type = IdType.AUTO)
private Long sid;
@TableField(value = "content")
private String content;
@TableField(value = "days")
private String days;
}
@SpringBootTest(classes = Application.class)
public class ApplicationTests {
@Autowired
private ProcessEngine processEngine;
@Autowired
private LeavesService leavesService;
@Test
public void test02() {
Leaves leaves = new Leaves().setContent("123").setDays("2");
leavesService.save(leaves);
processEngine.taskServiceInstance().runTask(leaves, "gs", "soft");
}
@Test
public void test04() {
TaskStep taskStep = new TaskStep();
taskStep.setUser("guest").setRole("经理")
.setTaskId(1L).setOpinion(ProcessConstant.APPROVE_ALLOW_STATUS)
.setReason("同意").setStageId(1L);
processEngine.taskStepServiceInstance().nextStep(taskStep);
}
@Test
public void test03() {
System.out.println(processEngine.taskServiceInstance().approveUser("admin").page(1, 5).getRecords());
System.out.println(processEngine.taskServiceInstance().approveRole("主管").executeQuery());
System.out.println(processEngine.taskServiceInstance().submitBy("gs").executeQuery());
}