package cn.axzo.workflow.core.service.support.forecast.impl;

import cn.axzo.workflow.core.service.support.forecast.AbstractForecast;
import com.google.common.collect.Lists;
import org.flowable.bpmn.model.FlowElement;
import org.flowable.bpmn.model.ReceiveTask;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 接收任务
 *
 * @author wangli
 * @since 2023/11/28 15:07
 */
@Component
public class ReceiveTaskForecasting extends AbstractForecast<ReceiveTask> {
    @Override
    public Boolean support(FlowElement flowElement) {
        return flowElement instanceof ReceiveTask;
    }

    @Override
    protected List<? extends FlowElement> getOutgoing(ReceiveTask flowElement) {
        return Lists.newArrayList(flowElement.getOutgoingFlows());
    }

}
