mirror of
https://github.com/revenz/FileFlowsPlugins.git
synced 2026-01-28 02:29:23 -06:00
FF-1356 - new flow element is processing on node
This commit is contained in:
@@ -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": {
|
||||
|
||||
40
BasicNodes/Functions/IsProcessingOnNode.cs
Normal file
40
BasicNodes/Functions/IsProcessingOnNode.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user