feat(REQ-5965) - 测试异步触发的处理
This commit is contained in:
parent
c7edc54720
commit
ccda358a99
@ -12,6 +12,7 @@ import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
|
|||||||
import org.flowable.engine.impl.util.CommandContextUtil;
|
import org.flowable.engine.impl.util.CommandContextUtil;
|
||||||
import org.flowable.job.service.JobService;
|
import org.flowable.job.service.JobService;
|
||||||
import org.flowable.job.service.impl.persistence.entity.JobEntity;
|
import org.flowable.job.service.impl.persistence.entity.JobEntity;
|
||||||
|
import org.flowable.task.api.TaskQuery;
|
||||||
import org.flowable.task.service.impl.persistence.entity.TaskEntity;
|
import org.flowable.task.service.impl.persistence.entity.TaskEntity;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -47,10 +48,12 @@ public class CustomActivityTriggerAsyncCmd extends AbstractCommand<String> imple
|
|||||||
public String execute(CommandContext commandContext) {
|
public String execute(CommandContext commandContext) {
|
||||||
ProcessEngineConfigurationImpl processEngineConfiguration =
|
ProcessEngineConfigurationImpl processEngineConfiguration =
|
||||||
CommandContextUtil.getProcessEngineConfiguration(commandContext);
|
CommandContextUtil.getProcessEngineConfiguration(commandContext);
|
||||||
TaskEntity task = (TaskEntity) processEngineConfiguration.getTaskService().createTaskQuery()
|
TaskQuery taskQuery = processEngineConfiguration.getTaskService().createTaskQuery()
|
||||||
.executionId(dto.getTriggerId())
|
.executionId(dto.getTriggerId());
|
||||||
.taskDefinitionKey(StringUtils.isBlank(dto.getActivityId()) ? null : dto.getActivityId())
|
if (StringUtils.isNotBlank(dto.getActivityId())) {
|
||||||
.singleResult();
|
taskQuery.taskDefinitionKey(dto.getActivityId());
|
||||||
|
}
|
||||||
|
TaskEntity task = (TaskEntity) taskQuery.singleResult();
|
||||||
if (Objects.isNull(task)) {
|
if (Objects.isNull(task)) {
|
||||||
throw new WorkflowEngineException(ACTIVITY_TRIGGER_NOT_EXISTS, dto.getTriggerId());
|
throw new WorkflowEngineException(ACTIVITY_TRIGGER_NOT_EXISTS, dto.getTriggerId());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user