package cn.axzo.workflow.core.engine.event;

import cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum;
import org.flowable.common.engine.api.delegate.event.FlowableEventType;

import static cn.axzo.workflow.core.engine.event.ReceiveTaskEventType.CREATE;

/**
 * 扩展任务记录表创建的事件实现
 *
 * @author wangli
 * @since 2024/2/5 18:27
 */
public class ExtTaskInstCreateEvent implements ExtTaskInstEvent {

    private final String processInstanceId;
    private final String activityId;
    private final String taskId;
    private String assignee;
    private final BpmnProcessInstanceResultEnum resultEnum;

    public ExtTaskInstCreateEvent(String processInstanceId, String activityId, String taskId,
                                  String assignee, BpmnProcessInstanceResultEnum resultEnum) {
        this.processInstanceId = processInstanceId;
        this.activityId = activityId;
        this.taskId = taskId;
        this.assignee = assignee;
        this.resultEnum = resultEnum;
    }

    public ExtTaskInstCreateEvent(String processInstanceId, String activityId, String taskId,
                                  BpmnProcessInstanceResultEnum resultEnum) {
        this.processInstanceId = processInstanceId;
        this.activityId = activityId;
        this.taskId = taskId;
        this.resultEnum = resultEnum;
    }

    public String getProcessInstanceId() {
        return processInstanceId;
    }

    public String getActivityId() {
        return activityId;
    }

    public String getTaskId() {
        return taskId;
    }

    @Override
    public String getAssignee() {
        return assignee;
    }

    public BpmnProcessInstanceResultEnum getResultEnum() {
        return resultEnum;
    }

    @Override
    public FlowableEventType getType() {
        return CREATE;
    }

}
