package cn.estsh.i3plus.pojo.ptl.bean;


import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;

/**
 * @author Wynne.Lu
 * @date 2020/2/12 17:41
 * @desc
 */

@Data
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "PTL_ROUTE_STATUS")
@EqualsAndHashCode(callSuper = true)
@Api("流程状态")
public class PtlRouteStatus extends BaseBean implements Serializable {

    private static final long serialVersionUID = 5555766204635105977L;

    @Column(name = "ROUTE_CODE")
    @ApiParam("流程代码")
    private String routeCode;

    @Column(name = "STATUS_CODE")
    @ApiParam("状态代码")
    private String statusCode;

    @Column(name = "STATUS_NAME")
    @ApiParam("状态名称")
    private String statusName;

    @Column(name = "NEXT_STATUS")
    @ApiParam("下一状态")
    private String nextStatus;

    @Column(name = "TRIGGER_TYPE")
    @ApiParam("触发类型")
    private Integer triggerType;

    @Column(name = "TRIGGER_EVENT")
    @ApiParam("触发事件")
    private String triggerEvent;

    @Column(name = "TRIGGER_WHERE")
    @ApiParam("触发条件（MVEL）")
    private String triggerWhere;

    @Column(name = "ACTION_AMG_ID")
    @ApiParam("触发调用")
    private Long actionAmgId;

    @Column(name = "IN_AMG_ID")
    @ApiParam("进入状态调用")
    private Long inAmgId;

    @Column(name = "OUT_AMG_ID")
    @ApiParam("离开状态调用")
    private Long outAmgId;

    @Column(name = "STATUS_TYPE")
    @ApiParam("状态类型")
    private Integer statusType;

    @Transient
    @ApiParam("触发组件集默认未执行")
    private boolean actionAmgIdFalg = false;

    @Transient
    @ApiParam("触发类型默认不需要外部触发")
    private boolean checkTriggerTypeFalg = false;

    @Transient
    @ApiParam("组件执行完成根据业务设置下个触发事件，如果是外部告知下个触发事件则设置null，一个组件集执行完毕后这个值赋给CommonMsgModel的triggerEvent")
    private String nextTriggerEvent;

}
