![]() |
![]() |
|
|
Using BEA WebLogic Process Integrator with JAM
WebLogic Process Integrator is a process modeling tool and workflow environment that combines the functions of static data and server administration, workflow definition, and workflow monitoring.
WebLogic Process Integrator may be used with JAM to provide the following key features:
This section discusses the following topics:
WebLogic Process Integrator Overview
WebLogic Process Integrator is a Java implementation of a workflow management system. A workflow management system has been defined as one that "...defines, manages, and executes workflows through the execution of software whose order of execution is driven by a computer representation of the workflow logic."
Such a system automates a business process by merging the sequence of activities and invoking the appropriate resources required by the various activities or steps. Individual business processes may have life cycles ranging from minutes to days (or longer), depending on the complexity and duration of the various constituent activities. To achieve this, a workflow management system must provide support in four broad functional areas:
WebLogic Process Integrator Architecture
At the center of the WebLogic Process Integrator architecture is the Process Engine, which serves as the run-time controller and is responsible for keeping track of workflow instances and managing the execution of workflows. The high-performance WebLogic Process Integrator workflow engine has been developed using a breakthrough embedded workflow-enabling approach that is written in 100% pure Java.
The WebLogic Process Integrator data and server administration facility allows users to administer components of the WebLogic Process Integrator server and database. More specifically, it allows users to maintain functions such as adding, updating, deleting users, roles, and organizations; disconnecting users and shutting down the server, rerouting tasks from one user to another, and creating calendars that are used in workflow definition.
The WebLogic Process Integrator workflow definition facility allows users to graphically create and edit workflows, mapping out the tasks in the workflow and the business rules that must be followed. Workflow definitions are used as templates, which can be used to create multiple workflow instances.
The WebLogic Process Integrator workflow monitor facility allows users to monitor and modify workflows. More specifically, it allows users to perform functions such as displaying the status of workflow instances, modifying the tasks associated with a workflow instance (for example, re-assigning work tasks or forcing work to be re-done), creating a variety of customized reports on workload and statistical data, and viewing a user or role worklist in order to dynamically maintain workflows.
Finally, the WebLogic Process Integrator worklist facility provides users with a list of tasks describing work currently assigned to them (or the roles to which they belong) and provides the means for users to select and perform those tasks.
The following diagram illustrates the WebLogic Process Integrator architecture.
Figure 8-1 WebLogic Process Integrator Architecture
Integration with JAM
When using WebLogic Process Integrator with JAM, the WebLogic Process Integrator functions vary depending upon the type of request:
JAM's mechanisms for implementing both WebLogic Process Integrator to mainframe and mainframe to WebLogic Process Integrator requests have been tailored to the capabilities of WebLogic Process Integrator. WebLogic Process Integrator to mainframe requests make use of an object-based interface. Mainframe to WebLogic Process Integrator requests make use of an XML event interface.
WebLogic Process Integrator to Mainframe Requests
WebLogic Process Integrator to mainframe requests are the most frequent type of communication. In a WebLogic Process Integrator to mainframe request, a workflow requires a service from the mainframe application. The invocation of a mainframe application is essentially a two step process: the input message required by the remote application is created and the service is invoked.
JAM facilitates this interaction with the following tools:
The eGen portion of JAM can generate an additional class that is required to facilitate data creation within a workflow. This additional class is generically known as a "document holder." The document being held is the message required for the mainframe service. eGen creates a document holder as part of the code generation from the mainframe COBOL copybook.
JAM also uses an EJB, called ApplicationView, that matches the WebLogic Process Integrator service invocation with the eGen client that packages the service request for the JAM gateway.
Using the eGen COBOL Utility for WebLogic Process Integrator to Mainframe Requests
The general process for using JAM with WebLogic Process Integrator for WebLogic Process Integrator to mainframe requests is to run the eGen COBOL utility with the mainframe COBOL copybook. This process results in the standard eGen/JAM output of java source for client and dataview. The following new outputs are provided:
The compiled version of the document holder is provided to the workflow developer, while the client and dataview is deployed in the WebLogic server the way JAM clients currently are deployed. Refer to Developing Java Applications for further details on developing and deploying applications using JAM.
Workflow Development for WebLogic Process Integrator to Mainframe Requests
The document holder provides the workflow developer with methods to instantiate and populate a document object for use in a mainframe service request.
Following is the general sequence of activities for workflow development:
When the business operations have been declared, a workflow can make reference to them. General usage of a document holder follows a standard pattern.
This general process could encompass a large number of workflow operations depending on the complexity of the data. The workflow could be manually started, in which case the factory invocation could be specified in a start node. The workflow could be initiated by an XML event where the event provided the input data to populate the document object for use in the mainframe request.
The general process for using JAM with WebLogic Process Integrator for WebLogic Process Integrator to mainframe requests is illustrated in the following diagram.
Figure 8-2 WebLogic Process Integrator to Mainframe Requests from WebLogic Process Integrator
In the above figure, the Document Holder is a lightweight class for use with WebLogic Process Integrator operations. It provides a document factory for creating new document instances. The document instance is passed in to the document holder constructor when the document holder methods are used as WebLogic Process Integrator business operations. Document holder methods forward requests to actual document methods. The actual document is passed on an application view service call.
Mainframe to WebLogic Process Integrator Requests
Mainframe to WebLogic Process Integrator requests to WebLogic Process Integrator are asynchronous requests. An application used to initiate a workflow should be capable of 'request only' processing.
The general process for using JAM with WebLogic Process Integrator for Mainframe to WebLogic Process Integrator requests is illustrated in the following diagram.
Figure 8-3 Mainframe to WebLogic Process Integrator Requests to WebLogic Process Integrator
In the above figure, MyTPName is received from the mainframe. The local service name is obtained from the JCRMGW.CFG file. JAMToJMS is registered in JNDI with the local service name. The JAMToJMS EJB uses a schema name to construct a data view to convert mainframe data into XML. XML is then posted to a JMS topic found in the deployment descriptor.
Example of JAM Application Integrated with WebLogic Process Integrator
This application shows an example of JAM integration with WebLogic Process Integrator. The scenario illustrates the creation of an 'employee record' on the mainframe. This record is then read back into WebLogic Process Integrator and selected fields are extracted and stored in WebLogic Process Integrator variables. Refer to the JAM and WebLogic Process Integrator documentation for issues of operation and configuration.
This in no way is a complete illustration of WebLogic Process Integrator usage, but it does provide a starting point for constructing real workflows that interact with a JAM gateway using eGen client EJB's. Refer to your WebLogic Process Integrator documentation for more information about using WebLogic Process Integrator.
Task 1: Set Up JAM Components as Business Operations
Perform the following steps to set up JAM components as business operations:
The business operation definition dialog displays.
Any existing business operations are listed. In this example business operations from the WebLogic examples are shown. The methods for the JAM Document Helper components will also be added here.
The Add Business Operation process can accept methods from an EJB or a Java Class.
Because the JAM Data Helpers are classes, select the Java Class option.
This is the fully qualified class name including the complete package name as specified in the eGen script that created the data helper class. In this example, a package was not specified in the eGen script, so no package is required in this dialog. The class specified here must be located on the Java CLASSPATH. In this example the empRecDataHelper is located in $WLS_HOME/myserver/clientclasses.
The business operation dialog has a pull-down list of all of the available methods. Methods can be selected in any order. In this example, select the Data Factory method named newXml. This method must be used in the workflow first to create a new empRec that can then be used for the other business operations.
Note the left side of the dialog has a pull down list for constructors. The default constructor will always be first on this list. The newXml method must be used with the default constructor.
The data accessors must use the second constructor provided. This constructor takes a single object as a parameter. That object is the empRec object that is created by the newXml method. This is illustrated by naming the parameter for the constructor emp Record.
Again, add a simple description to be added to the workflow definition pull-down list displayed for the business operations. In this example the getEmpAddrZip method is given the description get ZipCode.
Continue adding methods until all accessors have been set up as business operations.
Following is an example of a business operation for the set FirstName method. Constructor 2 is specified with the object parameter for empRecord and string parameter for SetEmpNameFirst.
The final list should look something like the following.
Click Done when you are finished and the WebLogic Process Integrator main window redisplays.
Task 2: Set Up a Workflow
Now a workflow can be defined to make use of these business operations.
Perform the following steps to define a workflow:
The Template Properties dialog displays.
In this example the workflow becomes effective on October 2, 2000 and expires on October 27, 2000.
A new workflow opens.
Task 3: Define the Start Node
The Start Properties dialog determines the type of workflow to be created. In this example a manually started workflow is created.
The start node is now ready to have an action added to it.
Task 4: Set Up the Start Node Properties
Click OK and the Perform Business Operation dialog displays.
This completes the start node. Click OK to return to the Workflow window.
Task 5: Create a Setup Name Task
A task can use several business operations. In this example the task Setup Name is created and several methods are used to set values in the various fields that make up the name.
Select the Activated tab and click Add button to add a business operation on the Add Action dialog.
The method used to set the last name requires two parameters. One parameter is for the constructor and one parameter is for the method itself. In this example the constructor takes the empRecord variable that has been populated in the start node. The business operation takes a string representing the last name.
This dialog allows you to set the value of the required parameter. In this example a variable is used. Select the Variables option to display a list of all the variables defined for this workflow. This example uses the empRecord variable that was defined and populated in the start node.
For this example, enter the last name in the Expression text box and select the Literals option. The name could have been obtained in any manner and used from a variable or other source.
Click OK to return to the Perform Business Operation dialog.
Task 6: Create Additional Tasks
This section shows examples that were set up similarly to the tasks described in the previous steps. Refer to your WebLogic Process Integrator documentation for more information about using WebLogic Process Integrator Studio.
The following figure shows the example from the previous steps with a new task named Setup SSN added to set the social security number.
All of the DataHelper accessor set methods take string parameters. The data conversion is handled automatically for the field. Therefore, in this example the value set for the social security Expression is a literal string.
The Setup Address task is linked to the Setup SSN task.
Since the employee record only requires a name, address, and social security, a Make Mainframe Request task can now be created.
Once the data has been set up, the mainframe request can be made. All JAM requests are made through the JAM Application View invokeService method. The JAM Application view is a stateless session enterprise Java bean registered in JNDI as jam.AppViewHome. The actual client EJBs used to invoke the service do not need to be known to WebLogic Process Integrator. The AppView will invoke the proper bean and method based upon the service name. The service name must match a remote service that has been configured for the JAM gateway. JAM gateway configuration is specified in the jcrmgw.cfg file.
The business operation required is invokeService, which will use the default constructor and take two parameters. The first parameter is a Service Name and the second is the Mainframe Data Object that was created with the newXml method invoked in the Start node.
A new task named Make Mainframe Request is created using the invokeService business operation.
For purposes of this example, a Clear Address task was created so that the workflow can read the item just created.
The set methods are used to clear state, street and zip code.
A new task called Read Mainframe Data has been created and linked to a task called Save Address that will extract state, street and zip code.
The business operation, Make Mainframe Request, is again used but in this example the service name is empRecRead. This service has been set up in the jcrmgw.cfg as a remote service.
After reading the mainframe employee record the address fields will be extracted into WebLogic Process Integrator variables.
In the following example, three new variables for state, street and zip code have been added.
The task, Save Address uses the get methods to extract the state, street, and zip code that was returned from the mainframe. This task is linked to a Done node, however additional processing could have been added.
Following is an example of how the finished workflow might look.
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|