Script Automation in VB.NET Application

The company I work with offers data conversion as a service for new customers who previously used other similar software. I wrote a VB.NET application to automate common conversion operations and has separate logic between well-known providers. A specific file layout has become quite common, but due to the nature of how this particular participant application stores information, certain fields mean one for one client and another for another client.

Some elements in this manufacturer format change every time, so I wrote an application for the account for this. Since some data fields mean different things for different providers, I have to change my mapping code every time. This was not a problem when I had one of them every six months or so, but they are becoming more common and I would rather find a way to further automate this process.

I was thinking of introducing a simple interpreted scripting language that would allow me to save the conversion settings for the client in a text file, so I do not need to feed the settings in my application every time I run it. My goal is to spend time realizing this payout in faster conversions in the long run.

This is an example that I had in my head:

# this is a comment RECORD INCLUDE(source[Class] != 'I' && source[Category] != 99); FIELDMAP destination[name] == source[name]; desintation[address] == source[mailingaddress1]; ... END FIELDMAP BEGIN # logic goes here END 

I do not want to make it more complicated than necessary. I admit that I did not even look in the script, and I do not know where to start, or what other considerations need to be done.

Are there script libraries for .NET already that will do most of what I want? Is the script the wrong way? I really don't want to reinvent the wheel if there is a better way.

Thanks for any help. :)

+4
source share
2 answers

IronPython (one of the DLR languages ​​Jake refers to) is a .NET implementation of the Python scripting language. It allows you to access the .NET code (including the class classes and the class you wrote) and will be a great choice for this kind of task.

It has no real dependencies (other than the .NET Framework), and you don’t have to learn a lot of the many Python-specific syntax to get the job done.

(If you decide to go with IronPython, I recommend using Notepad ++ as your editor.)

+2
source

Instead of writing a custom language, you can insert any of the DLR languages (IronPython, IronRuby or JScript), or you can use the compiler services to compile VB.NET from your application.

Another idea ... if you only need to change the mappings between variable names, perhaps you could just come up with a small XML file that defines the mappings.

+1
source

All Articles