Building Nodes
Flowgear Nodes are the building blocks of an integration. The Flowgear Nodes Test Harness makes it easy for developers to build and debug Nodes.
You will need
- Visual Studio 2022
Creating a Project
You can see a complete demo Node at https://github.com/Flowgear/flowgear-samples/blob/master/custom-nodes/DemoNode.
- Create a Class Library project in Visual Studio targeting .NET Framework 4.8. This will be the assembly that contains your Node (or Nodes).
- Create a second Console Application project in the same solution, it also needs to target .NET Framework 4.8
- Reference the Class library project in your Console Application project
- In your Class Library project, add a nuget reference to
Flowgear.Sdk
. To do this, locate the Package Manager Console in Visual Studio and enter the commandinstall-package Flowgear.Sdk
- Sign both projects. (You do not need to use your production certificate. Signing the projects up-front ensures that they can only reference signed assemblies).
- Add a 16x16 PNG to the Class Library, this will be the icon used to represent your Node. Set the
Build Action
toEmbedded Resource
- Create the structure of your Node using the template shown below
- In your Console Application, add the loader code shown below
- Set the Console Application to be the Startup Project for the Solution and launch the project
Harness Loader Code
Place the Harness reference code in the Main method of your C# Console Application project.
Example Node Class
Place the Custom Node reference code in its own class in a C# Console Application
See the Node code sample or see the complete sample Node
Special Node Features
Creating Samples
Samples cause the ListSamples
method to be invoked in the Node thereby allowing samples to be generated that are specific to the endpoint defined in the Connection. For details of how to implement this, refer to the ListSamples
method in the Node code sample.
Implementing support for OAuth2
Flowgear Nodes allow you to implement support for OAuth2 directly. Refer to the Interact
and refreshToken
methods in the Node code sample methods for further details.
Publishing Your Node
- In the Console, click
⚙ → Nodes
, then+
to publish your Node. - Select the Account you would like to publish the Node from and then point to a Zip archive of the binaries for the Node (typically, the contents of the
bin\Release
folder should be placed into a zip file). - Click
Submit
.
Once a Node has been uploaded, you can access it from the Nodes Pane where you will see an Owned
label against the Node.