RobotForce.Sophona.PluginConnector
1.0.18
dotnet add package RobotForce.Sophona.PluginConnector --version 1.0.18
NuGet\Install-Package RobotForce.Sophona.PluginConnector -Version 1.0.18
<PackageReference Include="RobotForce.Sophona.PluginConnector" Version="1.0.18" />
<PackageVersion Include="RobotForce.Sophona.PluginConnector" Version="1.0.18" />
<PackageReference Include="RobotForce.Sophona.PluginConnector" />
paket add RobotForce.Sophona.PluginConnector --version 1.0.18
#r "nuget: RobotForce.Sophona.PluginConnector, 1.0.18"
#:package RobotForce.Sophona.PluginConnector@1.0.18
#addin nuget:?package=RobotForce.Sophona.PluginConnector&version=1.0.18
#tool nuget:?package=RobotForce.Sophona.PluginConnector&version=1.0.18
Sophona Studio � Library Plugin Development Guide
This document explains how to build your own Instruction Block (Node) for Sophona Studio using RobotForceConnector.
The goal is to create a simple Hello World instruction:
- Text input field
- Dropdown field
- Output variable assignment
- Project Setup
Create a new Class Library project:
dotnet new classlib -n MyPlugin
Add reference to RobotForceConnector in your .csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <TargetFramework>net8.0</TargetFramework> </PropertyGroup>
<ItemGroup> <PackageReference Include="RobotForceConnector" Version="1.0.0" /> </ItemGroup>
</Project>
- Plugin Structure
Every plugin contains two main parts:
- Tile Configuration Class
- Commands Class (instructions implementation)
- Hello World � Full Example
3.1 Tile Configuration
using System; using System.Reflection; using RobotForceConnector; using static RobotForceConnector.RobotConnector;
namespace MyPlugin { public static class HelloWorld { public static string description = "Simple Hello World instruction";
private static string title = "Hello World";
private static ActionCategory[] category =
[
ActionCategory.System
];
public static string frontendHtml =
new InstructionConfig(
Type.GetType($"{MethodBase.GetCurrentMethod().DeclaringType.Namespace}.Commands")
.GetMethod(MethodBase.GetCurrentMethod().DeclaringType.Name),
category,
title,
description
).result;
}
}
3.2 Instruction Implementation
using System; using System.Threading.Tasks; using RobotForceConnector;
namespace MyPlugin { public partial class Commands : RobotConnector { [RobotInstruction] public Task<object> HelloWorld(
// Text input field
[RobotFieldConfig(
fieldType = typeof(string),
defaultValue = "World",
tooltip = "Text to greet"
)]
ScriptVariable name,
// Dropdown field
[RobotFieldConfig(
fieldType = typeof(string),
isDropdown = true,
dropdownArray = new string[] { "Console", "WorkflowVariable" },
defaultValue = "Console",
tooltip = "Where to send result"
)]
ScriptVariable outputMode,
// Output variable selector
[RobotFieldConfig(
fieldType = typeof(string),
isVariableDropdown = true,
tooltip = "Variable to store result"
)]
ScriptVariable outputVariable
)
{
try
{
string message = $"Hello {name.Value}!";
if (outputMode.Value.ToString() == "Console")
{
Console.WriteLine(message);
}
else
{
// Assign result into workflow variable
robotScriptState
.GetVariable(outputVariable.Name)
.Value = message;
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
return null;
}
}
}
- How Variables Work
All instruction parameters must be of type:
ScriptVariable
Read input value:
name.Value
Get workflow variable name:
outputVariable.Name
Assign value into workflow:
robotScriptState .GetVariable(outputVariable.Name) .Value = "Some result";
Important:
- Instructions do NOT return values via return
- Always assign outputs via robotScriptState
- All Available RobotFieldConfig Options
[RobotFieldConfig( fieldType = typeof(string), // Logical type defaultValue = "Default", // Default value tooltip = "Tooltip text", // Tooltip in UI
isDropdown = false, // Render dropdown
dropdownArray = new object[] {}, // Dropdown values
dropdownEnableCustomInput = false, // Allow custom dropdown input
isVariableDropdown = false, // Workflow variable selector
addIndicateOnScreenButton = false, // Adds "Indicate On Screen" button
addCustomButton = false, // Adds custom button
customButtonName = "Button", // Button label
customButtonJS = "console.log(value)"// JS executed on click
)]
- UI Field Types
UI field type is determined automatically:
- isVariableDropdown = true → workflow variable dropdown
- isDropdown = true → dropdown list
- addIndicateOnScreenButton → selector field
- none of above → text input
- Build and Deploy
Build project:
dotnet build -c Release
Take generated DLL from:
bin/Release/
Place DLL into Sophona Studio plugins folder.
Restart Sophona Studio.
Your instruction block will appear automatically.
Best Practices
- Always use ScriptVariable parameters
- Always provide tooltip text
- Always provide output variable
- Handle exceptions properly
- Keep instructions small and focused
Common Mistakes
- Missing [RobotInstruction]
- Commands class not inheriting RobotConnector
- Output not assigned into workflow variable
- Tile class name does not match method name
Result
After loading the plugin, Sophona Studio will display:
- Hello World tile
- Text input field
- Dropdown field
- Output variable selector
The instruction behaves like a native workflow block.
Happy building.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.AspNetCore.SignalR.Client (>= 10.0.5)
- Microsoft.CodeAnalysis.CSharp.Features (>= 4.7.0)
- Microsoft.CodeAnalysis.CSharp.Scripting (>= 4.7.0)
- Microsoft.CodeAnalysis.Scripting.Common (>= 4.7.0)
- Microsoft.CSharp (>= 4.7.0)
- Microsoft.Windows.Compatibility (>= 8.0.4)
- Newtonsoft.Json (>= 13.0.3)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.ValueTuple (>= 4.5.0)
NuGet packages (13)
Showing the top 5 NuGet packages that depend on RobotForce.Sophona.PluginConnector:
| Package | Downloads |
|---|---|
|
ShareFileInChatPlugin
Package Description |
|
|
RobotForce.SystemActions
Package Description |
|
|
RobotForce.UIAutomation
Package Description |
|
|
RobotForce.Excel
Package Description |
|
|
RobotForce.RESTAPI
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.