bea.com | products | dev2dev | support | askBEA |
![]() |
![]() |
|
![]() |
e-docs > WebLogic Platform > WebLogic Integration > AI Topics > Using Application Integration > Using Application Views in the Studio |
Using Application Integration
|
Using Application Views in the Studio
This section presents the following topics:
Before You Begin
After you create all the Application View services and events that are required for your enterprise, you can use the resulting Application Views to execute your business processes. The simplest way to do this is by using the WebLogic Integration Studio to design business process workflows that use your Application View services and events.
The WebLogic Integration Studio is a graphical user interface (GUI) for designing business process workflows. These workflows can include Application View services and events defined using WebLogic Integration. For details, see Using the WebLogic Integration Studio.
Before you can invoke an Application View service or receive an Application View event in the WebLogic Integration Studio, you must make sure the following prerequisites have been met:
Workflow Setup Tasks
The following sections describe four tasks you may perform to set up your workflow to use Application View services and events:
You can perform any combination of these tasks to create your own workflows.
This document does not fully explain how to use the business process management (BPM) functions provided by WebLogic Integration; for complete information, see Learning to Use BPM with WebLogic Integration.
Task 1: Set Up a Task Node to Call an Application View Service
In your organization, there may be situations in which you want to call an Application View service from within a workflow. To make this type of call possible, add a task node to the workflow, then add an appropriate Application View Service action to the task node. Once the workflow is saved and activated, the Application View service is called whenever the task node is executed.
Steps for Setting up a Task Node to Call an Application View Service
To create a task node that calls an Application View service, complete the following procedure:
Whichever option you select, the Service Request Template dialog box is displayed.
The Service Request Template dialog box displays the template to be used for all service requests of the type specified in step 11. This template is based on the input schema for the service.
When this action is executed, the template data is assigned to the specified request document variable and used as the input document for the service. This template overrides any previous setting for the variable. (If you set up a template and then want to use the previous input variable instead of the new input variable, the easiest way to do this is to delete the Call Application View Service and recreate it.)
For details about using the Service Request Template dialog box, see Using the WebLogic Integration Studio.
Note: When you set up a task node to call an asynchronous Application View service, the result is returned to the Studio. The workflow identifies this response using the request ID variable you selected. To set up an event node to receive the response, make sure to use the same request ID variable for the event node. For more information about creating such an event node, see Task 2: Set Up an Event Node to Wait for a Response from an Asynchronous Application View Service.
Task 2: Set Up an Event Node to Wait for a Response from an Asynchronous Application View Service
This section explains how to receive an asynchronous Application View service response and handle any errors it may contain.
In a workflow, whenever an action calls an Application View service asynchronously, the Application View service returns a response. If you need the response, you must set up a corresponding asynchronous event node to wait for it. This section describes a highly simplified scenario in which an event node receives an Application View service response without checking for errors.
To set up an asynchronous event node to wait for a response from an asynchronous Application View service, create an event node and configure it to wait for an event of type AI Async Response.
Configuring Receipt of a Response
To set up an event node to receive an asynchronous service response, you can use either of the following methods:
Note: Use of the Response Document tab is preferred because it provides a universal means of receiving both asynchronous and synchronous responses. When you use this method, an XML document is received regardless of whether the response is asynchronous or synchronous, and you do not need to query the value of the asynchronous service response variable.
We recommend using a response document variable to receive asynchronous service responses whenever possible. To configure a service to wait for an event of type AI Async Response, use the Event Properties dialog box. This dialog box may or may not offer you the choice of using an asynchronous variable to receive the response. Whether this choice is available depends on the following conditions:
Handling Errors in an Asynchronous Application View Service Response
Although this task does not include the configuration of error handling for the Application View service response, you may want to handle errors in your own workflows. To handle asynchronous service response errors in workflows that use an AsyncServiceResponse variable, you can use the features provided by the application integration plug-in.
The application integration plug-in includes the variable type AsyncServiceResponse and three functions:
For a complete description of these functions, see Functions Provided by the Application Integration Plug-In.
Procedure for Configuring Receipt of an Asynchronous Service Response (Preferred Method)
To set up an asynchronous event node to wait for a response from an asynchronous Application View service, create an event node and configure it to wait for an event of type AI Async Response.
To set up an event node to use an XML variable to receive an asynchronous service response, complete the following procedure:
Note: The purpose of this event node is to wait for a response to a Call Application View Service action that was called asynchronously earlier in the workflow. The Call Application View Service action sets the request ID variable. The action and this event node can work together only if both use the same request ID variable. For more information about setting up the Call Application View Service action, see Task 1: Set Up a Task Node to Call an Application View Service.
Procedure for Configuring Receipt of an Asynchronous Service Response (Legacy Method)
The preferred method for receiving an asynchronous service response is to use a response document variable of type XML. However, if an existing workflow contains an asynchronous event node that was previously set up to use an AsyncServiceResponse variable (to wait for a response from an asynchronous Application View service), you can modify the event node.
To modify an event node that uses an AsyncServiceResponse variable to receive an asynchronous service response, complete the following procedure:
Note: The purpose of this event node is to wait for a response to a Call Application View Service action that was invoked asynchronously earlier in the workflow. The Call Application View Service action sets the request ID variable. The action and this event node can work together only if both use the same request ID variable. For more information about setting up the Call Application View Service action, see Task 1: Set Up a Task Node to Call an Application View Service.
Note: Because you are modifying an existing asynchronous event node, the asynchronous service response variable field is already populated. If you do not need the response, select the Response Document (preferred) tab. For details about using the preferred method, see Procedure for Configuring Receipt of an Asynchronous Service Response (Preferred Method).
Functions Provided by the Application Integration Plug-In
If your enterprise includes AI Async Response variables and you want to interrogate those variables while using the application integration plug-in, use the following functions:
Using these functions, you can set up decision nodes to handle success and failure conditions.
Note: These functions are available only if the application integration plug-in is installed, and they support only the asynchronous variable method for receiving asynchronous service responses. For details, see Procedure for Configuring Receipt of an Asynchronous Service Response (Legacy Method).
AIHasError()
Use AIHasError() to determine the status of an asynchronous service response. The following table provides details about this function.
AIGetErrorMsg()
Use AIGetErrorMsg() to retrieve the error message string returned by an asynchronous Application View service. The following table provides details about this function.
AIGetResponseDocument()
Use AIGetResponseDocument() to retrieve the XML response document returned by an asynchronous Application View service. The following table provides details about this function.
Task 3: Create a Workflow Started by an Application View Event
It is sometimes desirable to have a workflow that is started whenever a designated Application View event occurs. To create such a workflow, edit the workflow's start node so it responds to an event of type AI Start, then select the appropriate Application View event. If necessary, you can set up conditions with which the event can be filtered. After you save and activate the workflow, the start node is executed each time the Application View event occurs.
Steps for Creating a Workflow Started by an Application View Event
To set up a workflow with a start node that is triggered by an Application View event, complete the following procedure:
You must also define the expression that locates the key value in the XML for the incoming Event, so that WebLogic Integration can compare the incoming key value to the specified key value. If there is no key value expression, you are prompted to create one before you can save the event.
The Event Descriptor for AI Events is the fully qualified Application View event name in the following form:
namespace.Application View name.event
Root is not part of the fully qualified event name. The Event Descriptor field is filled in automatically if the key value expression is created directly from the event dialog box. To accept each instance of the specified Application View event regardless of its contents, leave this field blank.
Task 4: Set Up an Event Node to Wait for an Application View Event
In a workflow, it is sometimes desirable to have an event node that is triggered by an Application View event. To create such a node, edit an event node so it responds to an event of type AI Event, then select the appropriate Application View event. If necessary, you can set up conditions with which to filter the designated Application View event. After you save and activate the workflow, the workflow progresses to this event node, waits for a specified Application View event, and continues processing.
Steps for Setting Up a Node to Wait for an Application View Event
To set up an event node to be triggered by an Application View event, complete the following procedure:
You must also define the expression that locates the key value in the XML for the incoming Event, so that WebLogic Integration can compare the incoming key value to the specified key value. If there is no key value expression, you are prompted to create one before you can save the event.
The Event Descriptor for AI Events is the fully qualified Application View event name in the following form:
namespace.Application View name.event
Root is not part of the fully qualified event name. The Event Descriptor field is filled in automatically if the key value expression is created directly from the event dialog box. To accept each instance of the specified Application View event regardless of its contents, leave this field blank.
Handling Application View Local Transactions in Workflows
The LocalTransaction interface is exposed to adapter clients via the Common Client Interface (CCI) Connection class. Currently the Application View interface does not use the CCI LocalTransaction interface. To manage a local transaction, a user must first acquire a LocalTransaction from the Connection object.
Local Transaction Management Contracts
A local transaction management contract is created when an adapter implements the javax.resource.spi.LocalTransaction interface to provide support for local transactions that are performed on the system's underlying resource manager. This type of contract enables an application server to provide the infrastructure and run-time environment for transaction management. Application components rely on this transaction infrastructure to support their component-level transaction model.
For more information about transaction demarcation support, see:
http://java.sun.com/blueprints/guidelines/designing_enterprise_applications/transaction_management/platform/index.html
Connector Support for Local Transactions with No User Defined Transaction Demarcation
The following is a scenario for supporting Application View local transactions within the Application Integration Plug-in. This scenario is similar to TX_REQUIRES_NEW for EJB transactions because the connector supports only local transactions.
In this scenario, the Connector supports only local transactions and the BPM designer does not explicitly demarcate the start and end of a local transaction. WebLogic Integration allows the Connector to participate in the global transaction by providing an XA Wrapper around the LocalTransaction object. The XA Wrapper no-ops all methods on the XAResource interface that can not be delegated to the LocalTransaction instance. WebLogic Integration allows only one non XA resource in the transaction chain. As a result, a user can have only one Application View LocalTransaction within a workflow.
Connector Support for XA Transactions
In this scenario, Application View services are not called within a local transaction. Each service invocation is automatically enlisted in the Global XA transaction because the resource adapter supports XA.
![]() |
![]() |
![]() |
![]() |
||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |