Guide to Building Business Processes

     Previous  Next    Open TOC in new window  Open Index in new window  View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Interacting With Resources Using Controls

BEA WorkSpace Studio controls make it easy to access enterprise resources, such as databases, Enterprise Java Beans (EJBs), and Web services, from within your application.

When you access a resource through a control, your interaction with the resource is greatly simplified; the underlying control implementation takes care of most of the details for you. You add an instance of a control to your business process project and then invoke its methods. Controls expose Java interfaces that can be invoked from your business process.

You can use controls generated from other services built with BEA WorkSpace Studio or generate controls from WSDL files available from other services (regardless of the programming language in which those services were implemented).

 


Designing Interactions Between Business Processes and Resources

Control Send nodes represent points in business processes at which processes send asynchronous messages to resources (via controls). Control Receive nodes represent points in business processes at which processes receive asynchronous messages from resources (via controls). A business process waits at a Control Receive node until it receives a message from the specified control. Control Send with Return nodes handle synchronous exchange of messages between business processes and resources (via controls). These three types of controls are mutable. In other words, you can change them into another type of control by dragging and dropping a control method of a different type.

This section describes how to add nodes to your business process that represent the interactions of your business process with resources. It includes the following topics:

 


Create Control Nodes in Your Business Process

To Create a Control Node in Your Business Process

In the Design view, an interaction between a business process and an external resource is represented by one of three Control nodes: Control Send, Control Receive, or Control Send with Return. The following steps describe how to add a Control node to your business process:

  1. On the Package Explorer pane, double-click the business process (Process.java file) you want to design.Your business process is displayed in the Design view.
  2. Add a control node to your business process using one of the following methods:
Drag and Drop a Method from a Control in the Data Palette onto the Design View
    1. If the Data Palette is not visible in BEA WorkSpace Studio, choose Window > Show View > Data Palette from the BEA WorkSpace Studio menu.
    2. If you have already added an instance of your control to your business project (see Adding Instances of Controls to Your Business Process Project), select the relevant method on that control by clicking the method in the Data Palette.
    3. Drag and drop the method onto the business process in the Design view at the location at which you want to define the interaction.
    4. As you drag your selection onto the Design view, targets Control Nodes appear on your business process. Each target represents a location in the flow where you can place the node. As you drag the node near a location, the target is activated Control Nodes and the cursor changes to an arrow Control Nodes. When this happens, you can release the mouse button and the node snaps to the business process at the location indicated by the active target. If the location you chose is not a valid one, an Control Nodes will appear next to your node. If you place your cursor over this icon, WebLogic Workshop will display a message about the violation.

      The Control node is created in your business process in the Design view; it is named according to the method you dragged and dropped from the Data Palette.

Create a Control in the Design View First, Then Assign the Appropriate Method
    1. If the Node Palette is not visible in BEA WorkSpace Studio, choose Window > Show View > Node Palette from the BEA WorkSpace Studio menu.
    2. If you have not yet created a control, click the control on the Node Palette that fits the action you want to create:
    3. Control Nodes Control Send—Choose the Control Send if you want to create an asynchronous call from your business process to a control.

      Control Nodes Control Send with Return—Choose the Control Send with Return node if you want to create a synchronous call from your business process to a control.

      Control Nodes Control Receive—Choose the Control Receive if you want to create a handler for a callback from a control to your business process.

    4. Drag and drop the Control node onto the business process in the Design view at the location at which you want to define the interaction.
    5. The Control node is created in your business process in the Design view, it is named Control Send, Control Send with Return, or Control Receive, depending on which control you dragged onto the Design view from the Node Palette.

      The node in the Design view indicates only the type of interaction (asynchronous send, asynchronous receive, or synchronous send/receive) between your business process and a resource; it does not identify the resource. Control Nodes is a placeholder for a type of control. That is, it represents a location in your business process where you must specify the type of resource (control) with which you want your business process to interact.

    6. Specify the control for this placeholder node in one of the following ways:
    7. – Drag a control method from an instance of a control in the Data Palette and drop it onto the placeholder control in the Design view. (To learn how to add instances of controls to your project, see Adding Instances of Controls to Your Business Process Project.)

      – Double click the placeholder control Control Nodes in the Design view to open the node builder for this control and complete the specifications in the node builder.

Note the following properties for the Control nodes:

  1. To save your work, select File > Save.

 


Designing Your Control Nodes

Designing the Control nodes includes adding an instance of the control with which you want your business process to interact, then specifying the methods on the control, and the variables to which the messages exchanged between your business process and the control are assigned. This section describes how to design Control nodes. It includes the following topics:

 


Adding Instances of Controls to Your Business Process Project

To Add an Instance of a Control to Your Business Process Project

Before you can specify the resource with which your business process interacts at this node, you must add an instance of the associated control to your project.

To add an instance of a control to your project:

  1. If the Data Palette pane is not visible in BEA WorkSpace Studio, choose Window > Show View > Data Palette from the menu bar.
  2. Click Control Nodes on the Data Palette. A drop-down list of controls that represent the resources with which your business process can interact is displayed. Instances of controls already available in your project are displayed in the Controls tab.
  3. Select a control from the Integrations Controls drop-down menu.
  4. Note: Table 5-1contains information about the standard controls used in WebLogic Integration. Other custom and plug-in controls may be available.

    Table 5-1 Controls in WebLogic Integration
    Type of Control
    Description
    ALSB
    The ALSB control enables a business process to invoke a ALSB proxy service via RMI with security and transaction context propagation support.
    Dynamic Transformation
    The Dynamic Transformation control provides a business process with the ability to dynamically select and invoke a query during run time. Specifically, this control allows a business process to dynamically select a particular XQuery, XSLT, or MFL file at run time. You use this control after creating and testing your XQuery files with the Transformation control during design.
    ebXML
    The ebXML control enables BEA WorkSpace Studio business processes to exchange business messages and data among trading partners via ebXML (Electronic Business using eXtensible Markup Language). ebXML is a business protocol that enables enterprises to conduct business over the Internet. The ebXML control supports both the ebXML 1.0 and ebXML 2.0 messaging services.

    Note: The ebXML control is available in BEA WorkSpace Studio only if you are licensed to use WebLogic Integration.

    Email
    The Email control enables BEA WorkSpace Studio Web services and business processes to send e-mail to a specific destination. The body of the e-mail message can be text (plain, HTML, or XML) or can be an XML object. The control is customizable, allowing you to specify e-mail transmission properties in an annotation or to use dynamic properties passed as an XML variable.
    File
    File controls can be used to read and write XML and binary files to a local file system. In addition, through the use of a callback mechanism, the files in a specified directory can be read as they are created in a directory.
    Http
    This control enables BEA WorkSpace Studio and business processes to work with HTTP requests and to send responses to a specific URL. It supports two modes for data transfer: GET and POST. By using the GET mode, you can send your business data along with the URL. By using the POST mode, you can send binary, XML, and string documents. You can specify HTTP properties in an annotation, or pass dynamic properties via an XML variable.
    MB Publish
    Message Broker (MB) Publish controls allow your business process to publish messages to Message Broker channels.
    Publish and subscribe messaging to Message Broker channels is accomplished in similar fashion to publish and subscribe messaging to JMS topics, but a Message Broker channel is optimized for use with BPM (business process management) services. The Message Broker provides typed channels to which messages can be published and to which services can subscribe to receive messages. Message Broker also supports a message filtering capability.

    Note: The MB Publish control is available in BEA WorkSpace Studio only if you are licensed to use WebLogic Integration.

    MB Subscription
    Message Broker (MB) Subscription controls allow your business process to dynamically register for and receive messages from a Message Broker channel.
    In WebLogic Integration, subscriptions to Message Broker channels defined at a Start node are referred to as static subscriptions, and subscriptions defined using a Message Broker Subscription control are referred to as dynamic subscriptions.
    Publish and subscribe messaging to Message Broker channels is accomplished in similar fashion to publish and subscribe messaging to JMS topics, but a Message Broker channel is optimized for use with BPM (business process management) services. The Message Broker provides typed channels to which messages can be published and to which services can subscribe to receive messages. Message Broker also supports a message filtering capability.

    Note: The MB Subscription control is available in BEA WorkSpace Studio only if you are licensed to use WebLogic Integration.

    MQSeries Control
    The MQSeries control enables BEA WorkSpace Studio business processes to work with MQSeries for sending and receiving messages, to and from MQSeries queues. MQSeries is a middleware product from IBM that runs on multiple platforms and enables applications to send messages to other applications.
    Process
    A Process control provides an interface to another business process in your project. Using a process control, your business process can invoke the methods and handle the callbacks on another business process.
    To create a Process control, on the Package Explorer pane, right-click a business process (Process.java) file to display a drop-down menu. Select Generate > Process Control from the drop-down menu. BEA WorkSpace Studio creates a Business Process control file (.java file) in your project
    RosettaNet
    The RosettaNet control enables BEA WorkSpace Studio business processes to exchange business messages and data among trading partners via RosettaNet. RosettaNet is a business protocol that enables enterprises to conduct business over the Internet.

    Note: The RosettaNet control is available in BEA WorkSpace Studio only if you are licensed to use WebLogic Integration.

    Service Broker
    The Service Broker control allows a business process to send requests to and receive callbacks from another business process, a Web service, or a remote Web service defined in a WSDL file. The Service Broker control lets you dynamically set control attributes. This allows you to reconfigure control attributes without having to redeploy the application.
    TPM
    The TPM (Trading Partner Management) control provides read-only access to trading partner information stored in the TPM repository.

    Note: The TPM control is available in BEA WorkSpace Studio only if you are licensed to use WebLogic Integration.

    Task
    The Task control creates a single Task instance, manages its state and data, and provides callback methods to report status. A Task control identifies intimately with a single Task instance; their relationship is one to one. You generally use a Task control in a Process.java file like most other WLI controls and is generated specifically to interact with Task Plan.

    Note: The Task control is available in BEA WorkSpace Studio only if you are licensed to use WebLogic Integration.

    Task Batch
    The Task Batch replaces the Task Worker control from Weblogic Integration 8.x. A Task Batch helps to manage multiple tasks in its operations and is generated specifically for a Task Plan.

    Note: The Task Batch control is available in BEA WorkSpace Studio only if you are licensed to use WebLogic Integration.

    Tibco
    The Tibco control helps you to send and receive messages in XML, String, and Tibco proprietary Rendezvous Message (TibrvMsg) formats.
    Transformation
    Use a Transformation control to achieve data transformations for data in your business processes. A Transformation control can be created and edited from within communication nodes in a business process and via the File > New > Transformation option on the BEA WorkSpace Studio menu.
    WLI JMS
    The WLI JMS control is an extension for the Workshop JMS control, it is used to exchange JMS messages as part of an integration application. Once a WLI JMS control is defined, Web services and business processes may use it like any other WebLogic Workshop control.
    The WLI JMS control is available in WebLogic Workshop only if you are licensed to use WebLogic Integration.
    WLI Timer Control
    A Timer control notifies your application when a specified period of time has elapsed or when a specified absolute time has been reached.
    XML MetaData Cache
    The XML MetaData Cache control only allows you to retrieve XML metadata from the XML cache. The XML cache is managed using the WebLogic Integration Administration Console.

  5. After you select a type of control from the Integration Controls list.
  6. An Insert Control dialog box, which contains tasks specific for the control you selected, is displayed.

    Note: For WLI Timer Control and WLW Timer Control, an Insert Control dialog box do not appear.
  7. In the Insert Control dialog box, enter the information specific for the control you want to create in the Field Name and click Next.
  8. Enter the required information in Create Control wizard and click Finish.To learn about creating and configuring specific controls, see Using Integration Controls.
  9. This step completes the creation of an instance of a specific control in your application. The controls you create are displayed in the Controls tab.

    The methods available on the control are shown in the Controls tab.

  10. If you want to use an existing control created in an earlier business process (Process.java file), you can do it in the following ways:
    • Drag an existing control from the Package Explorer pane to the Data Palette, Controls folder.
    • Click Menu tab, on the Data Palette and select Local control. From the drop-down list select an exiting control.
Note About Transformations

Transformations handle mapping heterogeneous data types in your application. BEA WorkSpace Studio provides a data mapping tool to map between heterogeneous data types. The data transformations you create using the tool are stored in data transformation files. They can hold multiple transformations and are designed to enable packaging, sharing and reuse of transformation formats. When data transformation files containing your data transformations are built, they are built as controls. The controls expose transformation methods, which business processes invoke to map the disparate data types.

In addition to creating Transformations from the Controls tab in the Design view, as described in this section, you can create them in the following ways:

To Edit or Delete an Instance of a Control

In the Controls tab, right-click on the control to display a drop-down menu. Select Delete or Edit from the menu. When you select Edit, the control, including its methods and callbacks, is displayed in the Design view.

 


Configuring Control Nodes

This section describes how to finalize the design of Control nodes in your business process.

After you add a Control node specific for the type of interaction you want to design—Control Send, Control Receive, or Control Send with Return—the Control node you selected is displayed in your business process in the Design view, see Figure 5-1.

Figure 5-1 Control Nodes

Control Nodes

As with other nodes in your business process, you can design the properties and behavior of Control nodes by invoking their node builders. This section describes how to complete the design of the interaction with resources via your Control nodes.

To Invoke the Control Node Builders

Double-click the appropriate Control node in your business process to invoke its node builder.

Each Control node builder provides a task-driven interface through which you can design the communication between the Control node and a control. The tasks are displayed on tabs on Control node builders: General Settings, Send Data, and Receive Data.

The following sections describe how to specify your control settings on the tabs in the node builders:

General Settings (Select a Control Instance and a Target Method)
  1. In the node builder, click the arrow beside the Control field to display a drop-down list of the instances of controls that are available in your project. (See Adding Instances of Controls to Your Business Process Project.)
  2. Select a control from the list.
  3. The Method panel is populated with the methods available on the control you selected.
  4. Note: Asynchronous send and return methods, as well as synchronous send and receive methods can be defined for a given control. Only the methods appropriate for the kind of control node you are designing (Control Send, Control Receive, or Control Send with Return) are displayed in the list.
  5. Select the method you want to specify at this point in your business process.
  6. To close the node builder, click Close.
Send Data/Receive Data
(Map Variables to the Control Send (or Control Callback) Method Parameters)

If your Control node is expecting data or sending data, in other words it is a Control Send, a Control Receive, or a Control Send with Return, the node builders display either Send Data or Receive Data tabs in addition to the General Settings tab. Tasks on these tabs allow you to define one or more variables to map to method parameters. At run time, input data sent by your business process to controls, or data returned by controls is assigned to these variables.

  1. Click the Send Data or Receive Data tab (depending on the type of Control node you are designing).
  2. This tab allows you to define one or more variables to hold the data that your business process receives from clients.

  3. If the data types of your method parameters and the data type of the variables you are going to use match, you can map your variables to the corresponding methods directly.
    1. If not already selected, select the Variable Assignment option.
    2. The Control Expects field is populated with the parameter(s) you specified on the General Settings tab.

    3. If you want to assign a variable that you already created in your project to the method parameters, select it from the drop-down menu.
    4. If you want to create a new variable and assign it to the method parameter, select Create new variable..., then follow the instructions in the To Create a New Variable in the Node Builder section.
    5. If the data types of your method parameters and your variables match, click Close to close the node builder.
  4. If the data types of your method parameters and your variables are different, you can use the data mapping tool included in BEA WorkSpace Studio to map between heterogeneous data types. The data transformations you create using the tool are stored in data transformation files. When data transformation files containing your data transformations are built, they are built as controls. The controls expose transformation methods, which business processes invoke to map disparate data types.
    1. To create a transformation map, select the Transformation option.
    2. The node builder transformation screen is displayed with the data types expected by your method displayed in the Control Expects pane.

    3. In Step 1 of the Transformation option window, click Select Variable to select one or more variables to be used.
    4. Note: To remove a variable from the node builder pane, select the variable in the list and then click Remove. This action removes the variable from the node builder, not from your business process. The variable is still included in your business process; it is visible in the Variables pane in the Data Palette.

      When designing a business process, you use a Transformation to create maps between disparate data types. Your project must contain an instance of a Transformation control defined by a data transformation file) for you to create the map.

    5. If an appropriate instance of a Transformation control is not available in your project, you can create a new one by clicking Create Transformation to invoke the Transformation Mapping tool window. This automatically applies changes to the builder and opens a transformation editor in a new window.
    6. The mapping tool displays a representation of the source schema and target schema in Source and Target panes. You can create a map between the data type of the method parameter and the data type of the variable, or variables, to which you assign the data.

      Note: To return to node builder, in the Package Explorer pane, double-click the Process.java file.
    7. If the appropriate instance of a Transformation control is available in your project, click Advanced.... The Advanced Option window opens. In this window, select the Control and Method. If the method arguments and return type matches those as selected in the Transformation pane, click OK.
Note: In the Advanced Option window, if you enter the right input parameter and it matches with the signature of the transformation method, the Ok button will be enabled.
  1. To close the node builder, click Close.
  2. In the Design view, the Control Nodes icon indicates that you completed the configuration and design of this node and Control Nodes is replaced with an icon that represents the resource with which this node communicates. That is, a new control-specific icon replaces the former placeholder icon.

  3. To save your work, select File > Save.

Related Topics

Guide to Data Transformation

 


Setting Control Properties and Annotations

Instances of controls that you create in your business process are represented in the Data Palette. You can view and edit the properties of control instances and their parent types in the JPD Configuration pane and Properties pane.

To View and Edit Properties for Control Types

To View and Edit Annotations for Control Instances

To View and Edit Properties for Control Types

Double-click the control type on the Package Explorer pane.

The file is displayed in the Source view, and its properties are displayed in the JPD Configuration pane. The properties you see and edit in the JPD Configuration pane depend on the control you are using.

Values you specify for the properties in the JPD Configuration pane are written to the file. In other words, the Source view is updated in keeping with the work you do in the JPD Configuration pane. Properties you specify for the control are inherited by any instances of the control you create based on this type.

To View and Edit Annotations for Control Types

The file is displayed in the Source view, and its annotations are displayed in the Properties pane. The properties you see and edit in the Properties pane depend on the control you are using.

Values you specify for the annotations in the Properties pane are written to the file. In other words, the Source view is updated in keeping with the work you do in the Properties pane. Annotations you specify for the control are inherited by any instances of the control you create.

Follow the above, to view and edit annotations for control instances.

To View and Edit Annotations for Control Instances

Double-click the control instance in the Data Palette to display its properties in the Properties pane. The annotations you can see and edit depend on the control you are using. Note that when you open the Properties pane for an instance of a control, the annotations for that instance, are listed at the top of the Properties pane. You can edit the referenced control properties by opening the file as described in To View and Edit Properties for Control Types.

Note: Follow the above instructions for the annotations.

  Back to Top       Previous  Next