package cn.stylefeng.workflow.instance.api.factory;

import cn.stylefeng.workflow.api.entity.instance.RuntimeNode;
import cn.stylefeng.workflow.api.entity.instance.RuntimeNodeEdge;

public class RuntimeNodeEdgeFactory {

    public static RuntimeNodeEdge createRuEdges(RuntimeNode sourceRuntimeNode, RuntimeNode targetRuntimeNode, Long instanceId) {

        RuntimeNodeEdge runtimeNodeEdge = new RuntimeNodeEdge();
        runtimeNodeEdge.setInstanceId(instanceId);

        runtimeNodeEdge.setModelId(targetRuntimeNode.getModelId());
        runtimeNodeEdge.setDefinitionId(targetRuntimeNode.getDefinitionId());

        runtimeNodeEdge.setSourceNodeId(sourceRuntimeNode.getRuNodeId());
        runtimeNodeEdge.setTargetNodeId(targetRuntimeNode.getRuNodeId());

        return runtimeNodeEdge;
    }

}
