org.jetlinks.rule.engine.api.scheduler.ScheduleJob Maven / Gradle / Ivy
The newest version!
package org.jetlinks.rule.engine.api.scheduler;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.apache.commons.collections.MapUtils;
import org.jetlinks.rule.engine.api.model.Condition;
import org.jetlinks.rule.engine.api.model.RuleLink;
import org.jetlinks.rule.engine.api.model.RuleModel;
import org.jetlinks.rule.engine.api.model.RuleNodeModel;
import org.jetlinks.rule.engine.api.task.TaskExecutorProvider;
import javax.annotation.Nonnull;
import java.io.Serializable;
import java.util.*;
/**
* 调度任务,在规则发布时,会将规则节点{@link org.jetlinks.rule.engine.api.model.RuleNodeModel}转为任务,发送给对应的调度器{@link Scheduler}进行调度执行
*
* @author zhouhao
* @since 1.0
*/
@Getter
@Setter
public class ScheduleJob implements Serializable {
private static final long serialVersionUID = -1L;
/**
* 规则实例ID
*/
@Nonnull
private String instanceId;
/**
* 规则ID
*
* @see RuleNodeModel#getRuleId()
*/
@Nonnull
private String ruleId;
/**
* 节点ID
*
* @see RuleNodeModel#getId()
*/
@Nonnull
private String nodeId;
/**
* 模型类型
*/
private String modelType;
/**
* 任务名称
*/
private String name;
/**
* 执行器
*
* @see TaskExecutorProvider#getExecutor()
* @see RuleNodeModel#getExecutor()
*/
@Nonnull
private String executor;
/**
* 执行器配置信息
*
* @see RuleNodeModel#getConfiguration()
*/
private Map configuration;
/**
* 规则配置信息
*
* @see RuleModel#getConfiguration()
*/
private Map ruleConfiguration;
/**
* 输入节点
*
* @see RuleNodeModel#getId()
* @see RuleNodeModel#getInputs()
*/
private List inputs = new ArrayList<>();
/**
* 监听事件输入
*/
private List events = new ArrayList<>();
/**
* 监听事件输出
*/
private List eventOutputs = new ArrayList<>();
/**
* 输出节点
*/
private List