mirror of
https://github.com/revenz/FileFlowsPlugins.git
synced 2026-02-13 03:28:33 -06:00
FF-1241 - added new flow element reprocess
This commit is contained in:
@@ -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": {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
42
BasicNodes/Functions/Reprocess.cs
Normal file
42
BasicNodes/Functions/Reprocess.cs
Normal 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.
Reference in New Issue
Block a user