Skip to content

Home

Introduction

Development

IDEs

Services

Service manager

API Explorer

Gloop step editor

The main component of the Gloop service editor is the Step editor. The Step editor has two tabs labeled Source and Design. The Source tab allows you to view the JSON definition of the opened Gloop service. The Design tab, as its name implies, is where you design your service. Here you can add, modify, and remove Gloop steps.

The Design tab contains two components: the step tree of the service and the toolbar above it. The step tree represents the Gloop service's steps, their order, and hierarchical structure. The toolbar above helps you navigate through the step tree, modify it, and view the details of its nodes.

In the tree, each step is decorated so that it would be easy for users to infer the purpose and/or definition of the step. For example, different types of steps are given different icons. Additionally, certain steps can contain other steps and in order to show this arrangement, Coder renders parent steps collapsible or expandable in the tree. At the side of the step tree is also a rule which displays the number lines, breakpoints, and code errors of the service.

Adding steps

There are five different ways to add a step:

  • Using the toolbar

    1. Click the plus-shaped green button in the toolbar.
    2. Click one of the menu items below to indicate the type of step you want to add.

    Adding a step via the add-step button in the toolbar

    Adding a step via the add-step button in the toolbar

  • Using the context menu

    Do a right click on the step tree, select Add, and then click on the type of step you want to add.

    Adding a step via the step tree context menu

    Adding a step via the step tree context menu

  • Using keyboard shortcuts

  • Using drag and drop

    Via dragging and dropping, you can either add a step or duplicate existing ones.

    To add an invoke step, select one or more services from the Coder Navigator view and then drag and drop them onto the step tree. To duplicate existing steps, select the steps you wish to duplicate and then drag and drop them onto the step tree while pressing .

    Adding an invoke step via drag and drop

    Adding an invoke step via drag and drop

  • Using content assist

    Using content assist is a very convenient way to add steps quickly, especially for invoke steps. To trigger content assist, press the key, then search for the name of the step you want to add or the name of the service to invoke.

    If you've got a step selected while using content assist to add a new step, and if the selected step can have children, then the new step will be added under it; otherwise, it will be added after the selected step. Pressing while adding the step forces it to be added after the selected step. If no step is selected while adding a step via content assist, the new step will be placed at the end of the Gloop service.

    Use content assist to modify a step

    You can use content assist to replace the currently selected step with a new one from the list of proposals. Even though the step will be replaced, the child steps or map lines of the old step will remain, if it has any. To replace a step:

    1. Select the step to be replaced.
    2. Press to trigger content assist.
    3. Filter steps by typing key phrases and use the and arrow keys to shuffle and select a step.
    4. Once you have found the proposal you need, select it and press to finalize your selection.

    If the proposal you have selected is a template which produces multiple steps, the replacement will only be applied to the first step generated by the proposal.

    Replacing a step with content assist

Deleting steps

There are three different ways to delete a step:

  • Using the toolbar

    Select all steps you want to delete and then click on the red 'x' button in the toolbar.

    Delete button for steps in the Gloop service editor toolbar

    Delete button for steps in the Gloop service editor toolbar

  • Using the context menu

    Select all the steps you want to delete, right click, and then select Delete from the appearing context menu.

    Deleting steps via the context menu

    Deleting steps via the context menu

  • Using keyboard shortcuts

    Select the step and then press to remove the selected step.

Moving steps

You can move steps around in order to refine the sequence of actions your Gloop service will execute. Steps can be moved up, down, left, or right. Moving up or down would mean the step will move one line upwards or downwards, respectively; switching places with the step that comes before or after it. Moving left would prompt Coder to remove the step from its current parent and consequently transfer it under the first composite step1 below it. Moving right would prompt almost the same action except the step will be transferred under the first composite step above the selected step.

There are three ways to move steps:

  • Using the toolbar

    To move steps using the toolbar, click on the step(s) you want to move and and then click on one of the arrowhead-shaped buttons.

    Buttons for moving steps in the Gloop service editor toolbar

    Buttons for moving steps in the Gloop service editor toolbar

    Here is a short demonstration:

    Moving a step using keyboard shortcuts

    Moving a step using keyboard shortcuts

  • Using keyboard shortcuts

  • Via dragging and dropping

    1. Select all steps you want to move; you can select multiple steps by holding while clicking on them.
    2. Drag and drop them in-between or on top of other composite steps (in the same service or of a different Gloop service).

    By default, dragging and dropping to another place will remove the steps from their original location; but if the key is pressed while doing so, the steps will be duplicated instead.

    Using drag and drop to move Gloop steps

    Using drag and drop to move Gloop steps

Copying and pasting steps

It is possible to copy the steps of one Gloop service and paste them to the same service (albeit to a different line) or a different Gloop service. To copy and paste steps:

  1. Select the steps you want to copy.
  2. Press or do a right-click > Copy.
  3. Select another step or Gloop service.
  4. Press or or do a right-click > Paste.

Aside from this, you can also copy the map lines and set expressions of a map step or invoke step and paste them to another map step or invoke step. This can be done in the step tree or in the Mapper view. The map lines are validated before being pasted which means that if the map line or set expression is invalid, then it’s discarded. To do this:

  1. Select the map lines or set expressions you want to copy.
  2. Press or do a right-click > Copy.
  3. Select another map step or invoke step.
  4. Press or or do a right-click > Paste.

Copy-pasting map lines in the Step editor

Copy-pasting map lines in the Step editor

Copy-pasting map lines in the Mapper view

Copy-pasting map lines in the Mapper view

It is also possible to copy and paste plain JSON text to create steps. For example, copying the JSON string below and pasting it in the step tree will create a new map step.

1
2
3
{
    "comments": "This map step was created from the clipboard"
}

Copying and pasting JSON text to create a new step

Coder Studio-supported only

Copy-pasting of JSON text to create steps is only supported in Coder Studio as of this version.

Expression dialog

The Expression dialog is for editing steps with expressions like the fork step, while step, break step, set expression step, or Gloovy step.

This dialog is composed of a text area on the left and a model tree on the right. The text area contains the actual expression and the model tree displays the context model containing all the properties available for use in the step.

When writing Groovy code, it is possible to trigger content assist by pressing or . This feature provides the developer with a list of accessible variables, methods, data types, keywords, and constructs based on the context of the current code2.

It is also possible to use the model tree on the right to write a property name in the expression; you can do this by either double-clicking on it or by selecting the property and copy-pasting (, ) it. Doing it this way writes the entire path of the property in the expression so that it may be accessed.

Your Groovy code will also be validated and checked for syntax and semantic errors. When an error is detected, the invalid code is underlined in red. Hovering over the invalid code displays the error message, giving more information about what is wrong.

Some step expressions can be evaluated while others cannot (such as the while step). When not evaluated, the dialog accommodates plain text. When evaluated, it accommodates Groovy code; therefore syntax coloring, semantic highlighting, content assist, and validation are enabled. Pressing toggles the Evaluated checkbox in the Expression dialog.

Gloop service editor Expression dialog

Gloop service editor Expression dialog

Content-assist is only supported in Coder Studio

Code-related proposals are only available in Coder Studio for now.

Step decoration

Each step is decorated with a different icon and label in the step tree. This is to help developers easily infer information about the step.

Map step decoration

When a map step has only one declared variable, no map lines, or has one set expression, it is displayed as:

1
Declare <declared property>=<expression>

... or

1
Set <declared property>=<expression>

Map step, as seen in the step tree

Map step, as seen in the step tree

The map lines of a map step or invoke step, as well as set expressions are displayed under the step in the step tree when it is expanded; it can be used to delete or edit the map line or set expression. When double-clicking a map line, it opens the Mapper view and selects the line; similarly, double-clicking a set expression opens the Expression dialog.

Evaluated set expressions

When a set expression is evaluated, a yellow dot icon is visible next to it.

Priority property

Map lines and set expressions are, by default, ordered by their Priority property. You can disable this option by clicking Filters from the toolbar and un-checking "Show Map lines and Set steps".

Hiding map lines in the step tree

Hiding map lines in the step tree

Fork step and break step decoration

The expression of a fork step or break step is displayed next to the step like so:

1
Fork <expression>

Fork step, as seen in the step tree

Fork step, as seen in the step tree

Iterate step decoration

When an iterate step has both an input and output array, it will be displayed like so:

1
Iterate <input array>  <output array>

If it only has an input array, it will be displayed as:

1
Iterate over <input array>

If it only has an output array, it will be displayed as:

1
Iterate over  <output array>

Iterate step, as seen in the step tree

Iterate step, as seen in the step tree

While step decoration

A while step's expression is displayed in the step tree like so:

1
While <expression>

While step, as seen in the step tree

While step, as seen in the step tree

Gloovy step decoration

When the script of a Gloovy step is short enough, it is displayed next to the step like so:

1
Gloovy <script>

But when the script contains more than one line, the lines of the script are displayed under the Gloovy step. This option can be disabled by clicking Filters from the toolbar and then un-checking "Show Gloovy script line".

Gloovy step, as seen in the step tree

Gloovy step, as seen in the step tree

Copying script lines

When the script of a Gloovy step is shown in the step tree, each line in the script is numbered and rendered selectable by Coder. To copy lines of code from the script, simply select lines you want to copy and then press the copy shortcut or do a right-click and then select Copy.

Asynchronous step decoration

When a concurrent step or invoke step is configured as asynchronous, a green thread overlay is visible on the top right of the concurrent or invoke step icon.

Asynchronous step, as seen in the step tree

Asynchronous step, as seen in the step tree

Invoke step decoration

The invocation signature (or method signature) of an invoke step is comprised of the service's return type, name, input parameters, and exceptions; it is displayed like so:

1
<return type> <service namespace>( <parameter1>, <parameter2>, ... ) throws <exceptions>

If a parameter is assigned via a map line, set expression, or has a default value, it will be visible in the signature; in case the parameter is unassigned, null will be displayed.

When a parameter is assigned via an evaluated set expression, a yellow dot is visible next to the parameter. This option can be disabled by clicking Filters from the toolbar and un-checking "Show method signatures".

The name and value of each parameter is also indicated in the signature, <parameter name>: <parameter value>, making the invocation easier to read. This option can be disabled by clicking Filters from the toolbar and un-checking "Show named parameters".

Invoke step, as seen in the step tree

Invoke step, as seen in the step tree

Content assist

Coder supports content assist to help boost productivity when writing Gloop services. Using content assist, you can generate pre-configured steps and/or be guided through their configuration.

To trigger content assist, simply press ; a pop-up appear right under the line where you hit the key. This pop-up is composed of a search text field and a list of proposals. Proposals are possible content that can be injected based on the current code context; they have a name and a category. Proposals can be searched by their complete names or short names3. Meanwhile, categories can be cycled through to filter the proposals by simply pressing ; at the bottom right, the next category is indicated.

Here are the available proposal categories:

Category Description
Step Proposals to add a non-configured step
Flat File Descriptor Proposals to write or read from a flat file
Invoke Gloop Proposals to invoke a Gloop service
Invoke Code Proposals to invoke a different service (e.g. Groovy service)
Invoke Flux Proposals to invoke a Flux service
Templates Proposals to generate a group of configured steps based on a template

You can use the and arrow keys to navigate through the proposals whilst still having focus on the search text field so you can search and select at the same time.

When a proposal is selected, a contextual pop-up will appear on the side to give some additional information about the selected proposal. Pressing applies the selected proposal. By default, the steps will be added to the currently selected step (or Gloop service) if that step can have children steps; else, it will be added bellow that step. Pressing the key while pressing forces the steps to be added after the selected step.

Content assist in the Gloop service editor

Content assist in the Gloop service editor

Search content assist proposals

Proposals can be searched and applied without leaving the keyboard. After pressing the key, search right away for a proposal by typing its name. The first match will be selected, and if it's the right one, press . Pressing while the first proposal is selected will jump to the last proposal. Some proposals have short names, for example the try-catch-finally proposal can be searched using the text tcf.

Templates

There is a special type of proposal called template proposal. These proposals are designed to generate one or more pre-configured steps to make it very fast and easy to write common logic or code patterns. Template proposals usually require some additional input like filling in a field or selecting another proposal or property.

Using content assist templates in the Gloop service editor

Using content assist templates in the Gloop service editor

Below is a non-extensive list of proposal and their effects:

Flat file descriptor template

This template generates the necessary steps to read or write to a flat file using a flat file descriptor.

To use this template:

  1. Search for the name of the flat file descriptor.
  2. Select it.
  3. Choose whether to read or write.

The template generates a step that opens an input or output flat file cursor then iterate over it using an iterate step.

Iterate over an array template

This template generates an iterate step that iterates over one of the available arrays.

  1. Search and select iterate over array.
  2. Choose the input array or none.
  3. Choose the output array or none.

The template generates a pre-configured iterate step with an input and output array.

Block step type template

To generate a block step, simply type try catch, try catch finally or try finally and select any of these templates from the content assist pop-up. These templates can be searched using their respective initial letters like tc, tcf, tf, respectively.

Logging templates

These templates generate an invoke step which invokes one of the LoggerMethods to log a message.

  1. Search a log level, either info, warn, debug, error or println then select it.
  2. The Expression dialog will appear, where you should enter the message to be logged.

The template generates an invoke step which invokes the chosen LoggerMethods one-liner and adds a set expression on the message input of the method.

Fork true/false template

This template generates a fork step with two children, one with a true label and one with a false label.

  1. Search for fork true/false, then press to select it.
  2. The content assist pop-up will appear again; this time, select a step which will be executed if the expression evaluates to true. The step you will choose will have the label of true.
  3. The content assist pop-up will appear again; this time, select a step which will be executed if the expression evaluates to false. The step you will choose will have the label of false.
  4. The Expression dialog will appear, where you should then enter the expression of the fork step.

  1. In other words, a step that can contain children. 

  2. Content assist, Wikipedia

  3. Such as abbreviations