-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
46 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...ain/java/cn/iocoder/yudao/module/bpm/service/task/trigger/BpmUpdateNormalFormTrigger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package cn.iocoder.yudao.module.bpm.service.task.trigger; | ||
|
||
import cn.hutool.core.collection.CollUtil; | ||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | ||
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.simple.BpmSimpleModelNodeVO.TriggerSetting.NormalFormTriggerSetting; | ||
import cn.iocoder.yudao.module.bpm.enums.definition.BpmTriggerTypeEnum; | ||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService; | ||
import jakarta.annotation.Resource; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Component; | ||
|
||
// TODO @jason:改成 BpmFormUpdateTrigger | ||
/** | ||
* BPM 更新流程表单触发器 | ||
* | ||
* @author jason | ||
*/ | ||
@Component | ||
@Slf4j | ||
public class BpmUpdateNormalFormTrigger implements BpmTrigger { | ||
|
||
@Resource | ||
private BpmProcessInstanceService processInstanceService; | ||
|
||
@Override | ||
public BpmTriggerTypeEnum getType() { | ||
return BpmTriggerTypeEnum.UPDATE_NORMAL_FORM; | ||
} | ||
|
||
@Override | ||
public void execute(String processInstanceId, String param) { | ||
// 1. 解析更新流程表单配置 | ||
NormalFormTriggerSetting setting = JsonUtils.parseObject(param, NormalFormTriggerSetting.class); | ||
if (setting == null) { | ||
log.error("[execute][流程({}) 更新流程表单触发器配置为空]", processInstanceId); | ||
return; | ||
} | ||
// 2.更新流程变量 | ||
if (CollUtil.isNotEmpty(setting.getUpdateFormFields())) { | ||
processInstanceService.updateProcessInstanceVariables(processInstanceId, setting.getUpdateFormFields()); | ||
} | ||
} | ||
|
||
} |