Plug-in assemblies: Difference between revisions
No edit summary |
|||
| Line 54: | Line 54: | ||
=== 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 == | |||
navigate to the Processes | |||
navigateprocesses.png | |||
Add new | |||
Select Workflow/Job | |||
if your plugin has return value, it is necessary to add variable of this type to the editor, then you are able to select plugin | |||
callplugin.png | |||
5. Logs | |||
-when Process was executed, its logs are saved and visible on the Resco Cloud -> Logs | |||
logsconsole.png | |||
logexample.png | |||
[[Category:Resco Cloud]] | [[Category:Resco Cloud]] | ||
Revision as of 09:31, 13 April 2021
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.
Creating a plug-in assembly
- Download Resco SDK.
Sample projects are part of the RescoCRM.Plugin.SDK.zip file. - Create a new project as a Class Library (.NET Framework 4.6.2).
- Add a reference to the downloaded XRMServer.Core.dll.


- Implement the PluginBase interface.

Return value of plugin
You can define the return value of your plugin.
Implement the IPluginReturnValue interface to the code (e.g. string):
These are the allowed return types: It should be possible to create a variable of this type in Processes editor.
Input values of plugin
You can define the input values of your plugin.
The name of the PluginInputParameter (MyPluginInput in the example), will be visible in the Processes editor.
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
Create
Update
Delete
Adding Plug-in Assembly to the Resco Cloud
In the development tool:
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).
Implementation of Plug-in Assembly
navigate to the Processes navigateprocesses.png Add new Select Workflow/Job if your plugin has return value, it is necessary to add variable of this type to the editor, then you are able to select plugin callplugin.png 5. Logs -when Process was executed, its logs are saved and visible on the Resco Cloud -> Logs logsconsole.png logexample.png

