WebSphere Integration Developer Guide Tutorial part 4th

Source: Internet
Author: User
Tags advantage

WebSphere Integration Developer Guide Tutorial Part 4 taking advantage of visual code snippets and business state machines in service-oriented applications

Introduction

In the previous section of this series, you built a simple service-oriented order processing application with WebSphere integration Developer. You've learned how to use its concepts and tools to construct the artifacts of your application. You implemented a component ProcessOrder with a business state machine, but only a very small amount of background information was given for the specific actions that were made when you built it. The reason for selecting a state machine to implement this component is that for each order, the steps used to process the order depend on the current status of the order.

In general, States are useful if the activity of a component is event-driven and each activity that occurs depends on the current state of the component. Event-driven in this scenario means that the component waits for a call to its operation to understand when the next step should be taken. You should now delve into each state machine concept to help you understand what you can take advantage of to build your own larger, more reliable state machines.

Before delving into the state machine concept, let's take a quick look at the visual code fragment editor. In business state machines, as well as in business processes, custom logic is sometimes required. For example, when your process can determine whether it should go along a specific path or help your state machine determine which state transformation should take place, you often need to compute some business data. Because users of WebSphere integration Developer are not required to have detailed knowledge of any programming language, the visual snippet Editor plays an important role in this situation.

When building your own applications, you may want to test the sections before continuing with the work to make sure they work as expected. The previous section has seen how simple it is to test the application, even before some of them are ready. You have learned from the first experience of running an application that a problem is most likely to occur. So, we'll let you run the Order Processing application again, but this one will show you how easy it is to debug components. We'll also show you some tips on using test clients to test state machines.

In the next few sections, you will learn about the following:

The visual code fragment editor and its attributes.

All parts of the business state machine.

How to debug a state machine (or any of its components).

Visual Code Fragment Editor

If you have already tried the example in the previous section, you have already used the visual snippet Editor. Like a business state machine, we don't spend a lot of time researching this editor, so let's take a closer look at how this editor can help you develop your own applications.

Whether you are creating a BPEL process, a business state machine, or any of several other types of components, you need to define custom expressions and behaviors. In most cases, you need to use Java™ to represent it. But what if you don't know the specifics of writing Java code? Or, you might know Java coding, but you don't know the details of the methods that you can use in this context.

WebSphere Integration Developer provides a visual code fragment editor that you can use to define custom behavior without having to write Java programs. The visual snippet Editor uses a graphical view that allows you to work at the conceptual level without having to learn the details of how to use text Java code to represent logic. For example, Figure 1 shows a visual snippet that prints information to the Java console. Note that in order to get the CustomerID, you do not need to understand the syntax for printing Java, and you do not have to know how to access the properties of an order business object. This figure shows all the available properties for the Myorder variable. The code fragment appends the CustomerID of the Myorder variable to the string shipping order to, and then prints it to the Java console.

Figure 1. A simple visual code fragment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.