FF-420 - added fail flow

This commit is contained in:
reven
2023-04-16 08:48:00 +12:00
parent d2c68d8b6a
commit 664774c4f7
2 changed files with 40 additions and 0 deletions

View File

@@ -109,6 +109,9 @@
"FileName-Help": "If left blank the current working file will be deleted, or folder if library is folder based."
}
},
"FailFlow": {
"Description": "Fails a flow immediately, useful if you want a certain path to just fail."
},
"FileSize": {
"Description": "Checks if the file size matches the configured parameters. The values are in megabytes.\n\nOutput 1: Matches\nOutput 2: Does not match",
"Outputs": {

View File

@@ -0,0 +1,37 @@
using FileFlows.Plugin;
namespace FileFlows.BasicNodes.Functions;
/// <summary>
/// A node that simply fails a flow
/// </summary>
public class FailFlow : Node
{
/// <summary>
/// Gets the number of input nodes
/// </summary>
public override int Inputs => 1;
/// <summary>
/// Gets the type of node
/// </summary>
public override FlowElementType Type => FlowElementType.Logic;
/// <summary>
/// Gets the icon of the flow
/// </summary>
public override string Icon => "fas fa-exclamation-triangle";
/// <summary>
/// Gets the URL for the help page
/// </summary>
public override string HelpUrl => "https://docs.fileflows.com/plugins/basic-nodes/fail-flow";
/// <summary>
/// Executes the node
/// </summary>
/// <param name="args">the node parameters</param>
/// <returns>-1 to indicate the flow should fail</returns>
public override int Execute(NodeParameters args)
{
args.Logger.ILog("Failing flow");
return -1;
}
}