using FileFlows.Plugin;
using FileFlows.Plugin.Attributes;
namespace FileFlows.BasicNodes.Functions;
///
/// Flow element that moves a file for reprocessing
///
public class Reprocess : Node
{
///
public override int Inputs => 1;
///
public override int Outputs => 0;
///
public override FlowElementType Type => FlowElementType.Process;
///
public override string HelpUrl => "https://fileflows.com/docs/plugins/basic-nodes/reprocess";
///
public override string Icon => "fas fa-redo";
///
/// Gets or sets the flow to execute
///
[Select("NODE_LIST", 1)]
public ObjectReference Node { get; set; }
///
public override int Execute(NodeParameters args)
{
if (Node.Uid == args.Node.Uid)
{
args.FailureReason = "Target reprocess node is same as current processing node.";
args.Logger?.ELog(args.FailureReason);
return -1;
}
args.Logger?.ILog("Requesting reprocessing on Node: " + Node.Name);
args.ReprocessNode = Node;
return 0;
}
}