package cn.palmte.work.model;

import lombok.Data;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * 流程图里解析出来的任务定义
 */
@Data
@Entity
@Table(name = "act_task_def")
public class ActTaskDef {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    /**
     * 任务名称
     */
    @Column(name = "task_name")
    private String taskName;

    @Column(name = "task_key")
    private String taskKey;

    /**
     * 任务类型  0-单实例（或签）  1-多实例（会签）
     */
    @Column(name = "task_type")
    private int taskType;

    @Column(name = "proc_def_id")
    private String procDefId;

    @Column(name = "proc_def_name")
    private String procDefName;

    @Column(name = "proc_def_key")
    private String procDefKey;

    /**
     * 回退任务key
     */
    @Column(name = "rollback_task_key")
    private String rollbackTaskKey;

    /**
     * 任务节点位置  -1结束节点  0-未知或者其他节点  1-开始节点   2-发起审批节点
     */
    @Column(name = "task_index")
    private int taskIndex;


    /**
     * 候选人
     */
    @Column(name = "candidate_users")
    private String candidateUsers;

    /**
     * 候选角色
     */
    @Column(name = "candidate_roles")
    private String candidateRoles;


    /**
     * 审批通过执行的脚本 act_script(弃用)表id   弃用
     */
    @Column(name = "end_script")
    private int endScript;

    /**
     * 审批驳回执行的脚本 act_script(弃用)表id  弃用
     */
    @Column(name = "rollback_script")
    private int rollbackScript;

    @Column(name = "created_time")
    private Date createdTime;

    @Column(name = "last_updated_time")
    private Date lastUpdatedTime;



    @Transient
    private List<String> candidateUserList;

    @Transient
    private List<String> candidateRoleList;

}
