Skip to content

Hello World Example ​

This page goes through a simple "Hello World" example in ADOxx.

Introduction ​

This example produces a simple modelling tool which allows to create two types of objects ("Hello" and "World") and relations to connect the objects. The desired result for a modelling tool should look something like:
Example Hello World Modelling Toolkit

The general approach in this case is:

  1. Create a library.
  2. Create the relevant classes and configure their details.
  3. Specify a model type.

All of the steps are performed in the Development Toolkit, so start the Development Toolkit and log in with the Admin user before continuing.

Create Hello World Library ​

Application Libraries are not created from scratch. Instead they are created as a copy from an existing one. This can be achieved with the following steps:

  1. Select the Library management component icon Library management component in the Development Toolkit.
  2. Select Libraries -> Management... in the menu or the Management icon Management icon in the quick access bar.
  3. Select the "ADOxx ... OMiLAB Starting Library ...".
  4. Select the Create copy... button.
  5. When prompted enter a new name for the three libraries and select OK:
    • Application library name: Hello World
    • Dynamic library name: Hello World (Dynamic)
    • Static library name: Hello World (Static)
  6. Confirm the pop-up dialog.
  7. Close the Library Management dialog.

How to create an Application Library copy in the Development Toolkit

For more details on application libraries see the Application Library page.

Create Hello World Classes ​

Creating and configuring classes is achieved through the class-hierarchy dialog in ADOxx.

Open the Class-Hierarchy ​

First it is necessary to open the class-hierarchy dialog for the library:

  1. Select the Library management component icon Library management component in the Development Toolkit.
  2. Select Libraries -> Settings... in the menu or the Settings icon Settings icon in the quick access bar.
  3. Open the "Hello World" library by selecting the Expand hierarchy icon next to it and select the "Hello World (Dynamic)" library.
  4. Select the Class hierarchy... button.
  5. Under View activate both Metamodel and Class hierarchy.
  6. Open the __D-construct__ class by selecting the Expand hierarchy icon next to it.

How to create a new user for ADOxx

Create Hello and World Classes ​

Create the two classes through the class-hierarchy dialog:

  1. Select the __D-construct__ class.
  2. Select New -> New class... on the right side of the dialog.
  3. Enter Hello as the class name. __D-construct__ should be listed under Superclass.
  4. Select Ok.
  5. Select the __D-construct__ class again.
  6. Select New -> New class... on the right side of the dialog.
  7. Enter World as the class name. __D-construct__ should be listed under Superclass.
  8. Select Ok.

How to create the  class

For more details on classes see the classes page.

Specify Hello and World Notations ​

For the classes to be visible it is necessary to specify their graphical representation, which is achieved through the class-hierarchy dialog:

  1. Open the Hello class by selecting the Expand hierarchy icon next to it.
  2. Double click on the GraphRep attribute underneath the Hello class.
  3. Enter the following value for Standard value:
    leo
    GRAPHREP
    RECTANGLE x:-1.5cm y:-1cm w:3cm h:2cm
    TEXT "Hello" w:c h:c
  4. Select Close
  5. Open the World class by selecting the Expand hierarchy icon next to it.
  6. Double click on the GraphRep attribute underneath the World class.
  7. Enter the following value for Standard value:
    leo
    GRAPHREP
    RECTANGLE x:-1.5cm y:-1cm w:3cm h:2cm
    TEXT "World" w:c h:c
  8. Select Close

How to open and show the GraphRep attribute of the  class
Modify the GraphRep attribute of the  class

Selecting the correct GraphRep attribute

Be careful to select the right GraphRep attribute: The attributes at the end of the list belong to __D-construct__, not World! Use the lines coming from the icons of the attribute to determine what class they belong to.

For more details on the notation of classes see the the special attribute GraphRep.

Create HelloAnything Relation Class ​

To create a relation class perform the following steps in the class-hierarchy dialog:

  1. Select Relation classes at the bottom of the class-hierarchy dialog.
  2. Select New -> New relationclass... on the right side of the dialog.
  3. Enter HelloAnything as the class name.
  4. For from-class select Hello and for to-class select __D-construct__.
  5. Select Ok

How to create the  relation class

For more details on classes see the classes page.

Specify HelloAnything Notations ​

Relation classes have a default notation that is used if none is specified. The default notation is a thin black line, which is also the desired notation for the example.

The notation could be changed similar to the Hello and World classes by editing the GraphRep attribute.

Save Changes to Class-Hierarchy ​

Change are not stored until they are explicitly saved. To save changes in the class-hierarchy simply select the Save button. This will perform checks and inform about any issues that were encountered. Afterwards a dialog asks whether the changes shall be saved. Select Yes to save the changes. After saving the library close the class-hierarchy dialog by selecting Close.

How to save changes to the class-hierarchy

When closing the class-hierarchy dialog via the Close button you also get the option to save or discard any changes after the dialog is closed.

Specify Hello World Model Type ​

Creating and configuring model types is handled through the Modi library attribute. Library attributes are accessible through the Library settings dialog. If it has been accidentally closed, then it can be opened again by following the steps:

  1. Select the Library management component icon Library management component in the Development Toolkit.
  2. Select Libraries -> Settings... in the menu or the Settings icon Settings icon in the quick access bar.

To specify the model type:

  1. Open the "Hello World" library if necessary by selecting the Expand hierarchy icon next to it and select the "Hello World (Dynamic)" library.
  2. Select the Library attributes... button.
  3. Select the Add-ons tab.
  4. Set the value of the Modi attribute to:
    leo
    GENERAL order-of-classes:custom
    
    MODELTYPE "Hello World"
    INCL "Hello"
    INCL "World"
    INCL "HelloAnything"
  5. Select Apply at the bottom.
  6. When prompted whether the changed attribute values should be saved confirm with Yes.

How to create a new user for ADOxx

Check the Result ​

The result from the changes to the library can be now used in the Modelling Toolkit. However, to see the result in the Modelling Toolkit it is first necessary to create an ADOxx user which has the library assigned.

Create Hello World User ​

To create a user for testing the Hello World library perform these steps in the Development Toolkit:

  1. If the Library management dialog is still open, then close it by selecting Close.
  2. Select the User management icon User management component.
  3. Select User -> User list... in the menu or the User list icon User list icon in the quick access bar to open the User management - User list window.
  4. Select Add... to create a new user.
  5. Enter hello for the User name, Password and Confirm password.
  6. For the Application library select Hello World.
  7. Select the User group... button on the right side.
  8. Clicking the small User group unassigned icon icon to the left of the ADOxx user group. It should show an User group assigned icon icon with a small green checkmark.
  9. Confirm all the windows to close them (OK, Add, Close, Close).

How to create a new user for ADOxx

Every ADOxx user is assigned to one specific Application Library which is loaded when logging into the Modelling Toolkit.

Create a Hello World Model ​

After a user has been created and assigned to the library the first Hello World model can be created by:

  1. Start the Modelling Toolkit and log in the User name hello and Password also hello.
  2. Select Model -> New... in the menu.
  3. Enter the details for the new model:
    • Select Hello World for the Model type.
    • Enter Hello World Model for the Name.
    • Select the Models item in the Model group list.
  4. Select Create.

How to create a new model in the Modelling Toolkit

Add Objects to Model ​

To add Hello and World objects and HelloAnything relations to the model follow the steps in the Modelling Toolkit:

  1. If the model is not yet opened, then open the model by double clicking on its name in the Explorer.
  2. Select in the Modelling bar a class for which to create objects.
  3. Click on the drawing area to create an object at the position.
    • An object is created for each click until the right mouse button is selected.
    • For relations / connectors first select the source object of the connector and then the target object.
  4. Switch to a different class in the Modelling bar and repeat step 3.
  5. Right-click or select the mouse-cursor icon mouse-cursor icon in the Modelling bar to switch back to Edit mode, where existing objects can be moved, edited etc.

How to add objects to a model in the Modelling Toolkit

Where to Continue ​

The documentation is mainly structured to be read in the order of pages in the list on the left. There are however some pages that could be focused on:

The chapters for ADOxx Components, ADOxx Development Languages, Special Cases and Troubleshooting are more of a reference guide to check specific details on those topics. The same is true for the AdoScript Reference.