package com.fjhx.params;

import com.fjhx.entity.example.ExampleInfo;
import com.fjhx.utils.FlowConstructor;
import lombok.Data;

import java.util.List;

@Data
public class ExampleResult {

    /**
     * 原流程实例
     */
    private ExampleInfo oldExampleInfo;

    /**
     * 现流程实例
     */
    private ExampleInfo exampleInfo;

    /**
     * 新增流程实例明细id
     */
    private List<Long> exampleDetailsIdList;

    /**
     * 处理类型
     */
    private Integer handleType;

    /**
     * 缓存字符串
     */
    private String cacheDataStr;

    /**
     * 跳转节点
     */
    private JumpVo jumpVo;

    /**
     * 回滚是否删除流程实例
     */
    private boolean deleteExample;

    public void after(Runnable runnable) {
        try {
            runnable.run();
        } catch (Exception e) {
            FlowConstructor.rollBack(this);
            throw e;
        }
    }

}
