Skip to content

Toro Cloud Dev Center


Gloop Mapper view

The Mapper view, visible at the bottom of Martini by default, is used view and edit the map lines and set expressions of a map step or invoke step.

Mapper view not visible?

If you want to display the Mapper view in Martini Desktop, go to the application menu Window > Show View > Mapper. Alternatively, you can use the shortcut .

View layout

The Mapper view has two different layouts; which gets chosen is dependent on the currently selected step.

For map steps, the view is divided such that it contains the following components (described from left to right):

  • The input model tree, which shows all the input properties available to the step
  • The canvas displaying the map lines between the input and output model tree
  • The output model tree, which shows all the output properties available at that step

Mapper view layout for map steps

Mapper view layout for map steps

For invoke steps, the view is divided such that it contains the following components (described from left to right):

  • The input model tree, which shows all the input properties available to the step
  • The canvas displaying the input map lines
  • The invoke step input model tree, which shows all the input properties of the invoke step
  • The invoke step output model tree, which shows all the output properties of the invoke step
  • The canvas displaying the output map lines
  • The output model tree, which shows all the output properties available to the step

Mapper view layout for invoke steps

Mapper view layout for invoke steps

Asynchronous invoke step

If an invoke step is configured to run asynchronously, only the input side of the Mapper will be visible.

Mapping

Mapping a property to another is very straight forward.

Mapping a property to another

Mapping a property to another

  1. Select a property in the model tree.
  2. Drag it over another property in the opposite model tree; a map line following the mouse will be visible
  3. Drop it on the other propery and then a map line is created

Illegal mappings

Certain model property types can only be mapped to strings, objects, or other model property types. In any case, Martini will display an error message when attempting to do an illegal mapping.

Multi-mapping

It is possible to map multiple properties at once. To do so, select all properties from the output model tree and then drag them to the opposite model tree and drop them; multiple map lines will be created.

Mapping multiple properties in Martini Desktop

Mapping multiple properties in Martini Online

Map and create a property in one swipe

It is possible to map and create a property in one move. You can do this by selecting a property, and then dragging it to the opposite model tree while pressing . The created property will either be at the input or output model of the service.

Adding a property and mapping

You can also map and declare using the context menu; just right-click a property then select Add Property and Map.

To make things easier and quicker for you, you can also map properties via content-assist. You can do this either in the Mapper view or the step editor.

When mapping properties via the step editor, you must:

Mapping a property using content-assist in Mapper

Mapping a property using content-assist in Mapper

  1. Select a map step or invoke step in the step tree.
  2. Press the key.
  3. If it's an invoke step, select either Input or Output. Otherwise, ignore this step.
  4. Select the property to map.
  5. Select the property that maps the previous selected property.

Meanwhile, the steps for mapping properties via content-assist in the Mapper view are:

Mapping a property using content-assist in step editor

Mapping a property using content-assist in step editor

  1. Select a property from the input or output tree.
  2. Press the key.
  3. Select Map to or Map from.
  4. Select the property to map it to or from.

Set expressions

Set expressions can be added on properties in both input and output invoke step trees. To add or edit a set expression:

Adding a set expression

Adding a set expression

  1. Select a property.
  2. Double-click it or press or .
  3. The Expression dialog will appear; enter the expression. Your expression can be either a plain string or an expression in the chosen programming language.
  4. Click the OK button or press to save the expression.

If a property already has a set expression, it is decorated with an icon and the expression; if the expression is evaluated an orange overlay icon is also visible.

Set expressions, as seen in the Mapper

Set expressions, as seen in the Mapper

Alternatively, you can add or edit a set expression using content-assist. To do this:

Set expression using content-assist in step editor

Set expression using content-assist in step editor

  1. In the step editor, select a map step or invoke step.
  2. Press the key.
  3. Select Set expression.
  4. If it's an invoke step, select either Input or Output. Otherwise, ignore this step.
  5. Select a property whose expression you want to set.
  6. The Expression dialog will appear; enter the expression. Your expression can be either a plain string or an expression in the chosen programming language.
  7. Click the OK button or press to save the expression.

Meanwhile, to delete a set expression:

Deleting a set expression in Mapper

Deleting a set expression in Mapper

  1. Select the target property of the set expression.
  2. Press or right click the property and then click the Delete Set Expression from the context menu.

Nested properties with set expressions

When a set expression is used on one of the properties of a Gloop model, a grayed expression icon will be visible next to it to indicate that one of the children properties has a set expression.

Setting the value of a Gloop model

The set expressions of Gloop model properties are evaluated by default, the reason being Gloop model properties can have their values set using a DSL. A DSL makes it very easy to set all the properties of a model; and to make things better, there's a template for generating DSLs for Gloop models.

  1. Select a Gloop model property.
  2. Open the Expression dialog.
  3. Press and then select the model DSL template proposal.
  4. The Groovy-based model DSL will be generated; press to jump from one value to another.

Creating a DSL to set the value of a Gloop model

Declaring properties

Declaring model properties is only possible in the output model tree of the Mapper view. Declaring and deleting properties in Mapper is similar to adding and deleting properties in the Input/Output view. Shortcuts, context menus, and content-assist are used in the same way to declare properties with one exception: it is only possible to declare a new property if the targeted model allows extra properties.

Declaring a property in Mapper

Declaring a property in Mapper

Declared properties are distinguished from regular properties by a green plus shaped overlay icon on the bottom left. If this overlay icon is orange, it means that the declared property was not declared within the selected step.

Map and declare in fell swoop!

It is possible to map and declare a property in one move. To do so, select the property from the input model tree, and while pressing , drag it to the opposite model tree and drop it. The property is added as a declared property and a map line connecting to it is created. There is also a context menu that does this just by right-clicking a property then select Declare Property and Map menu item.

Declaring and mapping in one move

Declaring and mapping in one move

Opening a property declaration from the Mapper view

You can easily navigate to where a property is declared simply by right-clicking the property and selecting Open Declaration. Another option is to press on the selected property to do the same.

Unloading properties

To unload a declared property:

Unloading a property

Unloading a property

  1. Select one or more declared properties.
  2. Press ; or right click any of the selected properties, and then click Unload Property.

The process is the same to reload the declared properties. When a declared property is unloaded, a trash bin icon is displayed near the property.