FF-1241 - added new flow element reprocess

This commit is contained in:
John Andrews
2024-02-21 15:25:25 +13:00
parent 86b89ea48d
commit 73508d3acf
5 changed files with 79 additions and 21 deletions

View File

@@ -184,6 +184,13 @@
"Flow": "Flow"
}
},
"Reprocess": {
"Description": "The flow element allows you to reprocess the original library file with a different processing node.\n\n If the same processing node is selected as the one currently processing the file, the flow will fail.",
"Fields": {
"Node": "Node",
"Node-Help": "The processing node to process this file."
}
},
"Log": {
"Description": "Logs a message to the flow log",
"Outputs": {

View File

@@ -1,25 +1,34 @@
namespace FileFlows.BasicNodes.Functions
using FileFlows.Plugin;
using FileFlows.Plugin.Attributes;
namespace FileFlows.BasicNodes.Functions;
/// <summary>
/// Flow element that moves process into another flow
/// </summary>
public class GotoFlow : Node
{
using FileFlows.Plugin;
using FileFlows.Plugin.Attributes;
/// <inheritdoc />
public override int Inputs => 1;
/// <inheritdoc />
public override int Outputs => 0;
/// <inheritdoc />
public override FlowElementType Type => FlowElementType.Logic;
/// <inheritdoc />
public override string HelpUrl => "https://fileflows.com/docs/plugins/basic-nodes/goto-flow";
/// <inheritdoc />
public override string Icon => "fas fa-sitemap";
/// <summary>
/// Gets or sets the flow to execute
/// </summary>
[Select("FLOW_LIST", 1)]
public ObjectReference Flow { get; set; }
public class GotoFlow : Node
/// <inheritdoc />
public override int Execute(NodeParameters args)
{
public override int Inputs => 1;
public override int Outputs => 0;
public override FlowElementType Type => FlowElementType.Logic;
public override string HelpUrl => "https://fileflows.com/docs/plugins/basic-nodes/goto-flow";
public override string Icon => "fas fa-sitemap";
[Select("FLOW_LIST", 1)]
public ObjectReference Flow { get; set; }
public override int Execute(NodeParameters args)
{
args.GotoFlow(Flow);
return 0;
}
args.GotoFlow(Flow);
return 0;
}
}
}

View File

@@ -0,0 +1,42 @@
using FileFlows.Plugin;
using FileFlows.Plugin.Attributes;
namespace FileFlows.BasicNodes.Functions;
/// <summary>
/// Flow element that moves a file for reprocessing
/// </summary>
public class Reprocess : Node
{
/// <inheritdoc />
public override int Inputs => 1;
/// <inheritdoc />
public override int Outputs => 0;
/// <inheritdoc />
public override FlowElementType Type => FlowElementType.Process;
/// <inheritdoc />
public override string HelpUrl => "https://fileflows.com/docs/plugins/basic-nodes/reprocess";
/// <inheritdoc />
public override string Icon => "fas fa-redo";
/// <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.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;
}
}

Binary file not shown.

Binary file not shown.