add 增加条件表达式示例

fix 修复提交修改变量参数没有覆盖变量问题
This commit is contained in:
gssong
2025-03-08 00:35:57 +08:00
parent 23245b78ca
commit 5a4be5fba1
4 changed files with 16 additions and 211 deletions

View File

@ -374,6 +374,7 @@ public class FlwInstanceServiceImpl implements IFlwInstanceService {
Instance instance = insService.getById(instanceId);
if (instance != null) {
taskService.mergeVariable(instance, variable);
insService.updateById(instance);
}
}

View File

@ -110,6 +110,8 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
if (ObjectUtil.isNotNull(flowInstance)) {
BusinessStatusEnum.checkStartStatus(flowInstance.getFlowStatus());
List<Task> taskList = taskService.list(new FlowTask().setInstanceId(flowInstance.getId()));
taskService.mergeVariable(flowInstance, variables);
insService.updateById(flowInstance);
StartProcessReturnDTO dto = new StartProcessReturnDTO();
dto.setProcessInstanceId(taskList.get(0).getInstanceId());
dto.setTaskId(taskList.get(0).getId());

View File

@ -47,6 +47,19 @@ public class TestLeaveServiceImpl implements ITestLeaveService {
private final TestLeaveMapper baseMapper;
private final WorkflowService workflowService;
/**
* spel条件表达判断小于2
*
* @param leaveDays 待判断的变量可不传自行返回true或false
* @return boolean
*/
public boolean eval(Integer leaveDays) {
if (leaveDays < 2) {
return true;
}
return false;
}
/**
* 查询请假
*/