Sie sind auf Seite 1von 45

Webmethods Architecture

Webmethods ESB Integration


Design: The Business Process

> 120 s
Wait
TimeOut
Wait for Map Wait for
PORequest OrderCanonical Notification
(TN) isValid = false
Handle
isValid = true InvalidOrder

Validate Database Map


Insert
OrderRequest Insert
Notification OrderAccept

Send ACK
(TN)
Design: The Logic

TimeOut – write > 120 s


message to
Map debuglog
Get PORequest and Wait for
map it to OrderRequest to
OrderCanonical Notification
OrderRequest isValid = false Invalid Order –
write a message
isValid = true
to debuglog

Validate line items in Insert Valid Order –


OrderRequest & set ORDER_HEADER & Insert map data to
isValid = true or false ORDER_DETAILS in Notification OrderAccept
Oracle

Convert OrderAccept to a
bizdoc & route to TN.
Doc will be identified and
ProcessErrors a business rule will
change the User Status =
Delivered

Let’s assume it will then be send to the customer!


Design: Steps

 Define logical Servers and initial Use IS (defined in the exercise)


Physical Server
 Model Tasks
 Configure inputs/outputs, transition You will need a Correlation Service

types, needed properties


 Generate to INITIAL logical Server
 Make available to be Monitored
For these 2 tasks, simply write messages
 Enhance the generated code using debuglog

 Enable the process (Using Monitor) Handle Wait


InvalidOrder TimeOut
 Test
 Monitor
Test: The Input & The Result!

Wait for
PORequest
(TN)

Change with every submit

Send ACK
(TN)
Assemble: Over to you!

 Task 10: Model


 Task 11: Generate – No errors should be reported
 Task 12: Modify generated code
 Task 13: Enable & Test – ACK should appear in TN
 Task 14: Monitor – you should see happy tick marks all the
way through!
Appendixes
Web Container

Mixed Monitoring

Java Services
Tomcat Web Container

 A Web Container is the J2EE term for a software engine that supports the
running of Java Servlets and Java Server Pages (JSP)
 Tomcat is the Web Container created by the Apache Jakarta project
 Apache is the world’s leading HTTP (Web) Server
 Jakarta is the Java Run Time Environment for Apache
 Tomcat is Open Source
 Plugged into Integration Server 6.0 instead of Jakarta
 Source is unmodified for IS 6.0
 Configuration Changes Required
 Disable Native HTTP stack and use IS instead through Connector API
 Tomcat Custom Security Realm plugin for WebMethods IS Security
 Reconcile with IS Directory and Package structures
What the Web Container Provides

 Running Java Servlets and Java Server Pages (JSP)


 The Workflow Servlet is already integrated
 JSP is a technology that allows developers to create
dynamic HTML and XML content using a standard
scripting language
 An IS JSP Tag Library is in development allowing DSP
use to be replaced with the standard JSP approach
 Theoretically there is a JSP for every DSP we use
 Some porting will be required for some system DSP pages
IS 6.0 Tomcat Configuration

 IntegrationServer\web directory
 webMethods JSP Tag Library
 webm-taglib.tld
 conf directory
 Global web.xml containing a default
<web-app> definition, providing defaults
for all Tomcat Web Apps
 wars directory
 WAR (Web ARchive) files
 Standard Web App deployment file
 Example Workflow
 Workflow\WEB-INF contains web.xml
file for Workflow Web App
 Workflow\WEB-INF\lib contains
implementation files (*.jar)
 work directory for app work areas
Tomcat Configuration (continued)

 Packages which have Web Apps


have their own web directory
 webMethods JSP Tag Library
 webm-taglib.tld
 If you need to use it you must have a
copy in your web/WEB-INF directory
 To invoke Web Apps:
 App named appName.jsp in package
WmSamples
 invoke
/web/WmSamples/appName.jsp

 Tomcat writes logging information to


the Core IS log server.log
Web Container – directory structure
Web Container – tags

<%@ page language="java" %>


<%@ taglib uri="webm-taglib.tld" prefix="webm" %>
<html>
<head>
<title>Product Catalog</title>
</head>
<body bgcolor="#FFFFFF">
<h3>Product Catalog</h3>
<P align="right"> <a href="ViewCart.jsp">View Shopping Cart</a>
<webm:invoke serviceName="ShoppingCart.JDBC:FindProducts">
<table BORDER WIDTH="100%" >
<tr>
<td><b>ProductID</b></td>
<td><b>Title</b></td>
<td><b>Author</b></td>
<td><b>Description</b></td>
<td><b>Price</b></td>
<td> </td>
</tr>
<webm:loop variable="ProdList">
<tr>
<td><webm:value variable="ProductID"/></td>
<td><webm:value variable="Title"/></td>
<td><webm:value variable="Author"/></td>
<td><webm:value variable="Description"/></td>
<td>$<webm:value variable="Price"/></td>
<td><A HREF="DisplayCatalog.jsp?title=<webm:value variable="Title"/>&id=<webm:value
variable="ProductID"/>&price=
<webm:value variable="Price"/>">BUY</A></td>
</tr>
</webm:loop>
</table>
Web Container – processing the pipeline

<webm:invoke serviceName="ShoppingCart.JDBC:InsertOrders">
<webm:usePipeline>
<%-- out.println("The pipeline = " + webm_pipe.toString()); --%>
<%
IDataCursor c1 = webm_pipe.getCursor();
IData d = (IData)IDataUtil.get(c1, "GetLastOutput");
IDataCursor c2 = d.getCursor();
String inputstr = IDataUtil.getString(c2, "OrdID");
Web Container

Mixed Monitoring

Java Services
Mixed Monitoring environment

Ter1 jdbc
Broker 5 Broker 6
Logger
TerBrok5 TerBrok6

1
processLog
Integration 1
Monitor WorkflowLog

G V

IN OUT Log

1 1
Order processLog

Logging Utility
Monitor
Components 1 Audit Runtime 1
(Programming Logic) JDBC/File Transient

Adapter Integration Server


Mixed Monitoring environment

 To Use Monitor 6 (option 1):


 Connect the 4.x adapter to the Broker 6 instead of a Broker 5.
 Turn Broker logging on for Broker 6 (NOT for Broker 5).

 To Use Monitor 6 (option 2):


 Keep 4.x adapter attached to Broker 5.
 Create a trigger for the 4.x "processLog" document on the IS 6 that executes a no-op service. This
ensures that the processLog docs are forwarded to the Broker 6 connected to the IS 6.
 Turn Broker Logging on for the Broker 6 (NOT for the Broker 5).
 Set the IntegrationServer Client Group to log Acknowledge types =Adapter::processlog.

 Or keep monitoring separate!

Remember to enable logging in Enterprise Integrator!


Mixed Monitoring environment – EI 46 Setting
Mixed Monitoring environment – Option 2
setup
webM 6 Service Logging – Monitoring
Enterprise 46 Components

Search criteria such as dates, or


Component names
webM 6 Service Logging – Monitoring
Enterprise 46 Components

The 46 Component

To resubmit, select the Document ID


and resubmit as shown earlier
webM 6 Service Logging – Monitor Resubmit

You can now resubmit this document


Web Container

Mixed Monitoring

Java Services
Objectives

At the end of this section, you will be able to:


 Describe the capabilities of webMethods Java
Services
 Create and use IData or Pipeline objects
 Write a Java Service
What is the Pipeline?

 An IData Object
 It is an IData object that contains an ordered collection of
name/value pairs on which a service operates
 It can contain any number of elements of any valid Java object,
including other IData objects
 Instantiated by server when the service is run
 Dropped when service completes
Input / Output & IData

 A Service takes one, and only one, input variable – a


Pipeline.
 The service extracts the actual input values it needs from the
elements of an IData object

 A Service returns output by inserting it into the pipeline


(IData)
 Multiple invokes within a service manipulate the same
Pipeline IData object
Service Signature

public static final void


can be invoked by use a single (static) do not extend does not
other services instance for all – improves return an
invokes – maximize performance object
throughput,
minimize memory
load
Service Signature

stringCompare ( IData pipeline ) throws


service name is the Takes IData object ServiceException
method name named “pipeline” as failure on invoke
input produces a
ServiceException object
The IData interface and Cursors

IData operations come in two parts


– Position the cursor
– get/set the data

• The IData interface looks like this:


public interface IData
{
public IDataCursor getCursor();
public IDataCursor getSharedCursor();
}
IData in Action

Code:
IData Position
populatedCursor
Code:instantiated
IData
Code: Get Value
Get Cursor

input1
input1
input1 Hello
Hello
Hello IData.getCursor();
Integration
Server
http post Trading
Trading
Networks
Networks
input2
input2
input2 World
World
World
Data arguments:
input1 = Hello String myInput =
Cursor.first(“input2”);
input2 = World (String)
Cursor.getValue();
Cursor Types

Cursor Type Description


IDataCursor the basic one, for all cursor
manipulations.

IDataSharedCursor for advanced cursor manipulation


Not discussed in this class
Using a Cursor

IDataCursor Useful Methods

Moving / Searching first(), first(String key), next(), next(String


key), previous(), previous(String key), last(),
last(String key)

Get Data getValue(), getKey()

Set Data insertAfter(String key, value),


insertBefore(String key, value), setValue(),
setKey()
Example Code

create Cursor

get string1
from pipeline

get string2
from pipeline

do work

output
results
IData & Records

 Document objects are also IData objects


 To manipulate them inside a service, use IDataFactory to
instantiate an IData object
 IDataFactory is a factory class which has static create () methods.
 With this technique the user code is not directly aware of the
concrete implementation
 IData is an interface
 The IData implementation does not have a public constructor – you
cannot use “new”
Instantiating Documents in Code

static IData addrDoc; addrDoc IData object


static companyName Jones, Ltd.

{
addrDoc = IDataFactory.create();
addr1 12 High St.

IDataCursor addrCursor = addrDoc.getCursor(); city London


addrCursor.last();
addrCursor.insertAfter(“companyName", “Jones, Ltd.”);
addrCursor.insertAfter(“addr1", “12 High St.”);
addrCursor.insertAfter(“city”, “London”);
}
Pipeline Object Data Types and Java

String java.lang.String

String List java.lang.String [] – a string array

String Table Two-dimensional String array

Document Structure containing various data types IData

Document List Same as Document, but an array IData []

Object Doesn’t fit one of the already listed types


Any subclass of java.lang.Object (java.util.InputStream)

Object List Same as object, but array type.


e.g. java.util.InputStream [ ]
Java Object Data Types

• DeclareObjects, Object Lists


• Under Properties, apply Constraints by selecting a Java
class type
Coding Using Developer

 Create an empty Java service


 Specify the input/output
 Use the “Input/Output” tab in the Service Tab area
 (Optional) Generate code for implementing this
service, and paste it in the source block
 Specify packages to be imported
 Use the “Imports” section of the “Shared” tab
 Type your source code
 Use the “Source” tab in the Service Tab area
 (Optional) Type code to be shared by all services in
this folder
 Use the “Source” section of the “Shared” tab
Java using the Developer (1)

Create Java Service Create Input/Output


Java using the Developer (2)
Java using the Developer (3)

Imported Java packages

Shared, private source


Java using the Developer (4)

Input

Your Logic Here

Output
Integration Server Code Namespace

Source Code
…\packages\package-name\code\source\folder\folder\…

Compiled Code
…\packages\package-name\code\classes\folder\folder\…

Das könnte Ihnen auch gefallen