Anda di halaman 1dari 20

EXERCISES

Table of Contents
Exercise 1: Start the Integration Server and Configure a Broker
Exercise 2: Configure the Integration Server
Exercise 3: Model and Generate
Exercise 4: Packages and Folders
Exercise 5: Create a Service
Exercise 6: Document Types
Exercise 7a: Flow Services - BRANCH
Exercise 7b: Building Flow Services - LOOP
Exercise 7c: Building Flow Services - SEQUENCE
Exercise 8: Mapping Service
Exercise 9: Monitoring Services
Exercise 10: Validation Service
Exercise 11: Subscribing to Documents
Exercise 12: Publishing Documents
Exercise 13: Adapters (Connection Alias)
Exercise 14: Create Adapter Services
Exercise 15: Notification
Exercise 16: Web Services
Exercise 17: Trading Networks Profiles
Exercise 18: Trading Networks Document Types
Exercise 19: Complete OrdersInbound
Exercise 20: Enable and Test OrdersInbound
Exercise 1:
Start the Integration Server and
Configure a
Broker
Overview
In this exercise, you will configure a broker.

Estimated Completion Time


25 minutes

Task
1. Start the Integration Server from the command line with a debug level of 6 and
redirect the Server Log to the command window.
2. Open the Administrator with a Browser session. Logon using the default user and
password of Administrator and manage (case sensitive).
3. Check the Integration Server license. If expired, obtain the new license from your
instructor and update.
4. Using Windows Services check to see if the Broker Server is started. Start it, if
necessary.
5. Also using Windows Services, check to see if Portal Server is started. Start it, if
necessary.
6. Add the Broker Server, localhost, to the Broker Server List.
7. Check the Broker Server license and update if necessary.
8. Add a new Broker, LabBroker.
9. Connect IS to the broker. Use the broker, LabBroker, and the Client Prefix of
Training. Restart IS when prompted.

Resources
• Use the On-Topic Help

Exercise 2:
Configure the Integration Server
Overview
In this exercise, you will perform basic administration activities.

Estimated Completion Time 20 minutes

Task
1. Open the Administrator with a Browser session. Logon using the default user and
password of Administrator and manage (case sensitive). Your instructor will provide
the IS hostname.
2. Create a new user based on your initial and last name, e.g. jsmith. Set the
password = wm6dev
3. Make the user belong to the groups: Everybody, Administrators and Developers
4. Load and activate the training support package, AcmeSupport, into IS. Your
instructor will point you to the location of the source file, AcmeSupport.zip.
5. Start webMethods Modeler and logon using the newly created username & password.

Resources
• Use the On-Topic Help

Exercise 3:
Model and Generate
Overview
In this exercise, you will develop a business process model from top-down.
Estimated Completion Time
30 minutes
Task
Use Modeler to design and generate the inbound model for order processing.
1. If you are not logged in, PLEASE LOGON USING YOUR USERNAME – if you use
Administrator, your code will be generated using a different user and will be locked
when you use Developer. Create a new model, save your work and name the model
OrdersInbound. Also, show the Properties window/To Do List, select the Show
Inputs/Outputs checkbox, and Show Text on Process Toolbar.
2. In the model add an external group, Acme Customer, and all the flow steps shown
below. Change the images as shown, and link the steps so that your model looks like
the following:

3. Specify the input and output of each step using the following Document Types, and
data fields (note the subscription to start the model):
• AcmeSupport package’s acmeSupport.docs:TestOrderRequest document type
• AcmeSupport package’s acmeSupport.docs:TestOrderCanonical document type
• The text field, isValid, of data type String
4. Add the two notes, Purchase Order and Oracle DBMS, so that your model looks as
shown:

5. Set the Model’s Error Step to the generalErrors step.


6. Generate the Business Process. Save the model as OrdersInbound and exit the
Modeler.
7. Start Developer and logon using your username. Find the generated code. Expand
the package structure to confirm that the code was generated.

Resources
• ModelerUsersGuide

Exercise 4:
Packages and Folders
Overview
In this exercise, you will create a package and folders.

Estimated Completion Time


15 minutes

Task
To begin development, we need a package and folder organization.
1. In Developer, create a Package and Folders as shown:
Resources
• Developer Online help: Creating a Package, Creating a Folder, and Creating a
Service.
Exercise 5:
Create a Service
Overview
In this exercise, you will create and run a service.

Estimated Completion Time


20 minutes

Task
1. Create a flow service to write a message to the server log.
• In the Acme package, create an acme.purchaseOrder.work:myFirstService
flow service
• Add an Input String field, called inData.
• Use the correct built-in service to write the input String to the Server log.
2. Run the service, provide an input String and confirm successful execution in the
server log.

Resources
• Developer Online help: Creating a Package, Creating a Folder, and Creating a
Service.
• IntegrationServerBISReference Flow section

Exercise 6:
Document Types
Overview
In this exercise, you will create and use document types in Developer.

Estimated Completion Time


25 minutes
Task
Before we can write effective code, we need to agree on data exchange message
formats and create the initial document type structures for use in our business case.

A] One of Acme’s major customers has already integrated with another supplier using
XML over HTTP. Your team has decided to re-use this customer’s existing Order
Request XML Schema in order to simplify the project. This standard uses Dun &
Bradstreet numbers (http://www.dnb.com) as trading partner identifiers.

B] You have also done a review of your back-end systems and must now define a
canonical order document type for use internally.

1. Use a text editor to look at the XML document


C:\webMethods6\IntegrationServer\packages\AcmeSupport\pub\PORequest.xml.
What is the Root node?
2. In the acme.purchaseOrder.docs folder, create a request folder. In the request
folder, create the OrderRequest Document Type from a provided schema called
C:\webMethods6\IntegrationServer\packages\AcmeSupport\pub\OrderRequest.xsd.
Select the root node you discovered in step 1.
3. In the acme.purchaseOrder.docs folder, create the OrderCanonical Document
Type manually as shown (NOTE: IsValid starts with a capital “I”). Test your work by
expanding and collapsing both the Header document and the Items document list
types.

Exercise 7a:
Flow Services - BRANCH
Overview
In this exercise, you will create business logic using Flow steps.

Estimated Completion Time


25 minutes
Task
1. In the work subfolder, create a service branch1 with an Input String testValue and
an Ouput String message. Write Branch code to write a message (based on the value
of testValue) to the Server Log. For example, if testValue = true then write, true to
the server log. See the diagram below. Test using the Step feature. Output should
appear in the Results window, or you can look in the Server Log.

2. Create a service branch2 with two input Strings, account & cost, and an output
String message. Write Branch code to write a message (based on the value of the
input fields) to the Server Log. The pseudocode for this service is as follows:
a. If cost >= 100 then write Free Shipping to the server log.
b. Else if account starts with PRE0 thru PRE9 then write, 50% Shipping Discount
to the server log.
c. Else, write Full Shipping to the server log.

3. The diagram below graphically shows the pseudocode for this service. Note that
account = starts with PRE0 thru PRE9 is a conditional expression! Test using the Step
feature.
Resources
• Developer Online help: Flow Editor, Building a Branch Step, Building a Loop Step,
etc.
• DeveloperUsersGuide – Appendix B and D

Exercise 7b:
Building Flow Services - LOOP
Overview
In this exercise, you will create business logic using Flow steps.

Estimated Completion Time


20 minutes

Task
1. Count the number of employees in a department:
a. In the work subfolder, create a service loopTest with a Document Reference to
acmeSupport.docs:Department named Dept as input, and a single String field
count as output.
b. Use the LOOP flow statement to determine a value for count
c. Display the result (count) in the Server Log.
2. Run it (Provide your own input data).

Resources
• Developer Online help: Flow Editor, Building a Branch Step, Building a Loop Step,
etc.
• DeveloperUsersGuide: Appendix D: Conditional Expressions
Exercise 7c:
Building Flow Services - SEQUENCE
Overview
In this exercise, you will create business logic using Flow steps.

Estimated Completion Time


20 minutes

Task
You will now create and test a Try/Catch routine.
1. Create a service that will possibly return an exception.
a. In the work subfolder, create a service divNumbers with two String inputs
num1 and num2, and an Output String result.
b. Use a built-in service, pub.math:divideInts, to divide num1 by num2 and set
the result variable.
2. Test. What happens when you divide by zero?
3. Create the Try/Catch service.
a. Create a service sequenceTest with two String inputs number1 and number2,
and an output String result.
b. Use three SEQUENCE steps to create a Flow try/catch block to catch any errors
thrown by invoking the division service divNumbers created above.
c. Write the error message to the Server Log.
4. Test to see if divide-by-zero is properly handled.

Resources
• Developer Online help: Flow Editor, Building a Branch Step, Building a Loop Step, etc.

Exercise 8:
Mapping Service
Overview
In this exercise, you will create a service that maps from one data format to another.

Estimated Completion Time


30 minutes

Task
The Acme back-end resources (packaged applications, databases, and potentially
mainframes) have specific data requirements for resource transactions (inserting
document types, calling business objects, etc.) that are different from the data
exchange formats Acme has negotiated between trading partners.

1. Map from OrderRequest to OrderCanonical.


a. In the acme.purchaseOrder.maps folder, create a service
orderRequestToCanonical.
b. The input should be the String variable isValid and a document reference to
acme.purchaseOrder.docs.request:OrderRequest named OrderRequest. The
output should be a document reference to
acme.purchaseOrder.docs:OrderCanonical named
OrderCanonical.
c. Map the header data from the input variables to the output variables using the
diagram on the next page, but observe the following requirements:
i. Use a built-in service from the WmPublic package to convert the
ProprietaryDocumentIndentifier to upper case before setting its value into
the OrderCanonical’s OrderID and TransactionID strings.
ii. Use a built-in service from the WmPublic package to set OrderDate to
today’s date. Date must be stored using the pattern of MMMM dd, yyyy
d. Use a loop to map the item data, converting the GlobalProductIdentifier to
upper case before setting the OrderCanonical SKUs.

2. Test using the input file


…\IntegrationServer\packages\AcmeSupport\pub\order_request_input.txt
(Remember to also set isValid to true or false when you test!).

Resources
• Developer Online help: Flow Editor and Building a Map Step
Exercise 9:
Monitoring Services
Overview
In this exercise, you will use the My webMethods to track the execution of services.

Estimated Completion Time


20 minutes

Task
1. Create an Alias IS1 to point at your own IS server. Use the appropriate host name so
that this Alias will allow services to be resubmitted. Use a username/password of
Administrator, manage
2. Configure a JDBC Pool Alias. Name it Pool. Associate all the functions with this
Pool. Use one of the Test buttons (green triangle) to confirm you can connect to the
database.
3. Edit Extended Settings and set watt.server.auditStore=database
4. Restart IS.
5. Enable Audit Logging for the branch1 in folder acme.purchaseOrder.work. Set the
properties to Enable Auditing as Always, Log on as Error and Success, and Include
Pipeline as Always.
6. Run the branch1 service; find it in My webMethods and Resubmit after changing
the data. Refresh the search to see the resubmitted service.

Resources
• WebMethods Administrator Online help:

Exercise 10:
Validation Service
Overview
In this exercise, you will create business logic using Flow steps.

Estimated Completion Time


35 minutes

Task
Some Acme customers may accidentally submit orders with zero quantity line items.
Rather than using an XML schema that rejects zero quantity line items as invalid,
create business logic to accept the order and flag it for follow-up by a customer
service rep.
1. In the acme.purchaseOrder.utils folder, create a utility service inspectLineItems
with an input of the document reference OrderRequest, and an output of the String
isValid.
2. Use the following pseudocode (and the hints listed after the last step of this
exercise) as a guide to coding the service:

isValid = true;
For each ( ProductLineItem element of OrderRequest )
If (ProductLineItem’s ProductQuantity field < 1 )
isValid = false;

3. Run. To save time, we provided you with saved input data


C:\webMethods6\IntegrationServer\packages\AcmeSupport\pub\order_request_input.txt
When using this input file, isValid should be true. Run again and change one of the
ProductQuantity values to 0 (in the ProductLineItem array). isValid should be false.
4. For extra credit, stop processing after the first invalid ProductLineItem!

Hints
• Make sure your steps are indented properly, and use Comments.
• Note that only objects that are mapped, dropped, or set will persist in the Pipeline,
and that objects specified in the service output will only appear in the last Flow step.
• Inside a Loop , the variable specified as the Input array should not appear as an
array, it should appear as a single element.
• Do NOT type a value into the Input array in the Loop. Copy & Paste it from the
pipeline! This ensures that there are no typing errors.
• IMPORTANT. When you code the condition (ProductQuantity < 1), make sure that
you
copy the ProductQuantity variable from the pipeline of the MAP step in the loop
where the ProductLineItem is a Document (Not a Document List). If you copy from
anywhere outside of the Loop (or from the Input/Output tab) the ProductLineItem
will be a Document List and your comparison will fail.

Exercise 11:
Subscribing to Documents
Overview
In this exercise, you will create a trigger service and subscribe to a document.

Estimated Completion Time


20 minutes

Task
Create a service to subscribe to a document. Create a trigger. Test using the
Document Publish Feature.
1. Create a acme.purchaseOrder.docs:Validation document type containing one
String field named Valid.
2. Make this document publishable to the Broker.
3. Create a new service acme.purchaseOrder.work:subValidation.
4. In the input of this service, add a document reference to your document
acme.purchaseOrder.docs:Validation. Since this is a subscription, do not forget the
correct namespace.
5. Add a debugLog step and write out the contents of the Valid field (in the
acme.purchaseOrder.docs:Validation document).
6. In the work folder, create a new trigger, trigValidation. Configure it to call your
subscribing service when the document arrives.
7. Test by publishing your Validation document and set Valid=true.
8. If successful, you should see an entry displayed in the server log with a value of
true.

Resources
• Developer Online help: Create a Trigger

Exercise 12:
Publishing Documents
Overview
In this exercise, you will publish a document.

Estimated Completion Time


15 minutes

Task
Create a service to publish the document you tested earlier. Use this service to test
your newly created subscription service.
1. Create an acme.purchaseOrder.work:pubValidation service.
2. In the Input of this service add a document reference to your Acme package’s
acme.purchaseOrder.docs:Validation. Name it Validation.
3. Add code to publish the Validation document.
4. Run. The value of the input field (true or false) should be shown in the Server Log.
Resources
• Developer Online help: pub.publish:publish

Exercise 13:
Adapters (Connection Alias)
Overview
In this exercise, you will enable a connection alias for use by an adapter service.

Estimated Completion Time


15 minutes

Task
1. Using IS Server Administrator, find the connection alias acmeAdapter. It was
created
using the following properties:
• Package: AcmeSupport
• Folder Name: acmeSupport.adapters
• Connection Name: acmeAdapter
• Transaction Type: LOCAL_TRANSACTION
• DataSource Class: oracle.jdbc.pool.OracleConnectionPoolDataSource
• serverName: localhost
• user: ISV6
• password / Retype password: ISV6
• databaseName: orcl
• portNumber: 1521
• Other Properties: driverType=thin
• All other fields used their default values
2. If you are using a shared database, change the serverName to your shared database
host. Also, change the user, password, and retype the password fields all to the value
ISV6#, where # is provided by your instructor.
3. In Developer, find the connection in the appropriate folder.

Resources
• Developer Online help: Create an Adapter Service

Exercise 14:
Create Adapter Services
Overview
In this exercise, you will create an adapter service to insert data into a database.

Estimated Completion Time


40 minutes
Task
Send an OrderCanonical to the ORMS Order Management System (Oracle).
1. In the Acme package adapters folder, create the following adapter services using
tables found in <current catalog>.<current schema>. For each service, define a
result field, insertCount that shows how many inserts were made.
a. insertOrderHeader: Inserts header information into ORDER_HEADER table.
b. insertOrderDetails: Inserts line items into the ORDER_DETAILS table.
(WARNING: don’t use the ORDERDETAILS table)
2. In the adapters folder, create the following adapter services:
a. selectOrderHeader: Selects all rows from ORDER_HEADER table.
b. selectOrderDetails: Selects all rows from ORDER_DETAILS table.
3. Test the two Insert adapter services (insertOrderHeader and insertOrderDetails)
by running them and typing in some data for every field. Confirm that the insertCount
returns “1”.
4. Run the two Select Adapter services (selectOrderHeader and selectOrderDetails)
and confirm that the database tables are populated.
5. In the utils folder, create a flow service insertOrderCanonical with an input of a
Document Reference to Acme package’s acme/purchaseOrder/docs/OrderCanonical
document, named OrderCanonical. The code should insert the OrderCanonical
information into the database. Use the following pseudocode to code the service:

Insert OrderHeader information


For each (item)
Insert OrderDetail information

6. Test the insertOrderCanonical service by loading the data from the


c:\webMethods6\IntegrationServer\packages\AcmeSupport\pub\order_canonical_input.txt
file. Use the two Select Adapter services (selectOrderHeader and selectOrderDetails)
to Check the tables.

Resources
• Developer Online help: Create an Adapter Service

Exercise 15:
Notification
Overview
In this exercise, you will create a notification for a database insert.

Estimated Completion Time


15 minutes

Task
As each new, flagged order is inserted into the Order System, the system must return
an Acknowledgement back to the customer.
1. In the notifiers folder, create a notification orderCanonicalNotifier, with a Base
Name of ORDER, on insert of a new order into the Order Management system (the
<current catalog> | <current schema> | ORDER_HEADER table). Select all of the
columns in the table.
2. In Administrator, configure the Polling Interval for 10 seconds.
3. Test by running the insertOrderCanonical service from the previous exercise. You
should see your document publish message in the Server Log.

Resources
• Developer Online help: Create an Adapter Notification

Exercise 16:
Web Services
Overview
In this exercise, you will expose a standard service as a Web Service and invoke it from
a Web Service client.

Estimated Completion Time


15 minutes

Task
1. In the AcmeSupport package, select the service
acmeSupport.examples:demoService.
2. Create a WSDL file for the demoService and save it to the
c:\webMethods6\IntegrationServer\packages\AcmeSupport\pub directory.
3. In the work folder, create a Web Service Connector to call the demoService
you located earlier. Run it. Are the results correct?

Resources
• Developer Online help: Generate WSDL and Create a Web Service Connector

Exercise 17:
Trading Networks Profiles
Overview
In this exercise, you will create local and partner profiles in Trading Networks.

Estimated Completion Time


15 minutes

Task
The Acme business case uses Trading Networks to manage XML communication with
trading partners.
1. Start TN Console and log in using your username and password.
2. Use the Profile Assistant to create your own TN local profile (Acme). Enable.
3. Use the New Partner Profile option to create a partner profile (Acme Customer).
Enable.

Exercise 18:
Trading Networks Document Types
Overview
In this exercise, you will create document types in Trading Networks.

Estimated Completion Time


30 minutes

Task
The Acme business case uses Trading Networks to manage XML communication with
trading partners. In this task, you must configure the incoming purchase order within
TN.
1. Create and configure a document PORequest.
Use the XML document -
C:\webMethods6\IntegrationServer\packages\AcmeSupport\pub\PORequest.xml
Identify: Use the Root Tag to identify the document
Extract: See below:
Options: Set Format as an IS Document Type to
acme.purchaseOrder.docs.request:OrderRequest

2. Test the document using the TN Console Test facility.

Exercise 19:
Complete OrdersInbound
Overview
In this exercise, you will add business logic to generated models.

Estimated Completion Time


30 minutes

Task
The OrdersInbound process was generated on day 1 using temporary documents and
no Trading Networks. It is time to regenerate using the correct documents.

1. In Modeler, replace the existing document types (leave the string isValid) with:
• PORequest (from TN)
• acme.purchaseOrder.docs.request:OrderRequest and
acme.purchaseOrder.docs:OrderCanonical.
2. Generate, update for monitoring, and quit the Modeler.
3. In Developer, edit each of the generated Flows:
• newOrders – Add the logic to process the TN document
• validate – Invoke your acme.purchaseOrder.utils:inspectLineItems
• mapCanonical – Invoke your
acme.purchaseOrder.maps:orderRequestToCanonical
• insertORMS – Invoke your acme.purchaseOrder.utils:insertOrderCanonical
• generalErrors – Invoke savePipelineToFile to write the whole pipeline out to
generalErrors file.
4. Save your work!

Exercise 20:
Enable and Test OrdersInbound
Overview
In this exercise, you will use My webMethods, TN Console, and the TN Web Manager.

Estimated Completion Time


30 minutes

Task
The time has come to test your process OrdersInbound
1. In My webMethods, Enable your model.
2. Using Wordpad, copy the contents of
C:\webMethods6\IntegrationServer\packages\AcmeSupport\pub\PORequest.xml and
paste it in the document submission form of TN Web Manager WmTNWeb.
3. Submit the document ensuring that the element ProprietaryDocumentIdentifier is
unique every time you send the document to TN.
4. In My webMethods, find and select the new process instance. Do you see the tick
marks all the way to the end?
5. Run the Select Adapter services you created earlier. Do you see the Header and
Details entries in the Oracle tables?
6. In TN Console, run the Transaction Analysis query. Do you see your submitted
Document Type? Are Sender, Receiver and ConversationID correct?
7. In My webMethods, change the isValid field in the mapCanonical step from “true”
to “false”. Resubmit and look at the Instance numbers. Did it increase? Did your tick
marks change?

Anda mungkin juga menyukai