andy vt's tools & blog

automating lazy

This Blog


andy vt's blog

Creating Custom Actions for DVRMSToolbox

In DVRMSToolbox profiles are pipelines made up of a series of actions where continuation to the next stage in the pipeline is dependant on the success of the previous stage. Actions are atomic units of work that will be performed on the file as it makes it's way through the pipeline. The diagram below demonstrates this model.

The tool includes several actions out of the box, but also allows a degree of extensibilty. Because of this, it is easy for anyone [who can program] to create their own actions.

There are a couple guidelines that every action must follow. They must inherit from Durrant.Common.BaseAction, and they must be marked as serializable.

As I stated earlier, profiles are collections of actions, they actually work by specifing a set of objects that all inherit from BaseAction, setting properties on those classes, then serializing the collection, with the objects, into a binary file which can later be loaded and used to process the file.

To start, open up VS.NET 2003 and create a new class library project called "SampleAction". Delete the Class1.cs (or vb) file, and replace it with a new class "HelloWorld.cs". Now add a reference to Durrant.Common.dll, modify the class to inherit from BaseAction, mark it as Serializable, and override GetDescription, and Process so it looks like the image below. Note that this.Success is set to true before leaving Process. BaseAction.Success is the property used by the pipeline engine to determine if it should continue to the next action.

Build the project, and copy "SampleAction.dll" to the DVRMSToolbox installed directory (C:\Program Files\DvrmsToolbox for e.g.). Open up DVRMSToolboxSettings.exe, and click New Profile to create a new profile. Give the profile a name and description, then click Add.

Select the new action from the list, then click Select.

Click OK on the Configure dialog. Note that the bool property WriteDate is displayed, and can be checked/unchecked.

Click Save, and you're done. The profile can now be called like any other profile.

This is an example of a very simple action, I've included another action in the project that does something much more interesting (it will run a custom graph against a file).


No Comments
@2008 andy vt
Powered by Community Server (Non-Commercial Edition), by Telligent Systems