Transcription

WebSphere Message BrokerVersion 7.0.0.1Pattern Authoring Lab 1Creating a Basic PatternSeptember, 2010Version 1.0Hands-on lab built at productCode level Version 7.0.0.1

WebSphere Message Broker V7.0.0.1 PatternsSeptember 20101. Introduction to Pattern AuthoringWebSphere Message Broker Version 7 introduced the capability to create message flows using apattern-based approach, based on a set of IBM-supplied patterns. Fixpack 1 (also known as version7.0.0.1) extended this facility by allowing you to create your own patterns.This hands-on lab is the first of several labs which show you how to create your own patterns. Itstarts by taking a simple message flow (an exemplar) and creating a pattern based on this flow.Later labs show you more sophisticated tools that you can use to refine your patterns.2. Creating your new Pattern1.If not already started, start the message broker toolkit by clicking its icon in the quick launchtoolbar, or on the desktop.Use the pre-set workspace, TSS. If there are any artefacts already in the workspace, deletethem all (you can select multiple projects with Ctrl-click).Import the project interchange file PatternAuthBasic Exemplar.zip. (File, Import, Other,Project Interchange). This PI file is stored in the directory c:\tss\patterns. Select theTransform project; this will load the Transform message flow.2.Page 2Pattern Authoring Lab 1 – Basic Introduction

WebSphere Message Broker V7.0.0.1 Patterns3.Create a Pattern Authoring project. Click File, New, Pattern Authoring project.Alternatively, you can just click the drop-down arrow:Page 3Pattern Authoring Lab 1 – Basic IntroductionSeptember 2010

WebSphere Message Broker V7.0.0.1 Patterns4.Page 4Call the pattern “MyPattern”, and click Next.Pattern Authoring Lab 1 – Basic IntroductionSeptember 2010

WebSphere Message Broker V7.0.0.1 Patterns5.Page 5Select the required message flow project . Transform, and click Finish.Pattern Authoring Lab 1 – Basic IntroductionSeptember 2010

WebSphere Message Broker V7.0.0.1 Patterns6.September 2010This opens the main editing page for Pattern Authoring.Note the four primary tabs near the bottom of the window.1) Source Files: this is selected initially, and allows you to select the required files forthis pattern.2) Pattern Configuration: allows you to edit the pattern definition.3) Categories: allows you to create and manage your pattern categories.4) Create Pattern: provides the tools to create and manage the pattern plug-ins so theycan be used by the pattern user.Page 6Pattern Authoring Lab 1 – Basic Introduction

WebSphere Message Broker V7.0.0.1 PatternsSeptember 20107.Now select the Transform.msgflow editor tab, and return to the flow editor.8.Right-click the MQInput node, and select Pattern - “Select Target Properties”.Page 7Pattern Authoring Lab 1 – Basic Introduction

WebSphere Message Broker V7.0.0.1 Patterns9.September 2010Expand the Basic group, and select the “Queue Name” as a target property.Then close the Target Properties dialogue pop-up, by clicking on the cross (top right).10. Note that the message flow MQInput node now shows the “Pattern Authoring” icon close tothe node itself. This indicates that at least one property of this node has been selected as aTarget Property for pattern authoring. You can click directly on this icon to reopen the TargetProperties editor.Page 8Pattern Authoring Lab 1 – Basic Introduction

WebSphere Message Broker V7.0.0.1 PatternsSeptember 201011. Now save and close the message flow in the usual way.12. You will now see that MyPattern project has been automatically updated to reflect theselected target property.The name of the target property is the fully qualified pathname to the property in theworkspace. It includes the project name, schema name, message flow name, node nameand property name.Page 9Pattern Authoring Lab 1 – Basic Introduction

WebSphere Message Broker V7.0.0.1 PatternsSeptember 201013. Now select the “Pattern Configuration” tab.Here, we are going to configure the user interface for the pattern.A pattern parameter has been automatically created for the target property. The patternparameter has been added to a group whose name matches the node.Page 10Pattern Authoring Lab 1 – Basic Introduction

WebSphere Message Broker V7.0.0.1 Patterns14. Select (highlight) the MQ Input group, and the click the Edit buttonPage 11Pattern Authoring Lab 1 – Basic IntroductionSeptember 2010

WebSphere Message Broker V7.0.0.1 PatternsSeptember 201015. Change the Group name and description text to suitable values for your organization. ClickOK.Page 12Pattern Authoring Lab 1 – Basic Introduction

WebSphere Message Broker V7.0.0.1 PatternsSeptember 201016. Now move on to the Categories tab.This page of the Pattern Authoring editor is where you create additional pattern categories.You also choose the category for this new pattern.The tree shows all of the categories that are currently available. The page also shows thepattern specification for the selected pattern. Pattern specifications describe the pattern, anyconstraints and limitations, and when to use it. The specifications are HTML files which youcan edit directly.To ensure you see all the available buttons, you should maximize the editor (double-click the“MyPattern.pattern” tab).Page 13Pattern Authoring Lab 1 – Basic Introduction

WebSphere Message Broker V7.0.0.1 PatternsSeptember 201017. Click “Add Category”, and choose a name for your new category (eg. MyVeryOwnCategory).Click OK.Page 14Pattern Authoring Lab 1 – Basic Introduction

WebSphere Message Broker V7.0.0.1 Patterns18. Click Yes at the save prompt.Page 15Pattern Authoring Lab 1 – Basic IntroductionSeptember 2010

WebSphere Message Broker V7.0.0.1 Patterns19. Now drag and drop the new pattern onto the new category.Before:After:Page 16Pattern Authoring Lab 1 – Basic IntroductionSeptember 2010

WebSphere Message Broker V7.0.0.1 PatternsSeptember 201020. Open the HTML for the specification (click the “Edit HTML” button).21. You can change the HTML in any way you want, using any standard HTML constructs.We will just change the title, to illustrate how to do this.For example, change the title to “My Very Own Pattern Specification”.Page 17Pattern Authoring Lab 1 – Basic Introduction

WebSphere Message Broker V7.0.0.1 PatternsSeptember 201022. Save and close the HTML file.The pattern specification has been edited and saved. The Pattern Authoring editor hasautomatically updated the preview.Page 18Pattern Authoring Lab 1 – Basic Introduction

WebSphere Message Broker V7.0.0.1 PatternsSeptember 201023. Now we must create the pattern plug-ins.Select the “Create Pattern” tab at the bottom of the editor.A pattern is implemented by two Eclipse plug-ins which are created by the pattern authoringtools. You can customize the plug-ins on this page. For example, you might want to changethe provider, description, or version number.Page 19Pattern Authoring Lab 1 – Basic Introduction

WebSphere Message Broker V7.0.0.1 PatternsSeptember 201024. In this exercise, we will not make any changes. Click the “Create Pattern Plug-ins” button.You will see a progress pop-up:Page 20Pattern Authoring Lab 1 – Basic Introduction

WebSphere Message Broker V7.0.0.1 PatternsSeptember 201025. When the build process is complete, return to window-mode in the Eclipse workbench(double-click the MyPattern.pattern tab).Two plug-ins have been created in the workspace. These plug-ins implement this pattern.You can export these plug-ins and distribute them to pattern users who can load them intotheir Toolkit.You can test the pattern by launching a second instance of the Message Broker Toolkit. Clickthe “Launch Workbench” button. This may take a few moments to start up.Page 21Pattern Authoring Lab 1 – Basic Introduction

WebSphere Message Broker V7.0.0.1 PatternsSeptember 201026. During the workbench start-up, you will see this splash screen.27. When the workspace selection window opens, take the suggested default, and click OK.Page 22Pattern Authoring Lab 1 – Basic Introduction

WebSphere Message Broker V7.0.0.1 PatternsSeptember 201028. This is the second instance of the Message Broker Toolkit. Select the Patterns Explorer viewincludes the pattern we have just created, under the new category (MyVeryOwnCategory).29. Create a new instance of the pattern. click “Create New Instance”.Provide a suitable name for the new instance, then click OK.Page 23Pattern Authoring Lab 1 – Basic Introduction

WebSphere Message Broker V7.0.0.1 PatternsSeptember 201030. Expand the Queue Information link. You will see that the field “Queue name” has beenhighlighted in pink. This means that it is a required parameter, and must be set before youcan generate the new instance.When creating the pattern, you could have provided a default value for this property, andmore detailed help to guide the pattern user. (We will examine this in a further exercise).Set a value for the QueueName property, then click “Generate”.31. You will see a progress pop-up.Page 24Pattern Authoring Lab 1 – Basic Introduction

WebSphere Message Broker V7.0.0.1 PatternsSeptember 201032. This shows the generated pattern instance. A pattern instance project and a message flowproject are created.The message flow project contains the same message flow and ESQL files as the originalmessage flow. The only difference is that the queue name property on the MQInput node hasbeen configured by the pattern user.Note that the project schema, mqsi, has been retained from the original message flow.Page 25Pattern Authoring Lab 1 – Basic Introduction

WebSphere Message Broker V7.0.0.1 PatternsSeptember 201033. Open the generated message flow. You will see that this flow is identical to the original flow,except that the name of the input queue has been set by the pattern user.You can now make further changes to this generated message flow, as required by your ownorganization’s development standards.This concludes the Pattern Authoring Introduction lab.Page 26Pattern Authoring Lab 1 – Basic Introduction