Merge branch 'hotfix/activty_trigger_error' into pre
This commit is contained in:
commit
773d19d3f1
@ -13,6 +13,7 @@ import org.flowable.engine.RuntimeService;
|
|||||||
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
|
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
|
||||||
import org.flowable.engine.impl.util.CommandContextUtil;
|
import org.flowable.engine.impl.util.CommandContextUtil;
|
||||||
import org.flowable.engine.impl.util.ProcessDefinitionUtil;
|
import org.flowable.engine.impl.util.ProcessDefinitionUtil;
|
||||||
|
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;
|
||||||
@ -50,10 +51,12 @@ public class CustomActivityTriggerCmd extends AbstractCommand<Void> implements S
|
|||||||
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