FF-1356 - new flow element is processing on node

This commit is contained in:
John Andrews
2024-02-21 21:04:15 +13:00
parent d6a6ce89f8
commit 475ff20058
2 changed files with 51 additions and 0 deletions

View File

@@ -191,6 +191,17 @@
"Node-Help": "The processing node to process this file."
}
},
"IsProcessingOnNode": {
"Description": "Checks if the flow is currently processing on a specified processing node.",
"Fields": {
"Node": "Node",
"Node-Help": "The processing node to check.",
},
"Outputs": {
"1": "Is processing on node",
"2": "Is not processing on node"
}
},
"Log": {
"Description": "Logs a message to the flow log",
"Outputs": {

View File

@@ -0,0 +1,40 @@
using FileFlows.Plugin;
using FileFlows.Plugin.Attributes;
namespace FileFlows.BasicNodes.Functions;
/// <summary>
/// Flow element that checks if a flow is being executed on a specific processing node
/// </summary>
public class IsProcessingOnNode : Node
{
/// <inheritdoc />
public override int Inputs => 1;
/// <inheritdoc />
public override int Outputs => 2;
/// <inheritdoc />
public override FlowElementType Type => FlowElementType.Logic;
/// <inheritdoc />
public override string HelpUrl => "https://fileflows.com/docs/plugins/basic-nodes/is-processing-on-node";
/// <inheritdoc />
public override string Icon => "fas fa-question";
/// <summary>
/// Gets or sets the flow to execute
/// </summary>
[Select("NODE_LIST", 1)]
public ObjectReference Node { get; set; }
/// <inheritdoc />
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;
}
}