Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Excerpt

Base class from which Custom Nodes derive and define behavior.


Code Block
public abstract class CustomNode

Example

The following example defines an ExampleNode class that implements a Run method which gets a first name and last name from a Process' properties, and sets a full name to a third "Full Name" property.

Code Block
public class ExampleNode : CustomNode 
{
    public override void Run()
    {
        var firstName = Process.Properties.GetSingleValue("First Name");
        var lastName = Process.Properties.GetSingleValue("Last Name");
        var fullName = $"{firstName} {lastName}";
        Process.Properties.SetSingleProperty("Full Name", fullName);
    }
}

Remarks

In order for your custom node to execute code during engine runtime, a class must be created that successfully inherits and implements either the CustomNode class, or the ActionNode or CaptureNode class that corresponds with the workflow type in which your node is placed. 

Since the CustomNode class is product agnostic, the classes and helpers available on it are defined as tthe base, product agnostic classes as well. However, at runtime, the classes provided to these properties can be casted to their derived types, like so: 

Code Block
public class ExampleNode : CustomNode
{
    public override void Run()
    {
        if (Process is CaptureProcess captureProcess)
            captureProcess.Document.ClearPages();
    }
}

If you are designing a custom import node that defines a CaptureImporter or ActionImporter class, defining a node class within your assembly is optional, and will run on the processes created from your custom import methods.

The NodeDirectory field refers to a folder containing the files within the .s9n file executing on the process. This folder exists only as long as the specific process is executing the custom node, and is deleted when the Custom Node is finished.

If a CustomNode class is defined and a Run method is implemented on a Custom Import node, the code within the Run method will execute independently on every process spawned as a result of the Import Method (ActionImporter) or Import Method (CaptureImporter). Utilize this pattern to save space when a custom importer must perform actions specific to the processes it creates.

Properties

Insert excerpt
DEV:database class
DEV:database class
nopaneltrue

Insert excerpt
CN:Engine ClassCN:
Engine Class
nopaneltrue

Insert excerpt
CN:Process ClassCN:
Process Class
nopaneltrue

Insert excerpt
CN:Setting ClassCN:
Setting Class
nopaneltrue

Dictionary<string, string> Links 

List of available node links. You can move along these links by calling the SetNextNodeByLinkName function.

string NodeDirectory

Path to the directory containing files extracted from the custom node.

dynamic Workflow

Dynamic object containing the executing workflow. Changes made to this object will not be saved.

Methods

Insert excerpt
CN:Run MethodCN:
Run Method
nopaneltrue

Insert excerpt
CN:SetNextNodeByLinkName MethodCN:
SetNextNodeByLinkName Method
nopaneltrue

Insert excerpt
CN:SetNextNodeByNodeName MethodCN:
SetNextNodeByNodeName Method
nopaneltrue

Insert excerpt
CN:LoadConfig MethodCN:
LoadConfig Method
nopaneltrue

Insert excerpt
CN:LogHistory MethodCN:
LogHistory Method
nopaneltrue