using FileFlows.Plugin;
using FileFlows.Plugin.Attributes;
namespace FileFlows.BasicNodes.Functions;
///
/// Flow element that checks if a flow is being executed on a specific processing node
///
public class IsProcessingOnNode : Node
{
///
public override int Inputs => 1;
///
public override int Outputs => 2;
///
public override FlowElementType Type => FlowElementType.Logic;
///
public override string HelpUrl => "https://fileflows.com/docs/plugins/basic-nodes/is-processing-on-node";
///
public override string Icon => "fas fa-question";
///
/// 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.Logger?.ILog("Is processing on node: " + args.Node.Name);
return 1;
}
args.Logger?.ILog("Is not processing on node: " + Node.Name);
return 2;
}
}