Create & Delete Workbench Instances

This topic explains how to create and delete a workbench instance for any Class in your model, for which a script has been built and executed.

The Workbench supports the following workbench platforms:

·Microsoft .NET (version 2.0 or later) excluding native C++, C and VB
·Java (JDK 1.4 or later)

The Execution Analysis script for the Package must have a debugger configured.

Access     Project Browser | Right-click on Class | Execution Analyzer | Create Workbench Instance of Class  (Ctrl+Shift+J)




See also

Naming the Workbench

Select the Create Workbench Instance of Class option

The Workbench dialog displays.


Type in a name for the new instance (for example, Catherine); each instance name must be unique for the workbench.



Choosing a Constructor

Click on the Create button

The following dialog displays:


Select the constructor from the drop-down list.

If you select a constructor with parameters, a set of fields displays in which you enter the value  for each parameter (see Enter Parameters, below).

If you do not define a constructor, or define a single constructor taking no parameters, go straight to the row entitled Invoke Workbench Instance.



Enter Parameters

In the dialog above, type any parameters required by the constructor:

·Literals as arguments
·Text:      abc or "abc" or "a b c"
·Numbers:    1 or 1.5
·Objects as arguments
If an argument is not a literal then you can supply it in the list only if you have already created an instance of that type in the workbench; you do this by typing the name of the instance as the argument.
The debugger checks any name entered in an argument against its list of workbench instances, and substitutes that instance in the actual call to the method.
·Strings as arguments

 Surrounding strings with quotes is unnecessary as anything you type for a string argument becomes the value of the string; for example, the only time you should surround strings with quotes is in supplying elements of a string array, or where the string is equal to the name of an existing workbench instance.

         "A b c"

         "a b $ % 6 4"

         A b c d

         As 5 7 ) 2 === 4

·Arrays as arguments

 Enter the elements that compose the array, separated by commas:

         Type                Arguments

         String(  )        one,two,three,"a book","a bigger book"

         CPerson(  )        Tom,Dick,Harry


If you enter text that matches the name of an existing instance, surround it in quotes to avoid the debugger passing the instance rather than a string.




Invoke Workbench Instance

Click on the Invoke button to commit the workbench instance.

The instance then displays in the Workbench window, showing the variables of the instance in a hierarchy of the type and value of the instance and of any members.



Delete Workbench Instances

You can delete instances using the Delete shortcut menu on any instance on the Workbench.

If all instances are deleted, the debugger is shut down and the Workbench window is closed.



Learning Center topics

·(Alt+F1) | Enterprise Architect | Execution Analysis | Object Workbench | Creating Variables