Using context menu to add nodes and actions to message flow

So far we have used the drag-and-drop feature for adding nodes and actions to the message flow of a proxy service. However, there is also a more developer-friendly approach, where we don't have to know where in the palette a given item is and especially which items are allowed in a given context.

Getting ready

You can import the OSB project containing the base setup for this recipe into Eclipse OEPE from chapter2getting-readyusing-context-menu-to-add-nodes-actions.

How to do it...

Navigate to the Message Flow tab and perform the following steps:

  1. In the message flow, right-click on any element, for example, on the Default branch of the operational branch node.
  2. In the given context, Insert Into and Insert After are possible.
  3. Select Insert Into and then the element to be added. In the given context, the Default handler, only a Conditional Branch, an Operational Branch, a Pipeline Pair, or a Route are valid and therefore the context menu only holds these items.
    How to do it...
  4. Select Pipeline Pair to add the unsupported error-handling code as shown in the previous screenshot.
  5. Right-click on the Request Pipeline of the pipeline pair just added earlier and check the context menu.
  6. Only Insert Into | Stage is available in this context.
    How to do it...

How it works...

The context-sensitive menu helps in choosing the right element at a given place in the message flow. There is an Insert Into and an Insert After menu, the first inserting the element into the element that holds the focus and the second one adding it after the one holding the focus.

This is very helpful, especially for a beginner, because this way we no longer have to exactly know which elements are allowed at a given place in the message flow. If using the drag-and-drop feature, the drop will not be possible for a certain action or node, if it's not allowed in the given context. Only those elements that are valid at the given context can be chosen.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset