001/**
002 * Copyright (c) 2025-2026, Michael Yang 杨福海 (fuhai999@gmail.com).
003 * <p>
004 * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 * <p>
008 * http://www.gnu.org/licenses/lgpl-3.0.txt
009 * <p>
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package dev.tinyflow.core.chain.runtime;
017
018import java.io.Serializable;
019
020public class Trigger implements Serializable {
021    private String id;
022    private String stateInstanceId;
023    private String edgeId;
024    private String nodeId; // 可以为 null,代表触发整个 chain
025    private TriggerType type;
026    private long triggerAt; // epoch ms
027
028    public Trigger() {
029    }
030
031    public String getId() {
032        return id;
033    }
034
035    public void setId(String id) {
036        this.id = id;
037    }
038
039
040    public String getStateInstanceId() {
041        return stateInstanceId;
042    }
043
044    public void setStateInstanceId(String stateInstanceId) {
045        this.stateInstanceId = stateInstanceId;
046    }
047
048    public String getEdgeId() {
049        return edgeId;
050    }
051
052    public void setEdgeId(String edgeId) {
053        this.edgeId = edgeId;
054    }
055
056    public String getNodeId() {
057        return nodeId;
058    }
059
060    public void setNodeId(String nodeId) {
061        this.nodeId = nodeId;
062    }
063
064    public TriggerType getType() {
065        return type;
066    }
067
068    public void setType(TriggerType type) {
069        this.type = type;
070    }
071
072    public long getTriggerAt() {
073        return triggerAt;
074    }
075
076    public void setTriggerAt(long triggerAt) {
077        this.triggerAt = triggerAt;
078    }
079
080    @Override
081    public String toString() {
082        return "Trigger{" +
083                "id='" + id + '\'' +
084                ", stateInstanceId='" + stateInstanceId + '\'' +
085                ", edgeId='" + edgeId + '\'' +
086                ", nodeId='" + nodeId + '\'' +
087                ", type=" + type +
088                ", triggerAt=" + triggerAt +
089                '}';
090    }
091}
092