Mulesoft 简明教程

MuleSoft - Discovering Anypoint Studio

Anypoint Studio 编辑器帮助我们设计应用程序、API、属性和配置文件。除了设计之外,它还帮助我们编辑它们。为此,我们有 Mule 配置文件编辑器。要打开此编辑器,请双击 /src/main/mule 中的应用程序 XML 文件。

Anypoint Studio editors help us design our applications, APIs, properties and configuration files. Along with designing, it also helps us to edit them. We have the Mule configuration file editor for this purpose. To open this editor, double-click on the application XML file in /src/main/mule.

要使用我们的应用程序,我们在 Mule 配置文件编辑器下有以下三个选项卡。

To work with our application, we have the following three tabs under Mule Configuration file editor.

The Message Flow tab

此选项卡提供了工作流的可视化表示。它基本上包含一个画布,帮助我们直观地检查我们的流。如果您想将 Mule Palette 中的事件处理器添加到画布中,只需拖放,它就会反映在画布中。

This tab gives a visual representation of work flow. It basically contains a canvas that helps us check our flows visually. If you want to add Event Processors from the Mule Palette into the canvas, then just drag and drop and it will reflect in the canvas.

the message flow tab

通过单击事件处理器,您可以获得 Mule 属性视图,其中包含所选处理器的属性。我们也可以编辑它们。

By clicking on an Event Processor, you can get the Mule Properties View with the attributes for the selected processor. We can also edit them.

The Global Elements tab

此选项卡包含模块的全局 Mule 配置元素。在此选项卡下,我们可以创建、编辑或删除配置文件。

This tab contains the global Mule configuration elements for the modules. Under this tab we can create, edit or delete configuration files.

global elements tab

The Configuration XML tab

顾名思义,它包含定义 Mule 应用程序的 XML。您在此处所做的所有更改都将反映在画布中以及消息流选项卡下事件处理器的属性视图中。

As the name implies, it contains the XML that defines your Mule application. All the changes you do here will reflect in the canvas as well as the properties view of event processor under the Message Flow tab.

configuration xml tab

Views

对于活动编辑器,Anypoint studio 为我们提供了项目元数据的图形表示,以及视图中包含的属性。用户可以在 Mule 项目中移动、关闭和添加视图。以下是 Anypoint Studio 中的一些默认视图 −

For the active editor, Anypoint studio gives us the graphical representation of our project metadata, properties with the help of views. A user can move, close as well as add views in the Mule project. Following are some default views in Anypoint studio −

Package Explorer

Package Explorer 视图的主要任务是显示 Mule 项目中包含的项目文件夹和文件。我们可以通过单击它旁边的箭头来展开或收缩 Mule 项目文件夹。可以通过双击打开文件夹或文件。看看它的截图 −

The main task of Package Explorer view is to display the project folders and files consisted in a Mule project. We can expand or contract the Mule project folder by clicking on the arrow next to it. A folder or file can be opened by double clicking it. Have a look at its screenshot −

package explorer

Mule Palette

Mule Palette 视图显示了事件处理器,如范围、过滤器和流控制路由器,以及模块及其相关操作。Mule Palette 视图的主要任务如下 −

Mule Palette view shows the event processors like scopes, filters, and flow control routers along with modules and their related operations. The main tasks of Mule Palette view are as follows −

  1. This view helps us to manage the modules and connectors in our project.

  2. We can also add new elements from Exchange.

看看它的截图 −

Have a look at its screenshot −

mule palette

Mule Properties

顾名思义,它允许我们编辑画布中当前所选模块的属性。Mule 属性视图包括以下内容:

As the name implies, it allows us to edit the properties of the module currently selected in our canvas. Mule Properties view includes the following −

  1. DataSense Explorer that supplies real-time information about the data structure of our payload.

  2. Inbound and outbound properties, if available or variables.

以下是屏幕截图:

Below is the screenshot −

mule properties

Console

每当我们创建或运行 Mule 应用程序时,嵌入式 Mule 服务器都会显示一个事件列表和问题列表(如果有的),由 Studio 报告。控制台视图包含该嵌入式 Mule 服务器的控制台。看看其屏幕截图:

Whenever we create or run the Mule application, embedded Mule server displays a list of events and problems, if any, reported by Studio. Console view contains the console of that embedded Mule server. Have a look at its screenshot −

console

Problems View

我们在处理 Mule 项目时可能会遇到许多问题。所有这些问题都显示在“问题”视图中。以下是屏幕截图

We can encounter many issues while working on our Mule Project. All those issues are displayed in the Problems view. Below is the screenshot

problems view

Perspectives

在 Anypoint Studio 中,它是一个按指定方式排列的视图和编辑器的集合。Anypoint Studio 中有两种透视图:

In Anypoint Studio, it is a collection of views and editors in a specified arrangement. There are two kinds of perspectives in Anypoint Studio −

Mule Design Perspective - 这是我们在 Studio 中获得的默认透视图。

Mule Design Perspective − It is the default perspective we get in Studio.

Mule Debug Perspective - Anypoint Studio 提供的另一个透视图是 Mule 调试透视图。

Mule Debug Perspective − Another perspective supplied by Anypoint Studio is Mule Debug Perspective.

另一方面,我们还可以创建自己的透视图,并可以添加或删除任何默认视图。

On the other hand, we can also create our own perspective and can add or remove any of the default views.