mirror of
https://github.com/revenz/FileFlowsPlugins.git
synced 2026-01-06 03:59:32 -06:00
FF-420 - added fail flow
This commit is contained in:
@@ -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": {
|
||||
|
||||
37
BasicNodes/Functions/FailFlow.cs
Normal file
37
BasicNodes/Functions/FailFlow.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user