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.
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.
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
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).