2.5 The DotNet DLL Source

In this video we show you how to connect to a source using the DotNet DLL connector inside Warewolf.

 

The DotNet DLL Connector can be used to expose public methods in a DLL, connect to a specific method or single item from a source like a database or website.

1. Start by Creating a New Service.

2. Search the Tool Box until you find the Resources category. Drag the DotNet DLL tool onto the design surface and connect it to the Start node.

3. Click the New button to Create a New Connection to the Plugin.

4. There are two options in the New DotNet Plugin Source window:

  • Enter the path of the DLL that you want to use by typing in the Assembly textbox, or
  • Load a DLL from the Global Assemble Cache (the GAC)

5. We are going to load a DLL from the GAC. Click on the ellipses […] to select a GAC assembly.

6. Type MSCORLIB into the filter textbox at the top. Click on the first GAC in the list as there may be more than one and click Select.

7. Save your new plugin source as MSCORLIB using the Save button in the left hand menu.

8. Navigate back to your service and open the DotNet DLL Connector by double clicking the blank area at the top of the tool.

9. From the Source drop down select MSCORLIB.

10. From the ClassName drop down scroll through the namespaces and select System.Random.

11. You will notice that there are two fields, Constructor and Action. The Constructor prepares the new object for use and the Action is the method or procedure associated with a message and an object. The constructor is defaulted to .ctor.

12. We now need to name the Object in which we would like the output to go into. Type [[@myObject]] into the Object Name field.

13. To select an Action, expand to full view by clicking the word “Action”. Now click on the dropdown list and select the first Next.

14. Name the Output Variable [[RandomNumber]].

15. To select another action, go to the second Action, click on the second Next in the dropdown list. This Action will select a random number in the range of 1-10. Change the [[minValue]] to 1 and the  [[maxValue]] to 10.  Name the Output Variable [[RangeofNumbers]].

16. You will notice that your Variables and Object have been automatically populated for you in the Variables List. You can remove the Variables that are no longer relevant.  (minValue, maxValue)

17. It’s now time to run this source. Click Done and then click Debug. In the debug window, click Debug again.

18. In the Output window at the bottom right, you will find your output. Click the small expand arrows to see the expanded view. If you press F6 it will debug again and present different values for each action.

It’s as easy as that to use the DotNet DLL Source in Warewolf.

 

FacebookTwitterLinkedInGoogle+Email
Updated on July 19, 2017

Was this article helpful?

Related Articles