Difference between revisions of "Plug-in assemblies"

From Resco's Wiki
Jump to: navigation, search
(Created page with "This document is a brief summary of '''plug-in assemblies''' in Resco Cloud and their implementation to the processes (workflows). == Getting started == Plug-in assembli...")
 
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
{{Logic TOC}}
 
This document is a brief summary of '''plug-in assemblies''' in [[Resco Cloud]] and their implementation to the processes (workflows).
 
This document is a brief summary of '''plug-in assemblies''' in [[Resco Cloud]] and their implementation to the processes (workflows).
  
Line 8: Line 9:
 
* communication with some third party system
 
* communication with some third party system
 
* etc.
 
* etc.
 +
 +
In [[Resco Cloud]], you can manage plugins using the [[Admin Console]].
  
 
== Creating a plug-in assembly ==
 
== Creating a plug-in assembly ==
Line 16: Line 19:
 
# Implement the PluginBase interface.<br>[[File:PluginBase interface.png|600px]]
 
# Implement the PluginBase interface.<br>[[File:PluginBase interface.png|600px]]
  
== Return value of plugin ==
+
=== Return value of plugin ===
  
 
You can define the return value of your plugin.
 
You can define the return value of your plugin.
Line 28: Line 31:
 
[[File:Allowed return type.png]]
 
[[File:Allowed return type.png]]
  
== Input values of plugin ==
+
=== Input values of plugin ===
  
 
You can define the input values of your plugin.
 
You can define the input values of your plugin.
Line 38: Line 41:
 
[[File:MyPluginInput.png]]
 
[[File:MyPluginInput.png]]
  
== Logs ==
+
=== Logs ===
  
 
<syntaxhighlight lang="c#">
 
<syntaxhighlight lang="c#">
Line 46: Line 49:
 
Logs are saved and visible in the Admin Console under '''Processes Center > Logs'''.
 
Logs are saved and visible in the Admin Console under '''Processes Center > Logs'''.
  
== Cancel the workflow execution ==
+
=== Cancel the workflow execution ===
  
 
<syntaxhighlight lang="c#">
 
<syntaxhighlight lang="c#">
Line 53: Line 56:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
== Examples ==
+
=== Examples ===
 +
 
 +
Fetch
 +
 
 +
[[File:Example-fetch.png|600px]]
 +
 
 +
Create
 +
 
 +
[[File:Example-create.png|600px]]
 +
 
 +
Update
 +
 
 +
[[File:Example-update.png|600px]]
 +
 
 +
Delete
 +
 
 +
[[File:Example-delete.png|600px]]
 +
 
 +
== Adding plug-in assembly to the Resco Cloud ==
 +
 
 +
In the development tool:
 +
# Build the solution.<br>[[File:Build solution.png|600px]]
 +
# Create the zip file with the dll file.<br>[[File:Create zip.png|600px]]
 +
 
 +
In the Admin Console:
 +
# Go to '''Processes Center > Plug-in Assemblies'''.
 +
# Click '''New''', then click '''Browse''' and upload the zip file.
 +
 
 +
The plugin is loaded and the return type and input parameters listed below (if implemented).
 +
 
 +
[[File:Plugin successfully loaded.png|600px]]
 +
 
 +
== Implementation of plug-in assembly ==
 +
 
 +
# In the Admin Console, go to '''Processes Center > Processes'''.
 +
# Click '''New''' to create a new process.
 +
# As '''Category''', select Workflow or Job.
 +
# If your plugin has return value, it is necessary to add the variable of this type to the editor, then you are able to select the plugin.
 +
 
 +
[[File:Process using the demo plugin.png|600px]]
 +
 
 +
== Logs ==
 +
 
 +
Whenever a process is executed, the run generates a log file entry. To access the logs, go to '''Processes Center > Logs'''.
 +
 
 +
[[File:Process log.png|600px]]
 +
 
 +
 
 +
[[Category:Resco Cloud]]

Latest revision as of 09:32, 23 July 2021

Business logic
Client-side

Server-side

This document is a brief summary of plug-in assemblies in Resco Cloud and their implementation to the processes (workflows).

Getting started

Plug-in assemblies allow you to run custom C# code on the Resco Cloud as part of the Processes. Plugins can run periodically as jobs or be triggered as workflows. It should solve the limitations of the no-coding editor of processes. There are the typical use cases:

  • complex logic of process
  • communication with some third party system
  • etc.

In Resco Cloud, you can manage plugins using the Admin Console.

Creating a plug-in assembly

  1. Download Resco SDK.
    Sample projects are part of the RescoCRM.Plugin.SDK.zip file.
  2. Create a new project as a Class Library (.NET Framework 4.6.2).
  3. Add a reference to the downloaded XRMServer.Core.dll.
    Add reference to dll.png
    Add reference to dll 2.png
  4. Implement the PluginBase interface.
    PluginBase interface.png

Return value of plugin

You can define the return value of your plugin.

Implement the IPluginReturnValue interface to the code (e.g. string):

IPluginReturnValue.png

These are the allowed return types: It should be possible to create a variable of this type in Processes editor.

Allowed return type.png

Input values of plugin

You can define the input values of your plugin.

Input values.png

The name of the PluginInputParameter (MyPluginInput in the example), will be visible in the Processes editor.

MyPluginInput.png

Logs

context.AppendLogLine("Contacts with specified account id '{0}' cannot be found!", accountId);

Logs are saved and visible in the Admin Console under Processes Center > Logs.

Cancel the workflow execution

context.AppendLogLine("Contacts with specified account id '{0}' cannot be found!", accountId);
return PluginResult.Failed;

Examples

Fetch

Example-fetch.png

Create

Example-create.png

Update

Example-update.png

Delete

Example-delete.png

Adding plug-in assembly to the Resco Cloud

In the development tool:

  1. Build the solution.
    Build solution.png
  2. Create the zip file with the dll file.
    Create zip.png

In the Admin Console:

  1. Go to Processes Center > Plug-in Assemblies.
  2. Click New, then click Browse and upload the zip file.

The plugin is loaded and the return type and input parameters listed below (if implemented).

Plugin successfully loaded.png

Implementation of plug-in assembly

  1. In the Admin Console, go to Processes Center > Processes.
  2. Click New to create a new process.
  3. As Category, select Workflow or Job.
  4. If your plugin has return value, it is necessary to add the variable of this type to the editor, then you are able to select the plugin.

Process using the demo plugin.png

Logs

Whenever a process is executed, the run generates a log file entry. To access the logs, go to Processes Center > Logs.

Process log.png