This simple example script will open an Internet Explorer window and use it to display any message you write to it. It is very simple to use. The messages use different coloring scheme to distinguish regular information messages from warnings and errors.
Compatible with OptiBPM version 6.x and higher.
The existing application interface supports displaying messages in the "Notification Window" of the Layout Designer. However, in Simulators only simulation specific messages are displayed, any others are being discarded.
This example script will open an Internet Explorer window and use it to display any message you write to it. The messages will be displayed from within the Layout Designer or Simulators. The messages use different coloring scheme to distinguish regular info messages from warnings and errors.
· There might be several seconds delay at the beginning of the script execution. It is caused by Internet Explorer initialization process. Its blank window will open, wait for a few seconds, and then all the messages written out to it will display at once. After that all the messages will be displayed as soon as they are written out without delays.
· Internet Explorer window will be opened when the result file is opened in the Analyzer, since Analyzer also executes the script.
The purpose of this example is to demonstrate message display capabilities of this simple VB script. It executes the same simulation several times within a single iteration loop, displaying information on progress of iterations.
Simply load the provided example project file into the Layout Designer and start simulations. Make sure that the “Simulate Using Script” option of “Simulation Parameters” dialog window is selected.
The overall effort to implement demonstrated functionality in your project is minimal. It consists of the following steps:
· Copy the VB Script code from the provided example to your project.
· Adjust the iteration loops to match your needs. You can add scanning of parameter values to the script.
· Adjust the displayed messages. You can display current values of the scanned parameters.
· Save the file and run simulations
Most of the technical details, like opening the Internet Explorer window, displaying the messages, etc. have been encapsulated within the VBC_IEMessageWindow_BPM6x class. You don’t need to be familiar with these. Once you copy the class code to your project, you will be able to use it right away.
Simply follow these instructions:
· Copy the definition of VBC_IEMessageWindow_BPM6x class to your script. You can find the class code on the bottom of the VB script example, below the “--- End of main program” comment.
· Create an instance of the class by adding the following code at the beginning of your script:
Set aMessageWindow = new VBC_IEMessageWindow_BPM6x
· Call “VBC_IEMessageWindow_BPM6x” functions to output the text to the Internet Explorer window like this:
aMessageWindow.WriteMessage( “WriteMessage writes text in is black” )
aMessageWindow.WriteWarning( “WriteWarning writes text in orange” )
aMessageWindow.WriteError( “WriteError outputs text in red” )
VB Script text file
Layout Designer project file example