You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/_plugins/BasicNodes/index.md
+28-1Lines changed: 28 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,4 +4,31 @@ layout: default
4
4
description: Index file for Basic nodes that provide the basic functionality to FileFlows
5
5
---
6
6
7
-
These are basic file processing nodes
7
+
Basic Nodes are core nodes and provide basic functionality to a flow
8
+
9
+
Including
10
+
* Input File
11
+
* A basic input file node which is a starting point of a flow
12
+
* Copy File
13
+
* Copies a file to another location
14
+
* Delete Source Directory
15
+
* Deletes the source directory of the file being processed. Include options to only delete if empty
16
+
* Move File
17
+
* Moves a file to another location
18
+
* File Extension
19
+
* Logical node that can test if a file has a particular extension
20
+
* File Size
21
+
* Logical node that cant test if a file is a certain file size
22
+
* Function
23
+
* A node that lets the user provide their own logic to test. This is a javascript code block
24
+
* Log
25
+
* Lets you log a message to the flow log
26
+
* Pattern Match
27
+
* Logical node that tests the working file and the original file against a regular expression. Uses a c# regular expression.
28
+
* Pattern Renamer
29
+
* Logical node that will replace text in the filename with using regular expressions or basic strings. You can specify multiple patterns to replace. For example
* Logical node that will rename the file. Can use variables using the '{' key to use variables from other nodes and also common variables.
33
+
* Replace Original
34
+
* Logical node that will replace the original file of the flow with the current working file. If the current working file has a different extension than the original, the working extension will be used, eg "MyFile.avi" will become "MyFile.mkv"
Copy file name to clipboardExpand all lines: docs/_plugins/BasicNodes/nodes/Function.md
+137-1Lines changed: 137 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,4 +5,140 @@ description: Node that executes javascript functions
5
5
plugin: Basic Nodes
6
6
---
7
7
8
-
This a test function thing
8
+
The function node allows you to use custom javascript code to process within the flow.
9
+
10
+
It can let you make decision paths based on previous nodes, compute variables for future nodes, log information, and many more features.
11
+
12
+
## Return codes
13
+
* Return 1+ to specify which output is to be called. Define the number of outputs using the "Outputs" fields. This will add more output connections to the node
14
+
* Return 0 to complete the flow successfully. This will immediately stop the flow and mark it as successful
15
+
* Return -1 to indicate an error and stop the flow. This will mark the flow as unsuccessful.
16
+
17
+
## Variables
18
+
It includes the "Variables" object which exposes variables from the flow. And you can set future variables for the flow in here
19
+
20
+
```js
21
+
Varabiles.MyFutureVariable='to be used in another flow node';
22
+
23
+
// an example of variables from a 'Video Input' node
24
+
let video =Variables.vi.VideoInfo.VideoStreams[0];
25
+
// or a safe way to get that incase any of those objects are null
26
+
let video =Variables.vi?.VideoInfo?.VideoStreams[0];
27
+
if(!video) return-1; // video was null
28
+
```
29
+
30
+
31
+
## Logging
32
+
The "Log" object lets you log messages to the flow log
33
+
```js
34
+
Logger.ILog('an information log message');
35
+
Logger.WLog('an warning log message');
36
+
Logger.ELog('an error log message');
37
+
Logger.DLog('an debug log message');
38
+
```
39
+
40
+
## Flow object
41
+
The "Flow" object lets you perform actions on the flow, it exposes helper methods to the code.
42
+
```js
43
+
// will create a directory if it does not already exist
44
+
// if it does exist this function simply returns
45
+
// its a safe way to ensure a directory exists
46
+
Flow.CreateDirectoryIfNotExists(path);
47
+
48
+
// return the size in bytes as a number
49
+
Flow.GetDirectorySize(path);
50
+
51
+
// gest/sets a parameter value with a given key
52
+
Flow.SetParameter(key, value);
53
+
Flow.GetParameter(key);
54
+
55
+
// maps a path to the local processing node
56
+
Flow.MapPath(path);
57
+
58
+
// moves the working file to the destination file
59
+
Flow.MoveFile(destination);
60
+
61
+
// this will reset the working file to the original File,
62
+
// this lets you effectively reprocess the original file.
63
+
// Useful if you want to perform multiple operations on the same file
64
+
Flow.ResetWorkingFile();
65
+
66
+
// Sets the current working file to the file passed in
67
+
// dont delete is a boolean that if true will not delete the current working file
68
+
// note: if the current working file is the original file, it will NEVER be deleted
69
+
Flow.SetWorkingFile(filename, dontDelete);
70
+
71
+
// returns a new GUID as string
72
+
Flow.NewGuid();
73
+
74
+
// the temporary path, property NOT a function
75
+
Flow.TempPath
76
+
77
+
// Get a toolpath from the toolname, the toolname is case insensitive
78
+
Flow.GetToolPath(toolname);
79
+
80
+
// Execute a process and capture the output
81
+
// you can use arguments for a string argument list, or argumentList which is an string array and will escape the arguments for you correctly
82
+
// timeout is optional, number of seconds to wait before killing the process
83
+
// returns ProcessResults
84
+
// Completed:bool; // if the process ran to completion or timedout/was canceled
85
+
// ExitCode:number; // the exit code of the process, may be null
86
+
// Output:string; // the output, if error output was detected this will contain that output
87
+
// StandardOutput: string; // the standard output from the process
88
+
// StandardError: string; // the standard error from the process if any
0 commit comments