10/14/2006

BIE产品使用-快速入门

BIE Quick Tutorial BIE快速入门

The Business Integration Engine (BIE) is a full java-based application to application integration server. It competes directly with applications like Microsoft BizTalk, but is truly cross-platform since it is written in Java.

BIE是一个完全用Java开发的应用集成服务器。它完全实现了Microsoft BizTalk的功能,但因用java写的而有真正跨平台能力。

As easy to use as BIE is, it is still a very complex system. Getting started can be a tremendous challenge to say the least. This is a short guide to demonstrate BIE's power, and also to get you started using BIE as quickly as possible.

虽然很容易使用,但BIE其实是一个复杂的系统。入门是一个艰巨的挑战。本文是一个简短的指南,用来展示BIE的能力,也让你尽快开始使用BIE。

Before we get started, there are a few things we should note. This is not meant to be a comprehensive reference guide, for that get yourself a copy of the BIE Docs. This document is also not meant to be a complete training guide, for that check out WDI's comprehensive list of training programs. And finally, we're assuming that you've already downloaded and installed the latest copy of BIE.

在开始之前,我们应当注意几点。首先,本文不是一个完整的参考指南,那需要从BIE Docs获得。其次,本文也不是完整的培训指南,那需要从WDI的完整培训程序清单。最后,我们假定你已经下载和安装了BIE的最新版。

l 1、Familiarize Yourself

The first thing you should do is familiarize yourself with BIE and it's main components. Take a few minutes to view all of the pages in the BIE dashboard. The main areas of interest are under the "Configurations" and "Reports" headings in the navigation. You don't need to know what each of these things are or how to use them just yet. Instead, know where they are so that when we reference them later you can find them quickly.

首先要做的是熟悉BIE和它的主要组件。花几分钟查看BIE dashboard的所有页面。值得关注的主要区域是"配置"和"报表"菜单。不需你知道这些内容是什么或怎样使用,相反,只要知道它们在哪儿,当在后文引用时能迅速找到就行。

l 2、The Process 流程

In order to show you how to use BIE, we need a business process. In this case we've created a fictional purchase order transaction between Jones Publishing and Smith Printing. Jones Publishing wants to send a purchase order to Smith Printing to get some materials printed for an upcoming publication. The following is minimally how the process will flow:

Jones Publishing will generate a purchase order (PO) as a comma separated values (CSV) file.

The PO will enter Smith Printing's BIE server.

The PO will be translated from Smith Printing's PO format to Smith Printing's order format, which is a custom XML format.

The order will then be handed off to some internal system at Smith Printing for processing.

为展示怎么使用BIE,我们需要一个业务流程。在本案例中我们假设一个虚构的在Jones Publishing和Smith Printing 之间的订购单交易。Jones Publishing要送一个订购单给Smith Printing……。下面简单说明该流程:

Jones Publishing生成一个订购单(PO)-一个CSV文件;

订购单将传入Smith Pringting的BIE服务器;

订购单将被从Smith Pringting的PO格式转换为Smith Printing的订单格式,那是一种定制的XML格式;

订购单将传到某个内部系统去处理。

l 3、Documents and Translation 文档和转换

Once you know what a process looks like, you then need to define the documents as W3C Schemas and create a map between those two formats. For the sake of expediency we've created the schemas and map for you.

To see the map open the BIE map builder. On Windows this can typically be found in c:\bie\bin\mapper.exe and in Linux and UNIX environments it can typically be found in /usr/local/bie/bin/map.sh.

知道流程概要后,下你需要定义文档的W3C模式并创建两种格式间的映射。为了方便,我们为你创建了模式文件和映射文件。

为查看映射定义需启动BIE MapBuilder。在Windows系统中为c:\bie\bin\mapper.exe,在Linux和Unix环境中是/usr/local/bie/bin/map.sh。

Once you've opened the Map Builder, click on the icon that looks like a folder in the toolbar. When prompted select Jones2Smith.xml and click on the "open" button to load the map. Depending upon the speed of your system it may take a few moments to load the map. When it's loaded you should now have a screen that looks like this:

[Click to view what the Map Builder looks like.]

打开MapBuilder后,点击工具条上的文件夹图标。当文件选择窗口出现后选中Jones2Smith.xml,点击open按钮加载映射文件。视你的机器速度,要花一些时间载入映射。加载结束后你现在看到类似下面的屏幕:

Notice that on the left we have the CSV document format of Jones Publishing, which is very flat. On the right we have the XML document format of Smith Printing, which has some heirarchy as most XML documents do.

The lines inbetween the two sides represent the mapping of individual fields. To map one field to another you simply click on a field on the left, and drag your mouse to a field on the right. If the document is too large to drag directly, you can access the clipboard by right-clicking on any field on the left and then paste by right clicking on any field on the right.

Also note the box labeled "multiply". That is a macro that, as its name implies, multiplies two fields and then the result can be fed into an element of the other document, or it can be fed into another macro for additional processing. To see the other macros available, right click in the center of the screen.

Behind the scenes the map builder is actually generating XSL. To see the resultant XSL click on the compile icon in the toolbar. It is the second to last icon on the right of the toolbar.

Now close the map builder, and be sure not to save any changes you made or the rest of the tutorial will fail.

注意左边的是Jones Publishing的CSV文档格式。右边的是Smith Pringting的XML文档格式。左右两栏之间的线条代表个字段间的映射关系。要映射两个字段你只需点击左边的某个字段,拖动鼠标放到右侧的一个字段上即可。如文档太大,不能在屏幕上直接连线,可以通过右键点击菜单的clipboard功能。

看图上有标签"multiply"的方框。如同名字所说的,那是一个宏-求两字段乘积并将结果送入另以文档的某元素,或者送入另一个宏以做更多的处理。

在展示界面后台,MapBuilder实际上生成XSL。点击工具条上的Compile图标可以看到生成的XSL。它是工具条上倒数第二个图标。

现在MapBuilder,确保不要保存任何修改。否则后面的步骤可能会出错。

l 4、Document Parsing 文档解析

BIE cannot translate or otherwise manipulate anything other than XML, therefore every document must be transformed to XML. Luckily BIE has a number of document parsers built in to perform these transformations between various formats and XML.

Open your BIE dashboard, log in, and click on the "Message Formats" page under the "Configurations" heading. You'll notice a list of message formats (or document parsers) that have already been configured, including the Jones PO.

Click on the Jones PO document format configuration in the list. It will then appear at the bottom of the page. Notice that there are a number of configuration parameters. Each type of message format has its own set of parameters. A detailed list of all the message formats, and their parameters can be found in the BIE docs.

We've already configured everything for you in this case, so let's move on.

BIE不能处理转换和处理XML之外的格式,因此任何文档必须转换为XML格式。幸运的是,BIE有不少内置的文档解析器可以执行多种格式和XML之间的转换。

打开BIE dashboard,登陆,点击"配置"下的"Message Formats"菜单,你会看到消息格式格式清单,列出了已配置好的消息格式,包括JonesPO。

l 5、Maps 映射

We've already talked a little bit about how maps are created in the map builder, but in order for BIE to use a map, it must have a copy. If you develop your map on the same machine as your BIE server, then the map will already be installed. Otherwise you can upload it by clicking on the "Maps" link under the "Configurations" heading in the BIE dashboard.

Note that we've already done this for you as well.

我们已经在谈到了如何在MapBuilder中创建映射关系,但为了让BIE使用这个映射,它应当另外拷贝一份。如果你是在BIE服务器安装的同一台机器上创建映射文件,那映射文件已经发布到BIE服务器上了。否则,你需要在BIE面板上点击"配置"菜单栏下的"映射"链接来上传映射文件。

l 6、Routes 路由

Routes, or business processes, are defined using BIE's route builder. Click on the "Routes" link under the "Configurations" heading in the BIE dashboard. Now you'll see a list of the routes installed in your system, and whether they are enabled or disabled.

You should see the JonesPubPO route. Click on it.

[Click to see what the process builder looks like.]

You are now in the process builder. You can see a visual representation of the process. The series of rounded gray boxes down the left represent the process. The individual rounded boxes are called actions. The square boxes directly to the right of the actions represent what document(s) are being dealt with in a particular action. And to the right of the documents are icons that represent what is actually happening to the document inside the action。

Let's talk about what's going on in this route. First we receive a document called "Jones_CSV", which is what initiates or triggers this route. Next we log the incoming document so that we have a copy of it in case we need to diagnose a problem later. Then we convert the Jones PO to the Smith Order using the map we discussed earlier. Next we log a copy of the translated document, so we can diagnose a problem if needed. Then we write the Jones Order to the file system. And finally, we tell BIE to send a copy of the original document back to the sender.

In the step where we write the Jones Order to the file system, we could have instead inserted it into a database, sent it out over a web service to some application server, or dumped it to an FTP server for processing. We have used the file system in this case so that you can test the BIE without setting up some external system to connect to. You can select "add an action" link to view a list of available actions.

Also, in the final step, we specify that the route should send back the original document to the sender. This step is skipped in most protocols, but some protocols are capable of real-time round-trip. This means that they send you one document and expect another back. Web services are an example of a protocol that supports this functionality. Instead of the original document, we could also have sent back a receipt for the purchase order, or maybe even an advanced ship notice (ASN).

l 7、Set Up The Demo 设置示例

Now that we've covered some of the basic components, let's set up a demonstration so you can see BIE in action.

First, assuming you're still on the route builder page, scroll to the top of the page and click on the link that reads "enable this route." This will tell BIE that we wish to being servicing requests for this route.

Now click on the "System" link under the "Configuration" heading in the menu. Scroll down to the file system listener section. Enable the file system listener, and set the watch interval to "5" seconds. Also make note of the watch directory path as we'll need it later. Now scroll to the bottom of the page and click "save".

After making changes to system settings, we need to restart the BIE server. On Windows restart the service. On UNIX style systems just run stop and start from the command line.

设置、激活文件系统监听器

l 8、Run The Demo 运行示例

To run the demo we first need to get the sample Jones Purchase Order document. It can be found in the translation/data folder of your BIE install. On most UNIX style systems it can be found here:

/usr/local/bie/translation/data/JonesPubPO.csv

And on Windows environments, it can be found here:

c:\bie\translation\data\JonesPubPO.csv

Rename the file from JonesPO.csv to Jones2Smith.csv. What this does is tells BIE that this file should be processed with the Jones2Smith route. If we wanted to put our own identifier on the file we could also call the file Jones2Smith_foobar.csv.

BIE has the ability to accept input via multiple protocols including FTP, webservices, HTTP, HTTPS, and by watching a directory. For this example, we will be using the file system watched directory. More information on the available listeners can be found in the BIE docs.

Since we will be placing our file in the watched directory, we need to tell BIE which route to run. This is done via an identifier in the filename. Notice that the name of the file is the same as the route that we would like to run. BIE will use all characters in the filename up to a .(dot) or _ (underscore) as the route identifier. Since the JonesPubPO.csv file already contains the route identifier we can continue to the next step.

Now we need to copy the file into the watch directory that we noted in the last step. Unless you changed it, the folder can be found in the data/filesystem/watch folder of your BIE install. On UNIX style systems this can typically be found here:

/usr/local/bie/data/filesystem/watch

And on Windows environments, it can be found here:

c:\bie\data\filesystem\watch

Within 5 seconds (because that's the time we told BIE to wait between checking for documents) BIE should pick up the document, and process it.

l 9、Results 结果

Now that we've processed a document with BIE, we can finally see the fruits of our labor. Let's first look in the folder where BIE was supposed to drop the document. It can be found in the data/filesystem/out folder in your BIE install. On UNIX style systems this can typically be found here:

/usr/local/bie/data/filesystem/out

about:
And on Windows environments it can be found here:

c:\bie\data\filesystem\out

Go ahead and open the document to verify that it is indeed XML.

Now, open the dashboard, log in, and click on the link called "Transactions" under the "Reports" heading in the menu.

You should now see a list of the transactions that have been logged by BIE. At this point there is probably only one with a transaction ID of 1000. Click on the transaction ID to view the details of the transaction.

Initially you should see the incoming document. It should look like a mess of text with commas separating each field. If you click on the link under "Mark 2", you should then see the translated document. This should look like a very clean XML document.

l 10、Conclusion 总结

You've now completed this brief tutorial. You should revisit any parts that were unclear to see if they now make sense, since you've seen a whole process in action. Keep in mind that this is a very simple process, compared to what BIE is capable of.

Now that you've seen the power of BIE, you should easily recognize how much time it can save integrating business processes, over the traditional methods of custom coding. Users that are familiar with BIE can typically build processes in BIE in a tenth of the time it would take them to build the process from scratch.

现在你已经完成了这个简单的例子。相比传统的编码方法,你很容易算出BIE在集成业务流程上能节省多少时间。熟练用户能在BIE中以10倍速生成流程。

Technorati :

没有评论:

为什么说普京已经输掉了这场战争

  为什么说普京已经输掉了这场战争 作者: Yuval Noah Harari (历史学家畅销书【智人:人类简史】的作者) 译自: 英国卫报, 2022年2月28日 翻译: Andywho in Canada 原文链接: Why Vladimir Putin has alread...