|
|
Script Studio
The Envox Studio is a cool application because it is highly scriptable... or should
I say: easily scriptable. What give Envox a slight competitive advantage over other
IVR vendors are its cool 4GL scripting environment.
Building a scriptEnvox Studio uses a 4GL environment based entirely on drag'n'drop and GUI operations. You drag action blocks down to the script view. Each action block executes a simple command, such as "Assign value to Variable" or "Play .wav file".
Each script starts with a Each action block also has a Property Sheet, where you can configure the action's internal setup. For instance, the "Set Variable" block (which assigns values to variables) provides a list in its Property Pages, where you can define which variables that get which values. Likewise, in the "Play Menu" action's Property Pages you can browse which wave (sound) file to play when the action is executed, and so on. The script doesn't support the concept of functions (not in the version of Envox I used, anyway) - it does however add a kind of sub-routines. The "User-Block" allows you to build sub-scripts. By double-clicking on a User-Block, you navigate into the sub-script and can refine actions in deeper and deeper script levels. Consider the following script:
Cool, isn't it? After dragging all your actions to the screen, you can compile the script. This produces the Runtime version, which is a binary representation of the code (or the code in a format that is translatable by the core application). During the compile phase, the script is also validated for errors, missing or unattached links, etc. Of course you don't want to build huge scripts/applications in this language, but listing the feature set of the Envox Studio, you can't help to get excited.
There are lots of products that could benefit from adding scripting capabilities. Wouldn't it be nice to be able to add custom scripts to your router, firewall, ICQ or P2P client? The power of this type of scripting is that anyone can learn how to use it. Dragging boxes down on a window is simply something any non-programmer will be able to grasp - so once the concept of variables has settled in, anyone will be able to add their own scripts! My sampleThe sample presented here is an attempt to build a similar 4GL design environment. It's an experiment to see how difficult it would be to replicate a user-friendly drag'n'drop, click-this-click-that design user interface: To see if it's possible, with relatively little effort, to write up a GUI control that manages all the ickyness of drag'n'drop and comfy user interactions.
And that is excatly what this sample does. It implements a GUI control in the WTL
framework that draws the little boxes and arrows. The GUI control takes care
of displaying a view, where the user can drag and move boxes around.
So the sample demonstrates how a 4GL scripting environment could be built. It only implements parts of the UI functionality of the Envox Studio application. The version presented here is from the stage where the GUI controls were being tested and before the real runtime implementation was added. This means that it does not compile or validate an actual script or runtime code. In addition, no support for Property Pages or variables, search functions, logging and reporting has been added. It may seem a little odd because the missing functions are vital for a real development test, but the sample was built solely for the purpose of testing the GUI part. Global RoutingDid you notice the neatly scattered links connecting the nodes in the script? Believe it or not, this was actually the most tricky part of the sample. I spent almost 3 days searching on Google™ to find a "human readable" explanation of how this could be done. There're tons of material/papers explaining this stuff and most of them are in incomprehensible math-language no mortal can understand. A lot of work is done in the field of Global Routing, since computer chip design depends heavily on these techniques. In the end I discarded most of the advanced equations babbeling about interactive orthogonal routing, and went back to basics...
What you see is an enhanced version of Lee's Algorithm. This is a common algorithm
used for finding the shortest path between two points given several obstacles.
Code Features
Source Code DependenciesMicrosoft Visual C++ 6.0Microsoft WTL 7.1 Library Download Files
Article submitted 8/23/2004. To the top
|
|||