Thứ Sáu, 17 tháng 5, 2013

Interoperability for SharePoint Server 2007 and Lotus Notes or Lotus Domino

The Importance of Interoperability for SharePoint Server and Lotus Notes or Lotus Domino

The introduction of Microsoft Office SharePoint Server 2007 into organizations that have traditionally used IBM Lotus Notes and IBM Lotus Domino is increasingly common. Several different factors drive this trend. The use of Microsoft Office products is widespread in organizations; therefore, it is easy to see the advantages inherent in the close relationship between Microsoft Office and Office SharePoint Server. Different departments might introduce SharePoint Server into the organization on a trial basis, only to see its use grow dramatically. An organization might introduce SharePoint Server for a specific need, such as creating an extranet. An organization could be migrating from Lotus Notes to SharePoint Server. In all these cases, a situation exists in which SharePoint Server shares the enterprise with Lotus Notes and Lotus Domino. Whether an organization has a complete migration in progress or intends to keep SharePoint Server and Notes in the enterprise together, interoperability between the systems is important.
Typically, SharePoint solutions provide aggregation points where documents and information from several sources come together. Documents might be stored directly in SharePoint solutions in document libraries, or they might be surfaced from external repositories, sites, and file systems. Data in SharePoint solutions might come directly from lists or interoperability with external line-of-business (LOB) systems. SharePoint solutions are often implemented as intranet, extranet, or Internet sites where the business case requires access to many different sources of data.
Lotus Notes is an application platform with a portal capability. Lotus Notes comes with existing applications such as e-mail and calendaring, but also provides the capability to create custom applications. Domino is the portal capability that enables data from Notes applications to be presented in a Web environment.
Typically, Notes applications are the repositories for existing or legacy information within the organization. SharePoint Server is generally introduced into an environment where Notes already exists. This situation presents the opportunity to use existing Notes applications in new ways and to provide extended reach to users who have not traditionally used Notes. Additionally, organizations can take advantage of new capabilities in SharePoint Server that enhance existing Notes applications. Organizations that focus on interoperability ensure that users have access to important data and are provided with the capabilities that enable them to be more productive.

Support for Open Protocols

SharePoint Server and Notes or Domino support a number of open protocols that are useful as integration points. These protocols range from simple Hypertext Transfer Protocol (HTTP) requests through more complex object model calls. The integration techniques presented later in this article rely on the following underlying protocols.

HTTP

HTTP hardly needs introduction. This communication protocol that forms the foundation of the World Wide Web is fully supported in both Notes or Domino and SharePoint Server to provide access to sites, views, pages, and documents. This HTTP support enables several integration points that require little or no code. Specific HTTP implementations also enable access to e-mail and issue URL-based commands for search and retrieval.

XML

XML provides a cross-platform data format that is very useful when integrating SharePoint Server and Notes or Domino. Data from SharePoint Server lists and Notes databases can both be provided as XML documents. After this data is in XML format, you can easily repurpose it for integration between the platforms.

SOAP

SOAP is the protocol used for accessing many Web services, which ride on top of the HTTP protocol and use XML as the data format. Both SharePoint Server and Domino support the SOAP protocol for access to Web services. The available Web services include built-in (out-of-the-box) services and custom services. These services can be called to both read and write data to SharePoint Server lists and Notes databases.

COM

Notes or Domino provides a COM interface to its object model, and the associated LotusScript language can call COM objects. The Microsoft .NET Framework foundation for SharePoint Server supports calls into COM objects also. Therefore, if SharePoint Server and Notes or Domino are on the same server, direct COM calls can be made.

Common Interoperability Scenarios

When creating solutions that provide interoperability between Notes or Domino and SharePoint Server, you can use two key approaches: Domino-to-SharePoint Server/SharePoint Server-to-Domino interoperability and Notes-to-SharePoint Server/SharePoint Server-to-Notes interoperability. These approaches are supported by many different protocols and technologies that span the spectrum from no-code solutions to full-code solutions.

Domino-to-SharePoint Server/SharePoint Server-to-Domino Interoperability

Because both Domino and SharePoint Server sites are portal sites, interoperability from one to the other is possible though simple approaches such as links and IFrames. In addition, solutions using the HTTP protocol to access objects and resources work across both platforms. Essentially, this approach leaves both portals in place and shares Web-based data and content between them. Figure 1 shows a conceptual drawing of reusing Domino content in a SharePoint Server portal.
Figure 1. Using Domino content in a SharePoint Server portal
Using Domino content in a SharePoint Server portal

Notes-to-SharePoint Server/SharePoint Server-to-Notes Interoperability

The second approach to interoperability is to access data in a Notes database directly or to reflect SharePoint Server functionality in Notes applications. In this approach, you can use technologies such as Web services to wrap portions of data or functionality and expose it for consumption. Figure 2 shows a conceptual drawing of using a Notes database in a SharePoint Server portal.
Figure 2. Exposing Notes data in a SharePoint Server portal
Exposing Notes data in a SharePoint Server portal

Support for Standards and Technologies

Because applications use different architectures and technologies, SharePoint Server interoperability depends strongly on existing standards and technologies to expose and consume data, documents, and functionality. There are several key specifications that directly support interoperability between various platforms, and several technologies you can use to create custom interoperability solutions. Because of the support for standards, customers are able to use standards-based technology to produce or consume content with SharePoint Server. The following sections describe these specifications and technologies.

Really Simple Syndication

Really Simple Syndication (RSS) is a standard that defines a Web "feed," which contains content and metadata information for a site. Feeds are created as XML documents that provide a summary of content with metadata about the published content. These feeds are consumed by a feed reader that presents the feed information to the end user. Feed readers are available in many forms, from stand-alone readers to readers that are integrated into Internet Explorer, Microsoft Office Outlook, and SharePoint Server.

Web Services and Representational State Transfer

Web services define a standard by which clients and servers residing on separate physical computers can communicate by using HTTP. Typically, Web services are designed to use remote procedure calls (RPC) or Representational State Transfer (REST). Both types of Web services can be used for integration purposes.
Web services that are based on RPC generally use the SOAP protocol. SOAP uses underlying XML messages to communicate between the client and the server. XML messages containing the parameters for a remote procedure call are sent from client to server. The return value of the call is then sent from server to client as a new XML message.
Web services that are based on REST (often called "RESTful" services) do not use an underlying RPC layer. Instead, RESTful Web services use Uniform Resource Identifiers (URI) to provide a unique address for a given resource. The resource is then called directly over HTTP without the need to prepare or return messages. The World Wide Web itself is said to be RESTful because Web pages are returned to a browser based solely on the URI typed into the browser; no underlying message is required. RESTful Web services work in a similar way.

SharePoint Server Object Model

SharePoint Server exposes both an object model and Web services that you can use to support interoperability. The object model and Web services enable you to access nearly all content, security, and administration functionality within the Office SharePoint Server computer. The Microsoft SharePoint Products and Technologies Protocol Documentation provides technical specifications for Microsoft proprietary protocols that are implemented and used in SharePoint Products and Technologies.

Web Services for Remote Portlets

The Web Services for Remote Portlets (WSRP) specification defines a Web service interface for accessing interactive presentation-oriented Web services, and was produced through the efforts of the Web Services for Remote Portlets (WSRP) OASIS Technical Committee. WSRP is based on the gathered requirements and on the concrete proposals made to the committee. WSRP enables scenarios where a portal server (consumer) needs to aggregate content from a pre-existing remote portal (producer) with a minimum of new development work or costs.
The WSRP specification defines how to expose portlet functionality through a set of Web services. WSRP specifies how portlets should expose their functions to remote clients. When a portlet implements the Web services described in WSRP, it is said to be a WSRP producer. Figure 3 shows an architectural drawing of a user interface element in one portal being exposed to another portal through WSRP.
Figure 3. Portal interoperability with WSRP
Portal interoperability with WSRP Portals acting as remote clients discover WSRP producers either directly through a URI or through a registry. Portals that call the exposed Web services of a WSRP producer are referred to as WSRP consumers. WSRP consumers receive markup from one or more WSRP producers. This markup is then aggregated and transformed to create content for an end user in the consuming portal. SharePoint Server provides a WSRP Web Part that can act as a WSRP consumer.

Content Management Interoperability Services

Content Management Interoperability Services (CMIS) is a specification created by Microsoft, IBM, and EMC. The purpose of the specification is to simplify interoperability with enterprise content management (ECM) systems. The specification relies on the use of existing technologies and standards such as SOAP, REST, and the Atom syndication format. The specification was formally submitted to the Organization for the Advancement of Structured Information Standards (OASIS), which will manage the specification in the future. For more information, see OASIS Content Management Interoperability Services (CMIS) TC.
CMIS promises to create a standardized way in which to achieve interoperability between ECM systems. CMIS is important because repositories that implement the specification expose a standard API that simplifies publishing and consuming content. Developers can create solutions that surface content from any repository directly in a SharePoint Server portal.

Java Specification Requests

Java Specification Request (JSR) 170, entitled "Content Repository API for Java" is a specification intended to enable applications written on the Java platform to access a wide variety of content repositories through a consistent interface. The specification was written specifically to support access to repositories that have tree structures and support metadata for each node. This tree structure is known as the repository model and is independent of the underlying storage mechanism.
JSR 168 and JSR 286 are versions 1.0 and 2.0, respectively, of the Java Portlet Specification. Portlets are Web-based components that are similar to Web Parts in SharePoint Server. Portals use portlets as pluggable user-interface elements that render content on a page. JSR 168 defines the foundational portlet specification, including rules for user preference settings, data management, portlet communication through requests and responses, deployment, packaging, and security.
JSR relies solely on the Java programming language for implementation. Therefore, it is not truly a cross-platform technology; however, it can be used by some portals with which SharePoint interoperability is desired.

Content SharePoint Server Can Consume

SharePoint Server is an excellent platform to use for aggregating content from various sources. Domino or Notes exposes several technologies that SharePoint Server can use to consume content. This section addresses many of the approaches used by SharePoint Server to consume and display Notes or Domino information. Many of the examples in this section are offered as live demonstrations that you can access from the InteropTips Community site.

XML Over HTTP

Using IFrames to display content and data in SharePoint Server is a powerful and simple way to get started with Notes or Domino integration. Although it is certainly possible to use IFrames to simply reflect a page from Domino in SharePoint Server, you can also use them in more sophisticated ways to present data from Notes applications. This is made possible through Dominos support for URL commands.
URL commands enable HTTP access to Notes databases. Using URL commands, you can retrieve views of Notes data in XML, present the data in SharePoint Server, and update it in Notes. URL commands take the following form:
http://<servername>/<application.nsf>?<command>
You can use the OpenView command to return HTML from a Notes application or a Domino application. In SharePoint Server, you can use a Page Viewer Web Part to display the resulting data. Figure 4 shows an example of Notes data displayed in SharePoint Server. This is a simple Page Viewer Web Part set to the address http://www.msdomino.net/orders.nsf/customer%20orders?OpenView.
Figure 4. Using the OpenView command with a Page Viewer Web Part
OpenView command with a Page Viewer Web Part You can use the OpenDocument command to open a Notes document and display it in SharePoint Server. A common use of the OpenDocument command is to display the Notes e-mail application in SharePoint Server. Figure 5 shows an example of a Notes inbox in SharePoint Server. The sample uses a PageViewer Web Part set to the address http://www.msdomino.net/mail/juser.nsf/iNotes/Welcome/?OpenDocument.
Figure 5. Using the OpenDocument command to display e-mail in SharePoint Server
OpenDocument to show e-mail in SharePoint Server Using the ReadViewEntries command, you can return raw XML data instead of formatted HTML. This is useful when your application wants direct access to the data in a Notes application. Figure 6 shows an example of a Page Viewer Web Part rendering XML from a Notes application in SharePoint Server. The sample uses a Page Viewer Web Part set to the address http://www.msdomino.net/orders.nsf/customer%20orders?ReadViewEntries.
Figure 6. Using the ReadViewEntries command to retrieve XML data
ReadViewEntries command to retrieve XML The OpenAgent command enables you to invoke a LotusScript agent by using a URL command. Agents can perform many tasks on a Notes or Domino platform, including retrieving, updating, creating, and deleting data. You can use agents in conjunction with custom Web Parts to retrieve and manipulate Notes data.
Using custom Web Parts enables you to control the format and usage of the data in ways that are not possible in an IFrame alone. Figure 7 shows an example of using a Data View Web Part to format XML data returned from a custom aganet command. The data View Web Part accepts raw XML and then formats it by using an XSLT transformation. The Data View Web Part was added to the page by using Microsoft Office SharePoint Designer 2007 and set to receive data from the address http://www.msdomino.net/orders.nsf/ORDERSXML?OpenAgent. ORDERSXML is a LotusScript agent that creates an XML file suitable for use with the Data View Web Part.
Figure 7. Formatting raw XML data with the Data View Web Part
Formatting raw XML data with Data View Web Part

Excel and Excel Services

Microsoft Office Excel 2007 is widely used as a data analysis and reporting tool. By combining the XML over HTTP functionality presented in the previous section, you can create solutions that use Notes data in Office Excel worksheets, charts, and PivotTable reports. This process can be as simple as using the Data tab in Excel to connect to a LotusScript agent. Figure 8 shows the New Web Query dialog box referencing the address http://www.msdomino.net/orders.nsf/SHORTORDERSXML?OpenAgent.
Figure 8. Importing XML data into Excel 2007
Importing XML data into Excel 2007 After you import data into Excel 2007, you can analyze, format, and graph the data. Figure 9 shows the imported data filtered for the United States, Canada, and Mexico. Additionally, data bars are used to indicate relative values of freight.
Figure 9. Creating a report in Excel 2007
Creating a report in Excel 2007 After creating a report in Excel 2007, you can upload the report into a SharePoint Server document library where it can be displayed by using Excel Services. Excel Services enables worksheets to be displayed as a Web page in the browser. Although this capability is interesting, it becomes compelling when used as the basis for a dashboard in the SharePoint Server Report Center.
A dashboard in the SharePoint Server Report Center is a combination of an Excel Services rendering of the worksheet data coupled with a key performance indicator (KPI) list. You can publish a worksheet to Excel Services directly through Excel 2007. To do so, select Publish on the main menu. Before you can publish the worksheet to Excel Services, however, you must remove the XML map that was created when the data was imported. XML maps are not supported under Excel Services, so the worksheet will not render until the XML map is removed. You remove an XML map through the Developer tab in Excel 2007.
After you publish the worksheet, you can use it as the basis for a dashboard in Excel Services. Creating a dashboard in the Report Center gives you the opportunity to select a worksheet to use and to add a KPI list. Figure 10 shows a complete dashboard in the Report Center using Notes data.
Figure 10. Creating a dashboard in Excel Services
Creating a dashboard in Excel Services

Access and XSLT

Microsoft Office Access 2007 is a desktop database that you can use to import and transform data. In addition, Office Access 2007 offers tight integration with SharePoint Server, enabling it to be used to create and consume SharePoint list data. Using a combination of Access 2007, SharePoint Server 2007, and XSLT, you can import Notes data, transform it, and create SharePoint lists.
The process is accomplished in Access 2007 by importing data from a Notes database. During the import process, you can apply an XSLT transformation to the data to create the structure you want for the SharePoint list. Figure 11 shows XML data imported from http://www.msdomino.net/orders.nsf/customer%20orders?readviewentries and transformed by using the style sheet located at http://www.msdomino.net/firstpage.nsf/b29a5df9173b3feb88256e78000a0589/8c85c3b4013dfd448625754b000175ad/$FILE/ReadViewEntries-XSLT-XML.xsl. After the data is transformed into an Access 2007 table, it can be exported directly into a SharePoint list.
Figure 11. Notes data after import and transformation
Notes data after import and transformation

Web Services

By using URL commands, you can also expose Notes or Domino data through Web services. Domino 7 introduced a new Web services design element, similar to an agent that enables the creation of a Web service. Figure 12 shows the WSDL for a sample Web service located at http://www.msdomino.net/Orders.nsf/order_update?wsdl.
Figure 12. Sample Web service WSDL
Sample Web service WSDL After a Web service is created, it can be consumed by any .NET Framework client, including Windows Forms and ASPX pages. A common way to consume Web services and use the data in SharePoint Server is to write a custom Web Part. Figure 13 shows a custom Web Part in SharePoint Server for managing a single record in a Notes database that is based on the WSDL presented in Figure 11.
Figure 13. Custom Web Part consuming a Web service
Custom Web Part consuming a Web service

InfoPath and InfoPath Forms Services

Microsoft Office InfoPath 2007 forms are commonly used in SharePoint Server for data entry and workflow applications. Solutions based on Microsoft Office InfoPath forms can be deployed to Form Libraries for use with the Office InfoPath client software, or can be targeted for use with InfoPath Forms Services. InfoPath Forms Services enables a user to fill out InfoPath forms by using a browser, even if the Office InfoPath client is not present. Both InfoPath and InfoPath Forms Services solutions can take advantage of Lotus Notes data by using the Web services approach described in the previous section.
You can use InfoPath to create a form based on a Web service. By using this functionality, you can create a form by referencing a Web service created in Domino. The form is created using a simple wizard and results in a query interface that allows access to the operations supported by the Web service. After these forms are created, you can publish them to a Form Library in SharePoint Server with or without the use of InfoPath Forms Services. Figure 14 shows an InfoPath form that is created based on the Web service found at http://www.msdomino.net/products.nsf/manage_products?wsdl.
Ee230637.note(en-us,office.12).gifNote:
The Domino Web service used in InfoPath must have its SOAP message format set to Wrapped.
Figure 14. InfoPath form using a Domino Web service
InfoPath Form using a Domino Web service

Business Data Catalog

The Business Data Catalog is a feature found in the Enterprise Edition of Microsoft Office SharePoint Server 2007. The purpose of the Business Data Catalog is to enable SharePoint Server to use data from external LOB systems, such as Notes databases exposed through Web services. To connect to an external system, the Business Data Catalog requires an application definition file that describes the target system and how to connect with it. After this application definition file is created and loaded into the Business Data Catalog, data can be consumed from the target system.
After establishing a data connection, SharePoint Server can use data from the Notes database in several ways:
  • A set of Business Data Catalog Web Parts is included with SharePoint Server that enables users to perform wildcard lookups against the data source, and then display detailed information about any single item.
  • The Business Data Catalog data can be used to create a pick list for a column in a SharePoint list. A list of products that was sourced from a Notes database, for example, could be presented.
  • The Business Data Catalog data can be used to supplement profile information in SharePoint Server.
  • Business Data Catalog data can be searched by using the Enterprise Search capability of SharePoint Server.
Figure 15 shows data from the Web service found at http://www.msdomino.net/products.nsf/manage_products?wsdl used in a lookup list column in SharePoint Server.
Figure 15. Accessing a Domino Web service through the Business Data Catalog (BDC)
Accessing Domino Web service via BDC

Content SharePoint Server Can Produce

In the same way that Microsoft Office applications can consume content from Lotus Notes, Office applications can also produce content for consumption in Domino. Just as SharePoint Server supports consuming data through several technology standards, it also supports exposing data through these standards. This section addresses ways to make SharePoint content available to Domino portals.

Links

SharePoint portals consist of pages that can be accessed through hyperlinks. Therefore, other Domino portals can use simple lists of hyperlinks to access various pages within the SharePoint portal. Some of these pages might also support QueryString arguments that can be used with the links. For example, a portal could link to the SharePoint search page and provide a keyword within the QueryString argument so that the link automatically executes a search.

IFrames

SharePoint page content can also be rendered within an IFrame. Domino portals can use a variety of technologies, such as portlets, to render IFrames that reference SharePoint pages. End users still need permission to view the content, however, even when the content is rendered in an IFrame.

RSS

All lists in SharePoint Server and search results support RSS. Users select to subscribe to lists by using the Action menu on the list toolbar. Users can also subscribe to search results by using an icon that appears on the search page. All SharePoint RSS feeds are authenticated, which means that users must have a feed reader that supports authentication to view SharePoint content.

Web Services for Remote Portlets

Although SharePoint Server does not provide a built-in WSRP producer, Microsoft has developed the WSRP Toolkit for SharePoint Server 2007. The toolkit includes a white paper that describes how to enable interoperability between SharePoint Server and portals based on technologies that support WSRP. This document details two methods for adding WSRP producer functionality to SharePoint Server, and briefly explores other interoperability options through data integration by using industry standards.

Web Services

SharePoint Server exposes several Web services that Domino portals can consume. These Web services provide methods for use with sites, lists, users, and search. Using these Web services enables Notes databases to consume SharePoint content and push data into SharePoint lists and libraries.
A common scenario under which SharePoint Web services are used involves uploading of data from a Notes form into a SharePoint library. Data from a Notes form can be converted to a Microsoft Office Word 2007 document by using Office Open XML file formats. You can then upload the resulting Office Word 2007 document into a SharePoint document library by using an exposed SharePoint Web service. This enables end users to continue initiating business processes through Notes forms while using SharePoint capabilities such as workflow.
Although the existing Web services do provide a significant amount of functionality, you can also write custom Web services that wrap the SharePoint Server object model. Wrapping the SharePoint Server object model opens up a significant amount of functionality that is not available through the native SharePoint Web services. Figure 16 shows a conceptual drawing of Notes integration with SharePoint Web services.
Figure 16. Integration with Web services
Integration with Web services

RPC Services

Remote Procedure Call (RPC) is a protocol layered on top of HTTP that enables a client application to communicate with a server running SharePoint Server. RPC calls made from the client take the form of an HTTP POST request to send methods to SharePoint Server. These POST requests send XML messages formatted by using Collaborative Application Markup Language (CAML). CAML is an XML language that is specific to Microsoft SharePoint Products and Technologies, and forms the underlying message for RPC method calls to request documents, update lists, and perform other operations.

Security Considerations

When integrating Lotus Notes and SharePoint Server, it is important to recognize that the security models used by each product are different. Notes uses a proprietary security model where authentication and authorization is accomplished through a separate provider. SharePoint Server can use Windows authentication (either NTLM or Kerberos protocol) or a forms authentication provider. As a result, you must consider how to allow authentication when accessing data in each system.
In a simple scenario, you can use a manual log on (such as when accessing data through Word, Excel, or Access). In more complex scenarios, you can provide a programmatic solution such as one using impersonation. Finally, consider the use of the SharePoint Single Sign-On service, which can associate non-Windows–based credentials for Notes with Windows credentials used in SharePoint Server. Additionally, it is important to understand that SharePoint Server provides security at the site level, list level, and item level. This means that you must be aware of how the security model is structured within a SharePoint site before creating integration solutions.

Conclusion

This article examines interoperability between Microsoft Office SharePoint Server 2007 and Lotus Notes or Lotus Domino. Many organizations that have traditionally used Notes and Domino have also introduced the Microsoft Office SharePoint Server 2007 platform into their organizations. The existing investment in Lotus Notes often means that the platforms will exist side by side for a period of time. Although both platforms are in use, organizations can take advantage of the interoperability technologies and techniques presented in this article to help ensure that both platforms provide maximum value.

Tích hợp FileNet với IBM Content Manager, Phần 3: Triển khai thực hiện các trình diễn công việc dựa vào Component Integrator

Giới thiệu về FileNet P8 Component Integrator
FileNet P8 Component Integrator giúp cho có khả năng tương tác với một thực thể bên ngoài được gọi là một thành phần có thể hoặc là một đối tượng Java hoặc Java Messaging System (JMS - Hệ thống thông điệp Java). Bạn có thể sử dụng nó để nhập khẩu các lớp Java và quản lý giao tiếp giữa máy quy trình và các giao diện. Component Integrator bao gồm các bộ điều hợp là các giao diện để giao tiếp các sự kiện từ máy quy trình đến các thực thể bên ngoài như là các đối tượng Java. Các bộ điều hợp tương tác với các kiểu các thành phần khác nhau từ một bước của dòng công việc.
Hình 1 cho thấy các bước mà bạn cần thực hiện để tạo một hàng đợi thành phần Java trong Component Integrator.



Hình 1. Các bước để tạo ra một trình diễn công việc thành phần Java trong Component Integrator
Các bước để tạo ra một trình diễn công việc thành phần Java trong Component Integrator
Như được thể hiện trong biểu đồ trên, bước đầu tiên là cấu hình và triển khai thành phần (1). Bạn có thể sử dụng Bàn điều khiển cấu hình quy trình P8 của FileNet (FileNet P8 Process Configuration Console) để tạo ra một hàng đợi thành phần (2 và 3).
Tiếp theo, triển khai các tệp jar cần thiết cho thành phần trên máy chủ Máy Ứng dụng và đăng ký thành phần trong Process Task Manager (Nhà quản lý nhiệm vụ quy trình) (4 và 5). Process Designer (Nhà thiết kế quy trình) lấy thông tin cấu hình từ Máy Quy trình (Process Engine) (6).
Sau đó tạo các định nghĩa dòng công việc. Bạn có thể tạo ra một bước thành phần và chọn thành phần và phương thức đã đăng ký để gọi. Bạn cũng cần phải xác định các trường dòng công việc sẽ được chuyển qua làm các tham số cho phương thức trong thời gian chạy (7). Các định nghĩa dòng công việc (các yêu cầu cho công việc) sau đó được chuyển tới các hàng đợi của Máy Quy trình (8).
Hình 2 mô tả sự tương tác trong thời gian chạy giữa Component Integrator và các dịch vụ của Máy Ứng dụng như là nhà quản lý thành phần, các hàng đợi của máy quy trình và một thực thể tùy chỉnh được hiển thị trong cùng hình đó. Khi quy trình dòng công việc được thực hiện, Component Manager lấy yêu cầu từ các hàng đợi thành phần và gọi các thành phần thông qua các bộ điều hợp. Với mỗi bước trong dòng công việc, chuỗi các sự kiện chung sau đây sẽ diễn ra. Đầu tiên, thông tin được gửi đến thành phần qua bộ điều hợp. Sau đó, thành phần thực hiện công việc của mình và tương tác với thực thể tùy chỉnh. Cuối cùng, kết quả công việc được lưu trong bước này.

Hình 2. Sự tương tác trong thời gian chạy của Component Integrator
Sự tương tác trong thời gian chạy của Component Integrator
Chúng ta sẽ giới thiệu cách Component Integrator làm việc trước khi chúng ta triển khai thực hiện trình diễn công việc của Component Integrator.
Chúng ta định nghĩa một hoạt động quy trình liên kết các giá trị tham số với một phương thức thành phần. Khi sử dụng các hoạt động quy trình, chúng ta có thể chuyển các giá trị của các trường mục công việc đến một phương thức thành phần. Khi một dòng công việc đang chạy có một mục công việc đạt đến một bước thành phần (một thành phần đã được tạo ra như là một bước trong một dòng công việc), Component Integrator tự động thực hiện một loạt các hoạt động. Phương thức này tự động đọc các giá trị của trường mục công việc, chờ một đáp ứng từ phương thức thành phần, cập nhật các giá trị của trường mục công việc theo bất kỳ các thay đổi nhận được từ việc thực hiện phương thức thành phần này, lưu mục công việc và mở khóa nó. Cuối cùng, phương thức hoàn thành bước này bằng cách gửi mục công việc tới một bước tiếp theo.
Triển khai thực hiện Component Integrator dựa trên trình diễn công việc
Bây giờ bạn cần có một sự hiểu biết cơ bản về cách triển khai thực hiện một trình diễn công việc dựa vào Component Integrator. Đây là lúc xem xét năm bước chính sau đây để hoàn thành việc triển khai thực hiện này.
  1. Triển khai một lớp Java tùy chỉnh.
  2. Sử dụng Process Configuration Console (Bàn điều khiển cấu hình quy trình) để tạo ra một hàng đợi thành phần và định nghĩa các hoạt động của hàng đợi thành phần.
  3. Sử dụng Process Task Manager (Nhà quản lý nhiệm vụ quy trình) để bắt đầu và kết thúc Component Manager (Nhà quản lý thành phần) và bắt đầu và ngừng các thành phần.
  4. Sử dụng Nhà thiết kế quy trình (Process Designer) để tạo ra một quy trình nghiệp vụ và thêm hàng đợi thành phần Java đã đăng ký vào quy trình.
  5. Sử dụng Vùng làm việc FileNet để xác nhận hợp lệ quy trình nghiệp vụ.
Trong phần 2, bạn đã tạo ra Các thực thể nghiệp vụ Java (Java Business Entities) cho kho lưu trữ IBM Content Manager cũng như lớp cổng cho các phương thức hoạt động của Các thực thể nghiệp vụ Java. Bây giờ bạn sẽ đăng ký lớp cổng vào Component Integrator để tạo ra một hàng đợi thành phần. Sau đó, bạn có thể sử dụng tất cả các phương thức hoạt động trong định nghĩa quy trình. Sau đó, quy trình nghiệp vụ có thể tự do tương tác với kho lưu trữ IBM Content Manager qua hàng đợi thành phần này. Các phần sau mô tả cách làm điều đó.
Triển khai một lớp Java tùy chỉnh
Có ba phần cho lớp Java tùy chỉnh.
  • Các thực thể nghiệp vụ Java.
  • Lớp cổng (gateway).
  • Tệp cấu hình và lớp Dịch vụ ủy quyền và xác thực thực Java (JAAS-Java Authentication and Authorization Service).
Các thực thể nghiệp vụ Java và lớp cổng đã được triển khai thực hiện trong Phần 2. Ở đây bạn chỉ cần tạo tệp cấu hình và lớp JAAS. Tại sao bạn cần tệp cấu hình và các lớp JAAS? Lý do là FileNet P8 Component Integrator sử dụng JAAS để thực hiện xác thực. Bạn nên tạo ra mô đun xác thực JAAS và tệp cấu hình đăng nhập cho lớp các thực thể nghiệp vụ Java. Để cấu hình JAAS, bạn cần hoàn thành 5 bước sau đây:
1. Đầu tiên, tạo một lớp LoginModule cho hệ thống mà lớp tuỳ chỉnh truy cập vào. Bạn có thể làm theo Hướng dẫn của Nhà phát triển mô đun đăng nhậpHướng dẫn xác thực JAAS để tạo ra các lớp LoginModule. SampleLoginModule.java triển khai thực hiện việc xác thực bên dưới mong muốn. Xác thực người dùng của SampleLoginModule chỉ đơn giản kiểm tra xem tên và mật khẩu mà người sử dụng nhập vào đã có giá trị cụ thể chưa. Mã nguồn của SampleLoginModule được hiển thị dưới đây.

Liên kết 1. Mã loginModule mẫu - SampleLoginModule.java
public class SampleLoginModule implements LoginModule
{
    private Subject         m_subject;
    private CallbackHandler m_callbackHandler;
    private Map             m_sharedState;
    private Map             m_options;

    private String          m_username  = null;
    private boolean      m_validSession = true;

    // testUser's SamplePrincipal
    private SamplePrincipal m_principal;

    public void initialize(Subject subject, 
    CallbackHandler callbackHandler, Map sharedState, Map options)
    {
        this.m_subject          = subject;
        this.m_callbackHandler  = callbackHandler;;
        this.m_options          = options;
        this.m_sharedState      = sharedState;
    }

    public boolean login() throws LoginException
    {
        if (m_callbackHandler == null)
        {
            throw new LoginException("Error:
             no CallbackHandler available to get authentication information");
        }

 String password = null;

 m_username = (String)m_sharedState.get("javax.security.auth.login.name");
 password   = (String)m_sharedState.get("javax.security.auth.login.password");

        if (m_username == null)
        {
                Callback[] callbacks = null;

                callbacks = new Callback[3];
                callbacks[0] = new TextOutputCallback(TextOutputCallback.INFORMATION,
                 "Sample Authentication");
                callbacks[1] = new NameCallback("user name:");
                callbacks[2] = new PasswordCallback("password:", false);

                try
                {
                    m_callbackHandler.handle(callbacks);
                    m_username = ((NameCallback)callbacks[1]).getName();

                    char[] tmpPassword = ((PasswordCallback)callbacks[2]).getPassword();

                    if (tmpPassword != null)
                        password = new String(tmpPassword);
                    else
                        password = null;

                    ((PasswordCallback)callbacks[2]).clearPassword();

                    m_sharedState.put("javax.security.auth.login.name",m_username);
                    m_sharedState.put("javax.security.auth.login.password", password);

                }
                catch (java.io.IOException ioe)
                {
                    throw new LoginException(ioe.toString());
                }
                catch (UnsupportedCallbackException uce)
                {
                    throw new LoginException("Error: 
                    no CallbackHandler available to get authentication information");
                }
        }

        try
        {
        }
        catch (Exception e)
        {;
            throw new LoginException(e.toString());
        }

   m_validSession = true;
        return (m_validSession);
    }
 
 ...
}
   

SamplePrincipal.java là một lớp mẫu triển khai thực hiện giao diện java.security.Principal. Nó thường do SampleLoginModule sử dụng.

Liên kết 2. Mã mẫu chính - SamplePrincipal.java
public class SamplePrincipal implements Principal, java.io.Serializable
{


    private String name;

    public SamplePrincipal( String name )
    {
        if( name == null )
            throw new NullPointerException( "illegal null input" );

        this.name = name;
    }

    public String getName()
    {
        return name;
    }

    public String toString()
    {
        return ("SamplePrincipal:  " + name);
    }

    public boolean equals( Object o )
    {
        if( o == null )
            return false;

        if( this == o )
            return true;

        if( !(o instanceof SamplePrincipal) )
            return false;
        SamplePrincipal that = (SamplePrincipal) o;

        if( this.getName().equals( that.getName() ) )
            return true;
        return false;
    }

    public int hashCode()
    {
        return name.hashCode();
    }
    
    ...
}
   

2. Thứ hai, tạo ra một tệp jar để sắp xếp lớp Java tùy chỉnh và các lớp LoginModule tương ứng. Bạn cần phải gói các lớp LoginModule của JAAS và lớp cổng vào trong tệp jar này. Để cho thuận tiện, bạn cũng có thể tải tệp jar có tên ICMOperations.jar từ phần Tải về.
3. Sau đó, tạo ra một tệp Cấu hình đăng nhập JAAS chứa một phần LoginContext. Các mã sau đây cho thấy tệp cấu hình đăng nhập này. Bạn có thể thêm văn bản vào tệp cấu hình JAAS mặc định của bộ định tuyến (Router) FileNet taskman.login.config . Tệp này nằm trong thư mục filenet_installation_directory/AE/Router. Bạn có thể nhận được tệp taskman.login.config trong phần Tải về.

Liên kết 3. Cấu hình JAAS
Sample
{
    filenet.vw.server.VWLoginModule required; 
    com.ibm.cm.businesslogic.operations.jaas.SampleLoginModule required debug=true;
};

   

4. Tiếp theo, triển khai tệp Cấu hình đăng nhập JAAS, tệp JAR tùy chỉnh và các tệp JAR cần thiết bằng cách sao chép các tệp này vào vị trí triển khai trên máy chủ Máy Ứng dụng. Trên thực tế, bạn cũng có thể sao chép các tệp này vào bất kỳ vị trí nào bạn muốn. Nói chung, nó sẽ là thư mục filenet_installation_directory/AE/Workplace/WEB-INF/lib.
5. Cuối cùng, kết thúc Component Manager và chỉ rõ tệp JAR tùy chỉnh mà bạn đã tạo ra như là một trong các thư viện Java cần thiết trong Component Manager. Trong Hình 3, chúng ta thêm tệp JAR ICMOperation.jar và cũng như các tệp JAR có liên quan. Bạn có thể tải các tệp JAR relatedJARFiles.zip trong phần Tải về.

Hình 3. Thêm tệp JAR và các tệp JAR có liên quan vào Component Manager
Thêm tệp JAR và các tệp JAR có liên quan vào Component Manager
Lưu ý: Nếu lớp Java đã bao gồm các mô đun phụ thuộc không nằm trong tệp JAR cũng như không nằm trong các thư viện cần thiết hiện có, thì cần chỉ rõ các tệp jar chứa các mô dun phụ thuộc làm các thư viện cần thiết. Do các thực thể nghiệp vụ Java đang sử dụng OOAPI của Content Manager để giao tiếp với kho lưu trữ của Content Manager, bạn nên lập danh mục cơ sở dữ liệu trước khi thực hiện chúng. Hãy tham khảo hướng dẫn này để thực hiện danh mục đó
Tạo một hàng đợi thành phần và định nghĩa các hoạt động hàng đợi thành phần
Bạn sử dụng Bàn điều khiển cấu hình nghiệp vụ để tạo và cấu hình một hàng đợi thành phần cho lớp Java hoặc hàng đợi JMS tùy chỉnh đã triển khai. Chỉ có một lớp hoặc hàng đợi JMS mới có thể được kết hợp với một hàng đợi thành phần của Máy Quy trình duy nhất. Tuy nhiên, bạn có thể cấu hình nhiều hàng đợi thành phần cho bất kỳ lớp hoặc hàng đợi JMS cụ thể nào bằng cách gán các tên khác nhau cho các hàng đợi thành phần bổ sung. Để có các hướng dẫn, xem Cấu hình các hàng đợi phần hàng (Configuring Component Queues).
Trong hệ thống Yêu cầu bồi thường bảo hiểm tự động của Công ty ABC, bạn có thể chỉ đăng ký một thành phần Java, thật dễ dàng để thiết kế quy trình nghiệp vụ bằng cách sử dụng Nhà thiết kế quy trình (Process Designer). Bây giờ bạn sẽ đăng ký một hàng đợi thành phần mới theo từng bước một.
Trước tiên, khởi chạy Bàn điều khiển cấu hình quy trình của Bàn làm việc FileNet và đăng ký các lớp bổ sung cho thành phần Java này. Hình 4 cho thấy bước này. Nếu tệp JAR của thành phần Java có một số tệp jar hoặc các tệp lớp Java có liên quan, bạn nên đăng ký chúng trước khi tạo ra các hàng đợi thành phần Java mới .

Hình 4. Thêm tệp JAR và các tệp JAR có liên quan vào Component Manager
Thêm tệp JAR và các tệp JAR có liên quan vào Component Manager
Sau khi đăng ký một số tệp jar bổ sung, bạn tạo một hàng đợi thành phần Java mới. Bạn có thể chỉ định bất kỳ tên nào muốn. Hình 5 cho thấy bước này.

Hình 5. Tạo một hàng đợi thành phần Java mới
Tạo một hàng đợi thành phần Java mới
Bây giờ, chọn bộ điều hợp Java cho hàng đợi thành phần Java. Bạn có thể chọn tệp jar trong đó có lớp Java tùy chỉnh và lớp cấu hình JAAS. Trong trường hợp của chúng ta, đó là tệp ICMOperation.jar. Bạn cũng nên chọn lớp Java tùy chỉnh trưng ra tất cả các phương thức hoạt động. Trong trường hợp tương tự, đó là tệp ICMOperation.class. Hình 6 cho thấy bước này.

Hình 6. Cấu hình các tệp bộ điều hợp Java
Cấu hình các tệp bộ điều hợp Java
Trong bước này, thiết lập các đặc tính bộ điều hợp Java và ủy quyền JAAS như tên người dùng, mật khẩu và ngữ cảnh cấu hình. Trong trường hợp này, nhập vào cấu hình sau như Hình 7 cho thấy.

Hình 7. Cấu hình các đặc tính bộ điều hợp Java và và ủy quyền JAAS
Cấu hình các đặc tính bộ điều hợp Java và và ủy quyền JAAS
Trong Hình 8, thiết lập các phương thức hoạt động mà bạn muốn trưng ra. Chỉ các phương thức chung mới có thể được trưng ra.

Hình 8. Cấu hình các hoạt động.
Configure the operations
Cuối cùng, lưu hàng đợi thành phần đã tạo ra. Hình 9 cho thấy bước này.

Hình 9. Lưu hàng đợi thành phần đã tạo ra
Lưu hàng đợi thành phần đã tạo ra
Bây giờ bạn đã tạo ra một hàng đợi thành phần có thể trưng ra tất cả các phương thức/hàm của các thực thể nghiệp vụ Java.
Làm mới tất cả các cấu hình
Sau khi bạn đã tạo ra hàng đợi thành phần mới, hãy làm mới tất cả các cấu hình bằng Process Task Manager (Nhà quản lý nhiệm vụ quy trình) để làm cho hàng đợi thành phần đã tạo có sẵn trong Component Manager. Hình 10 cho thấy bước này.

Hình 10. Làm mới tất cả các cấu hình
Làm mới tất cả các cấu hình
Bây giờ bạn có thể nhìn thấy hàng đợi thành phần đã tạo ra có sẵn trong nhà quản lý thành phần, như Hình 11 cho thấy.

Hình 11. Hàng đợi thành phần mới có sẵn trong Component Manager
Hàng đợi thành phần mới có sẵn trong Component Manager
Sau tất cả các cấu hình này, bạn có thể trực tiếp sử dụng hàng đợi thành phần mới này trong quy trình nghiệp vụ. Bạn có thể thấy các phương thức hàng đợi thành phần có sẵn trong Nhà thiết kế quy trình (Process Designer). Hình 12 cho thấy các phương thức hàng đợi thành phần.

Hình 12. Hàng đợi thành phần đã tạo ra ICMOperations có sẵn trong Nhà thiết kế quy trình
Chúng ta có thể thấy hàng đợi thành phần đã tạo ra của mình ICMOperations                      trong nhà thiết kế quy trình
Kết luận
Trong phần 3, bạn đã đăng ký các đối tượng thực thể nghiệp vụ Java của hệ thống Yêu cầu bồi thường bảo hiểm tự động của công ty ABC đã tạo ra của bạn vào FileNet P8 Component Integrator, đã sử dụng Process Task Manager để xử lý hàng đợi thành phần mới và đã làm cho hàng đợi thành phần này có sẵn cho quy trình nghiệp vụ.
Phần 4 sẽ mô tả cách sử dụng FileNet Business Process Designer (Nhà thiết kế quy trình nghiệp vụ FileNet) để triển khai thực hiện một định nghĩa dòng công việc để sử dụng hàng đợi thành phần vừa mới được tạo và cách thực hiện quy trình nghiệp vụ này.

Tích hợp FileNet với IBM Content Manager, Phần 2: Triển khai thực hiện các thực thể nghiệp vụ Java và lớp cổng (gateway) cho dữ liệu trong kho lưu trữ lưu trữ của IBM Content Manager

Mở đầu
Phần 1 của loạt bài này đã giới thiệu cho bạn về các kiến trúc của FileNet P8 BPM và IBM Content Manager. Bài viết đã sử dụng một hệ thống Yêu cầu bồi thường bảo hiểm tự động của công ty ABC hư cấu để cho bạn thấy cách tích hợp hai sản phẩm mạnh mẽ này.
Phần 2 giới thiệu các trình diễn công việc của FileNet P8 và cho bạn thấy cách triển khai thực hiện các thực thể nghiệp vụ Java. Bạn sẽ tìm hiểu cách tạo ra một lớp cổng Java và xem cách sử dụng tuần tự hóa Java để tránh các hạn chế cụ thể.
Các trình diễn công việc
Để sử dụng một kho lưu trữ nội dung của bên thứ ba, FileNet Business Process Management (BPM) cần có khả năng giao tiếp với kho lưu trữ IBM Content Manager. Các trình diễn công việc FileNet có thể cho phép BPM tương tác với các ứng dụng hoặc các mã của bên thứ ba.
Trong FileNet P8, các trình diễn công việc cho phép một ứng dụng thực hiện một hoạt động hoặc một tập các hoạt động liên quan đến một dòng công việc. Thông thường, các trình diễn công việc được thiết kế không có giao diện người dùng và được sử dụng để thực hiện các hoạt động dòng công việc tự động, chẳng hạn như các hoạt động được liên kết với một bước dòng công việc cụ thể trong một định nghĩa dòng công việc. Các hoạt động trình diễn công việc được liên kết với các bước dòng công việc bao gồm đăng nhập và thiết lập một phiên làm việc của máy quy trình, thăm dò một hàng đợi người dùng hoặc hàng đợi hệ thống (cố gắng để tìm các hoạt động liên quan đến một bước dòng công việc cụ thể), khóa các đối tượng được lấy ra, xử lý công việc (cập nhật dữ liệu và v.v..) và quay ngược để thăm dò hàng đợi. Đại khái là, các trình diễn công việc cần thiết để tương tác với các ứng dụng của bên thứ ba.
Có hai kiểu trình diễn công việc, dựa vào trình tích hợp thành phần và dựa trên trình tiện ích nền sau (daemon). Trình diễn công việc dựa vào nhà tích hợp thành phần được dùng trong ví dụ này.
Các trình diễn công việc dựa vào nhà tích hợp thành phần là một thành phần được triển khai thực hiện như một lớp Java hoặc sự kiện Java Messaging Service (JMS-Dịch vụ gửi thông báo Java). Một thành phần Java có thể được sử dụng để thực hiện tất cả các hoạt động liên quan đến một dòng công việc. Hình 1 minh họa kiến trúc của nhà tích hợp thành phần:

Hình 1. Kiến trúc Nhà tích hợp thành phần FileNet P8
Kiến trúc Nhà tích hợp thành phần FileNet P8
Thành phần Java hoặc JMS có thể được nhà quản lý thành phần (component manager) quản lý. Nhà quản lý thành phần cấu hình và giao tiếp với các bộ điều hợp dịch vụ. Trong thời gian chạy, nhà quản lý thành phần thăm dò các hàng đợi thành phần về các mục công việc đòi hỏi JMS hoặc xử lý bởi các thành phần Java và kết nối một mục công việc đang đòi hỏi một thành phần tới bộ điều hợp dịch vụ thích hợp. Bộ điều hợp Java xử lý các cuộc gọi quy trình cho các đối tượng Java, được biểu diễn đến máy quy trình như là các hoạt động trên các hàng đợi (các mục công việc) ở nơi mỗi hoạt động được thực hiện bằng một phương thức của lớp Java. Bộ điều hợp Java thực hiện ghép nối với thành phần Java, sau đó tự động chờ đáp ứng từ thành phần này, cập nhật mục công việc và gửi mục công việc này đến bước dòng công việc tiếp theo. Bộ điều hợp JMS đặt các thông báo vào Hàng đợi JMS (Queue JMS) và gửi đi mục công việc liên quan. Bộ điều hợp JMS xử lý quy trình gửi lên các sự kiện tới một hàng đợi thông báo (dưới dạng một sự kiện XML dựa trên phần tử bước cho hoạt động cụ thể).
Triển khai thực hiện các thực thể nghiệp vụ Java cho Công ty ABC
Công ty ABC muốn lưu trữ tất cả dữ liệu nội dung trong IBM Content Manager hiện có. Và nó cũng muốn sử dụng FileNet BPM để xây dựng một ứng dụng tập trung quy trình. Vì vậy bạn cần triển khai thực hiện các trình diễn công việc trong BPM để thao tác nội dung trong IBM Content Manager hiện có.
Bạn có thể gói logic ứng dụng bên thứ ba và trưng ra giao diện đó khi triển khai thực hiện thành phần Java. Với trường hợp của Công ty ABC, trước tiên bạn triển khai thực hiện các thực thể nghiệp vụ Java có thể truy cập dữ liệu trong IBM Content Manager. Hình 2 cho thấy kiến trúc của các thực thể nghiệp vụ Java :

Hình 2. Kiến trúc các thực thể nghiệp vụ Java
Kiến trúc các thực thể nghiệp vụ Java
Như kiến trúc này cho thấy, bạn có thể tạo các đối tượng chuyển giao dữ liệu (DTO) và đối tượng truy cập dữ liệu (DAO) phù hợp với mỗi lớp trong biểu đồ lớp (Phần 1; Hình 4). Khi lấy lớp "AutoClaim" làm ví dụ, chúng ta đã tạo ra một lớp DTO AutoClaim.java và một lớp DAO AutoClaimDAO.java.
Mã Java sau đây là AutoClaim.java. Nó bao gồm các định nghĩa đặc tính và các phương thức getter và setter có liên quan. Nó biểu diễn giá trị dữ liệu cho một mục trong kho lưu trữ IBM Content Manager.

Liệt kê 1. DTO mẫu - AutoClaim.java
                
public class AutoClaim
{
 public AutoClaim () 
 {
 }
    
 private String claimID;
 public String getClaimID()
 {
  return this.claimID;
 }

 public void setClaimID(String claimID)
 {
  this.claimID = claimID;
 }
 
 private Integer claimStatus;
 public Integer getClaimStatus()
 {
  return this.claimStatus;
 }

 public void setClaimStatus(Integer claimStatus)
 {
  this.claimStatus = claimStatus;
 }
 
 private String openingDate;
 public String getOpeningDate()
 {
  return this.openingDate;
 }

 public void setOpeningDate(String openingDate)
 {
  this.openingDate = openingDate;
 }
 
 private Integer claimAmount;
 public Integer getClaimAmount() {
  return claimAmount;
 }

 public void setClaimAmount(Integer claimAmount) {
  this.claimAmount = claimAmount;
 }
 
 private String eventID;

 public String getEventID() {
  return this.eventID;
 }

 public void setEventID(String eventID) {
  this.eventID = eventID;
 }
 
 private String pidString;
 public String getPidString() {
  return pidString;
 }
 public void setPidString(String pidString) {
  this.pidString = pidString;
 }
}
   

Mã Java sau đây là AutoClaimDAO.java là một đối tượng truy cập dữ liệu. Nó chứa tất cả các phương thức gọi OOAPI của IBM Content Manager để xử lý dữ liệu trong IBM Content Manager.

Liệt kê 2. DAO mẫu - AutoClaimDAO.java
                
public class AutoClaimDAO
{

  private String itemType;

  public AutoClaimDAO()
  {
    itemType = "AutoClaim";
  }
    
 public String create(AutoClaim autoClaim) throws DKException, Exception 
 {
  String pidString = null;
  DKDatastoreICM dsICM = SConnectDisconnectICM.connect();
  DKDDO ddo = dsICM.createDDO("AutoClaim", DKConstant.DK_CM_ITEM);
  setAttrToDDO(ddo, autoClaim);
  ddo.add();
  pidString = ddo.getPidObject().pidString();
  dsICM.disconnect();
  return pidString;
 }
 
 public AutoClaim retrieveAutoClaimByClaimID(String claimID)
 throws DKUsageError, DKException, Exception
 {
  AutoClaim autoClaim = null;
  String queryString = "/AutoClaim[@Claim=\""+claimID+"\"]";
  DKDatastoreICM dsICM = SConnectDisconnectICM.connect();
  dkIterator dkIter = 
  (dkIterator) SConnectDisconnectICM.search(dsICM, queryString, 0, true);
  if(dkIter.more())
  {
   autoClaim = new AutoClaim();
   DKDDO ddo = (DKDDO)dkIter.next();
   ddo.retrieve(DKConstant.DK_CM_CONTENT_ITEMTREE + 
    DKConstant.DK_CM_CONTENT_NO);
   setValueToAutoClaim(ddo, autoClaim);
   autoClaim.setPidString( ddo.getPidObject().pidString() );
  }
  dsICM.disconnect();
  return autoClaim;
 }

 public void update(String pidString, AutoClaim autoClaim)
 throws DKUsageError, DKException, Exception
 {
  DKDatastoreICM dsICM = SConnectDisconnectICM.connect();
  DKDDO ddo= dsICM.createDDO(pidString);
  ddo.retrieve(DKConstant.DK_CM_CONTENT_ITEMTREE + 
   DKConstant.DK_CM_CONTENT_NO);

  DKDatastoreExtICM ext = new DKDatastoreExtICM(dsICM);
  if(!ext.isCheckedOut(ddo))
  {
   ext.checkOut(ddo);
  }
  setAttrToDDO(ddo, autoClaim);
  dsICM.updateObject(ddo, DKConstant.DK_CM_CHECKIN);
  dsICM.disconnect();
 }
 
 public void delete(String pidString) throws DKUsageError, DKException, Exception
 {
  DKDatastoreICM dsICM = SConnectDisconnectICM.connect();
  DKDDO ddo = dsICM.createDDO(pidString);
  ddo.del();
  dsICM.disconnect();
 }
 
 public void setAttrToDDO(DKDDO ddo, AutoClaim autoClaim) throws DKUsageError
 {
  if(autoClaim.getClaimID()!=null)
  ddo.setData(ddo.dataId(DKConstant.DK_CM_NAMESPACE_ATTR,"ClaimID"), 
   autoClaim.getClaimID());
  if(autoClaim.getClaimStatus()!=null)
  ddo.setData(ddo.dataId(DKConstant.DK_CM_NAMESPACE_ATTR,"ClaimStatus"),
   autoClaim.getClaimStatus());
  if(autoClaim.getOpeningDate()!=null)
  ddo.setData(ddo.dataId(DKConstant.DK_CM_NAMESPACE_ATTR,"OpeningDate"),
   autoClaim.getOpeningDate());
  if(autoClaim.getClaimAmount()!=null)
  ddo.setData(ddo.dataId(DKConstant.DK_CM_NAMESPACE_ATTR,"ClaimAmount"),
   autoClaim.getClaimAmount());
  if( autoClaim.getEventID() != null )
  ddo.setData( ddo.dataId( DKConstant.DK_CM_NAMESPACE_ATTR, "EventID" ),
  autoClaim.getEventID() );
 }
 
 public void setValueToAutoClaim(DKDDO ddo, AutoClaim autoClaim)
 throws DKUsageError
 {
  Object attr = null;
  attr = ddo.getData(ddo.dataId(DKConstant.DK_CM_NAMESPACE_ATTR,
   "ClaimID"));
  if(attr!=null) 
  {
   autoClaim.setClaimID((String)attr);
   attr = null;
  }
  attr = ddo.getData(ddo.dataId(DKConstant.DK_CM_NAMESPACE_ATTR,
   "ClaimStatus"));
  if(attr!=null)
  {
   autoClaim.setClaimStatus((Integer)attr);
   attr = null;
  }
  attr = ddo.getData(ddo.dataId(DKConstant.DK_CM_NAMESPACE_ATTR,
   "OpeningDate"));
  if(attr!=null)
  {
   autoClaim.setOpeningDate((String)attr);
   attr = null;
  }
  attr = ddo.getData(ddo.dataId(DKConstant.DK_CM_NAMESPACE_ATTR,
   "ClaimAmount"));
  if(attr!=null)
  {
   autoClaim.setClaimAmount((Integer)attr);
   attr = null;
  }
  attr = ddo.getData(ddo.dataId(DKConstant.DK_CM_NAMESPACE_ATTR,
   "EventID"));
  if(attr!=null)
  {
   autoClaim.setEventID( (String) attr );
   attr = null;
  }
 }
 
 ...
}
   

Đối với các lớp khác trong biểu đồ lớp, có các lớp Java tương tự như AutoPolicy.javaAutoPolicyDAO.java. Bạn có thể tải về dự án Eclipse có chứa tất cả mã nguồn của lớp Java này.
Triển khai thực hiện lớp cổng cho các thực thể nghiệp vụ Java
Bây giờ bạn đã có một tập hợp các thực thể nghiệp vụ Java và cũng có rất nhiều phương thức hoạt động trong các thực thể này. Nhưng trong phần FileNet Component Integrator (Nhà tích hợp thành phần FileNet), một hàng đợi thành phần chỉ có thể trưng ra một phương thức của lớp Java. Và bạn nên tuân theo các quy tắc sau đây:
  • Lớp phải có một hàm tạo không có bất kỳ tham số nào.
  • Các phương thức phải được công khai.
  • Các phương thức có thể chỉ chứa các kiểu tham số hoạt động thành phần cho phép. Hãy tham chiếu các kiểu tham số hoạt động thành phần.
Nếu bạn muốn tương tác với nhiều lớp Java từ một ứng dụng của bên thứ ba và muốn đăng ký chỉ có một hàng đợi thành phần cho ứng dụng này, thì bạn nên bọc tất cả các phương thức của các lớp Java trong một lớp cổng (gateway). Vì thế với hệ thống Yêu cầu bồi thường bảo hiểm tự động của Công ty ABC, bạn nên bọc tất cả các phương thức hoạt động DAO trong một lớp cổng -- ICMOperation.java -- thể hiện trong mã Java sau.

Liệt kê 3. Lớp của trình bao bọc mẫu - ICMOperation.java
                

public class ICMOperation
{
    public void createAutoClaim(String claimID,Integer claimStatus,
    String openingDate,Integer claimAmount, String eventID) throws Exception
  {
   AutoClaim autoClaim = new AutoClaim();
    autoClaim.setClaimID(claimID);
   autoClaim.setClaimStatus(claimStatus);
   autoClaim.setOpeningDate(openingDate);
   autoClaim.setClaimAmount(claimAmount);
   autoClaim.setEventID( eventID );
   AutoClaimDAO dao = new AutoClaimDAO();
     dao.create( autoClaim );
  }
    
    public Integer retrieveClaimStatusByClaimID(String claimID) throws Exception
    {
     AutoClaim autoClaim = getAutoClaim( claimID );
     return autoClaim.getClaimStatus();
    }
    
    public void updateClaimStatusByClaimID( String claimID, Integer claimStatus ) 
    throws Exception      
    {
      AutoClaimDAO dao = new AutoClaimDAO();
      AutoClaim autoClaim = dao.retrieveAutoClaimByClaimID( claimID );
      autoClaim.setClaimStatus( claimStatus );
      dao.update( autoClaim );
    }
    
    private AutoClaim getAutoClaim( String claimID ) throws Exception
    {
      return new AutoClaimDAO().retrieveAutoClaimByClaimID( claimID );
    }
    
    ...
 
}
   

Một cách giải quyết sử dụng các tham số đối tượng Java khác trong Component Integrator
FileNet P8 Component Integrator (Nhà tích hợp thành phần FileNet P8) chỉ hỗ trợ một số kiểu tham số nguyên thủy. Nhưng nói chung, một số đối tượng Java luôn được sử dụng như các tham số trong một phương thức hoạt động. Ở đây, chúng ta đã giới thiệu một giải pháp để khắc phục hạn chế này: sự tuần tự hóa Java. Hình 3 cho thấy giải pháp này.

Hình 3. Giải pháp tuần tự hóa Java
Giải pháp tuần tự hóa Java
Khi sử dụng tuần tự hóa Java, bạn có thể tuần tự hóa đối tượng Java ban đầu thành một chuỗi trong bộ nhớ. Khi bạn cần nhận đối tượng Java ban đầu, bạn có thể không tuần tự hóa chuỗi đó thành đối tượng Java ban đầu. Hãy lấy AutoClaimDAO.java làm ví dụ. Nếu bạn muốn sử dụng DTO AutoClaim.java làm tham số trong các phương thức hoạt động, bạn cần phải viết hai phương thức tiện dụng. Một phương thức là để tuần tự hóa đối tượng Java AutoClaim thành một chuỗi, trong khi phương thức kia là không tuần tự hóa chuỗi đó thành đối tượng Java AutoClaim ban đầu. Các đoạn mã Java dưới đây cho thấy hai phương thức này.

Liệt kê 4. Mã mẫu về tuần tự hóa và không tuần tự hóa
                
    public AutoClaim parseStringToAutoClaim( String autoClaimString ) 
    throws IOException, ClassNotFoundException
    {
        ObjectInputStream objInput = null;
        try
        {
            objInput = new ObjectInputStream( new ByteArrayInputStream( 
            new BASE64Decoder().decodeBuffer( autoClaimString ) ) );
            return (AutoClaim) objInput.readObject();
        }
        finally
                    if( objInput != null )
            {
                objInput.close();
            }
        }
    }

    public String parseAutoClaimToString( AutoClaim autoClaim ) throws IOException
    {
        ByteArrayOutputStream byteOutput = new ByteArrayOutputStream();
        ObjectOutputStream objOutput = null;
        try
        {
            objOutput = new ObjectOutputStream( byteOutput );
            objOutput.writeObject( autoClaim );
            return new BASE64Encoder().encode( byteOutput.toByteArray() );
        }
        finally
        {
            byteOutput.close();
            if( objOutput != null )
            {
                objOutput.close();
            }
        }
    }
   

Sau đó bạn nên làm cho AutoClaim có thể tuần tự hóa được. Điều cần thiết duy nhất là để cho AutoClaim triển khai thực hiện giao diện java.io.Serializable. Mã sau đây cho thấy AutoClaim có thể tuần tự hóa.

Liệt kê 5. Mã mẫu triển khai thực hiện tuần tự hóa
                
public class AutoClaim implements Serializable{
 private static final long serialVersionUID = 4599855634813333505L;
 ...
}

Bây giờ bạn có thể đăng ký phương thức sử dụng chuỗi để biểu diễn đối tượng Java. Và trong ứng dụng khách, bạn nên sử dụng phương thức không tuần tự hóa để nhận đối tượng Java ban đầu. Hãy xem đoạn mã sau. Chúng ta sử dụng một phương thức trong lớp ICMOperation đã đăng ký để lấy ra đối tượng Java AutoClaim. Sau khi có kết quả, đầu tiên sử dụng phương thức tuần tự hóa để tuần tự hóa đối tượng Java AutoClaim thành một đối tượng chuỗi, sau đó trả về chuỗi cho một máy khách. Một khi máy khách nhận được chuỗi đó, sử dụng phương thức không tuần tự hóa để không tuần tự hóa chuỗi đó thành một đối tượng AutoClaim.

Liệt kê 6. Mã mẫu xem xét xung quanh sự hạn chế tham số
                
    public String retrieveAutoClaimByClaimID( String claimID ) throws Exception
    {
        AutoClaim autoClaim = getAutoClaim( claimID );
        return new AutoClaimDAO().parseAutoClaimToString( autoClaim );
    }
   

Bây giờ chúng ta có các thực thể nghiệp vụ Java và một lớp cổng Java trưng ra tất cả các phương thức hoạt động. Bạn có thể tải về tất cả các mã nguồn trong một dự án Java của Eclipse. Lưu ý rằng mức tuân thủ của trình biên dịch nên được đặt là 1.4 khi tạo các tệp jar tương ứng do sự tương thích của nhà tích hợp thành phần.
Kết luận
Trong Phần 2 của loạt bài này, bạn đã xem xét các trình diễn công việc của FileNet và đã thấy trình diễn công việc dựa trên nhà tích hợp thành phần chi tiết. Bạn đã tạo ra các thực thể nghiệp vụ Java và đã chuẩn bị một lớp cổng Java. Chúng ta cũng đã giới thiệu một giải pháp để vượt qua sự hạn chế tham số của nhà tích hợp thành phần của FileNet.
Phần 3 mô tả cách triển khai thực hiện các trình diễn công việc cho hệ thống yêu cầu bồi thường bảo hiểm tự động của Công ty ABC.

Tích hợp FileNet với IBM Content Manager, Phần 1: Phân tích, thiết kế và mô hình hóa khi sử dụng FileNet Business Process Manager và IBM Content Manager

Giới thiệu về kiến trúc FileNet P8 BPM
FileNet Business Process Manager (BPM) có tính linh hoạt và khả năng mở rộng để xử lý các quy trình nghiệp vụ phức tạp nhất. Nó có thể xử lý hàng triệu giao dịch, hàng ngàn người sử dụng và nhiều ứng dụng nghiệp vụ. Nó cũng cung cấp một bộ các công cụ cho phép bạn tạo, chỉnh sửa, quản lý, phân tích và mô phỏng các quy trình nghiệp vụ riêng của bạn. Quy trình nghiệp vụ có thể được thực hiện trực tiếp trong giao diện người dùng chung, vùng làm việc của FileNet. Bạn cũng có thể xây dựng ứng dụng của bạn với Process Engine API (API Máy Quy trình) để thực hiện các quy trình nghiệp vụ này.
Nền tảng FileNet P8 cung cấp các thành phần cơ bản, bao gồm Máy Nội dung (Content Engine), Máy Quy trình (Process Engine), Máy Ứng dụng (Application Engine) và Máy Biểu diễn (Rendition Engine). Thành phần quan trọng nhất được sử dụng để quản lý quy trình nghiệp vụ (BPM) là Máy Quy trình. Hình 1 cho thấy biểu đồ kiến trúc của nó.

Hình 1. Kiến trúc FileNet P8 BPM
Kiến trúc FileNet P8 BPM
Như bạn có thể thấy trong biểu đồ trên, ngoài Máy Quy trình mạnh mẽ, FileNet BPM cũng cung cấp nhiều dịch vụ và công cụ thuận tiện để quản lý tất cả các khía cạnh của quy trình nghiệp vụ, chẳng hạn như định tuyến quy trình, quản lý các quy tắc, mô phỏng và mô hình hóa quy trình và phân tích quy trình. Phần sau đây cho bạn thấy cách sử dụng các công cụ này để phân tích, mô hình hóa và thực hiện các quy trình nghiệp vụ riêng của bạn.
Giới thiệu kiến trúc IBM Content Manager
IBM Content Manager là một danh mục sản phẩm được thiết kế để quản lý các khối nội dung không theo cấu trúc. Nội dung không theo cấu trúc này bao gồm các tài liệu, các hình ảnh, các tệp âm thanh, các băng video chạy suốt, các bản ghi thanh toán, các bản ghi nghiệp vụ và nội dung Web. Nó cung cấp hai giải pháp quản lý nội dung có sẵn, Khách hàng Windows® và Khách hàng điện tử, dựa trên nền tảng tích hợp của nó cho các giải pháp nghiệp vụ điện tử. Content Manager của IBM hỗ trợ DB2® và Oracle, đó là các hệ thống cơ sở dữ liệu doanh nghiệp chủ đạo. Và nó hỗ trợ nhiều nền tảng bao gồm cả Windows và Linux®, Unix® mức trung gian và z/OS® mức cao. Bằng cách sử dụng các cơ sở hạ tầng bên dưới mạnh mẽ, nó có thể xử lý một khối lượng lớn nội dung với hiệu năng tốt. Hình 2 mô tả kiến trúc của nó.

Hình 2. Kiến trúc IBM Content Manager
Kiến trúc IBM Content Manager
Nhiều công ty, đã sử dụng IBM Content Manager làm kho lưu trữ nội dung quan trọng của họ, có thể tìm nhiều cách để sử dụng FileNet BPM như là cách để quản lý các quy trình nghiệp vụ dựa trên nội dung của họ. Loạt bài này này sử dụng một công ty hư cấu, Công ty ABC, làm ví dụ để cho bạn thấy các hướng dẫn từng bước về cách bạn có thể tích hợp FileNet BPM với IBM Content Manager.
Động lực cho việc tích hợp FileNet P8 BPM với IBM Content Manager là để cho phép doanh nghiệp được hưởng các lợi ích của ứng dụng chuyên sâu nội dung dựa vào quy trình và để di chuyển ra xa khỏi các ứng dụng nguyên khối ở đó các quy trình nghiệp vụ và các quy tắc toàn vẹn thông tin bị chôn chặt bên trong mã ứng dụng. Các khách hàng doanh nghiệp hiện tại của IBM suốt nhiều năm qua đã sử dụng khả năng mở rộng của IBM Content Manager. Họ không chỉ xây dựng các ứng dụng nghiệp vụ trên IBM Content Manager, mà còn tích lũy hàng petabyte nội dung doanh nghiệp trong các kho lưu trữ đó.
Mặt khác, dựa vào yêu cầu để đạt được tính nhanh nhạy nghiệp vụ cao hơn, hiện nay đang có sự chuyển động đáng kể trong các doanh nghiệp để có các quy trình nghiệp vụ của họ thường trú rõ ràng bên ngoài các ứng dụng, để cho họ có thể nắm quyền sở hữu các quy trình nghiệp vụ này, thay vì bị gắn chặt với chu kỳ phát hành của các nhà cung cấp ứng dụng nhằm thực hiện các sáng kiến tái cơ cấu quy trình nghiệp vụ của họ. FileNet P8 BPM cung cấp khả năng tự động hóa quy trình nghiệp vụ tốt nhất cho các ứng dụng chuyên sâu-nội dung. Như vậy, các khả năng của FileNet P8 BPM tích hợp với IBM Content Manager trở thành một nền tảng chiến lược cho các chủ nhân của kho lưu trữ hiện tại với mục đích nắm quyền sử hữu về các quy trình nghiệp vụ của họ trong khi vẫn bảo tồn các vốn đầu tư hiện có trong các sản phẩm kho lưu trữ của chúng ta và không di chuyển hàng petabyte nội dung hiện có.
Case study - các yêu cầu nghiệp vụ của Công ty ABC
Công ty ABC là một công ty bảo hiểm lớn trong một quốc gia mới nổi tập trung vào bảo hiểm nhân thọ và bảo hiểm tự động. Nó có nhiều tài liệu được lưu trữ trong IBM Content Manager, như các tài liệu chính sách, các hình ảnh, các tài liệu về các yêu cầu bồi thường và các tài liệu thông tin khách hàng.
Công ty cần điều chỉnh các quy tắc và logic nghiệp vụ của mình dựa trên việc thay đổi liên tục các yêu cầu nghiệp vụ. Tuy nhiên, rất tốn kém để thay đổi quy trình nghiệp vụ và quy tắc nghiệp vụ được nhúng trong các ứng dụng hiện có. Họ muốn có một giải pháp để cải thiện tính nhanh nhạy nghiệp vụ và để cho phép họ có thể thúc đẩy phát triển nghiệp vụ. Công ty ABC có các yêu cầu sau:
  • Quy trình nghiệp vụ và các quy tắc có thể được mô phỏng.
  • Quy trình nghiệp vụ và các quy tắc có thể được theo dõi, phân tích và thống kê.
  • Các quy trình nghiệp vụ và các quy tắc có thể xử lý với các vai trò khác nhau của con người.
  • Các quy trình nghiệp vụ có thể hoặc tuần tự hoặc song song.
  • Quy trình nghiệp vụ có thể được đồng bộ hóa với bất kỳ quy trình nghiệp vụ khác.
  • Quy trình nghiệp vụ có thể được liên kết với một thời hạn hoàn thành.
  • Quy trình nghiệp vụ có thể tương tác với các ứng dụng của bên thứ ba.
  • Công việc có thể được phân bổ hay được phân bổ lại cho một người sử dụng.
  • Tất cả các cá thể của quy trình nghiệp vụ có thể được quản lý.
  • Một mục công việc của một quy trình nghiệp vụ có thể bị khóa hoặc được mở khóa.
  • Các mốc lịch sử có thể được thêm vào một quy trình nghiệp vụ.
  • Thông báo bằng e-mail có thể được gửi đến người tham gia vào quy trình nghiệp vụ khi có công việc.
Phân tích các yêu cầu nghiệp vụ của Công ty ABC
Có nhiều quy trình nghiệp vụ tại Công ty ABC. Chúng ta sử dụng quy trình nghiệp vụ "Yêu cầu bồi thường bảo hiểm tự động" làm một kịch bản để phân tích các yêu cầu của nó.
Phác thảo cơ sở của quy trình này như sau:
  1. Đại diện dịch vụ khách hàng CSR (Customer Service Representative) thu gom yêu cầu bồi thường của khách hàng, thông tin chi tiết của RoadEvent và các tài liệu liên quan trong kho lưu trữ quản lý nội dung. AutoClaim đã tạo ra (có tất cả thông tin này) được gửi đến người điều chỉnh (Adjustor) để xử lý.
  2. Người điều chỉnh nhận AutoClaim (yêu cầu bồi thường tự động), kiểm tra và đánh giá thông tin chi tiết và các tài liệu liên quan và tính toán ClaimAmount (Tổng giá trị yêu cầu bồi thường) của AutoClaim.
  3. Nếu ClaimAmount lớn hơn $2000, thì AutoClaim này sẽ được gửi đến người giám sát (Supervisor) để phê duyệt. Nếu không, người điều chỉnh có thể phê duyệt AutoClaim này.
  4. Nếu AutoClaim đã bị bác bỏ, người điều chỉnh sẽ gửi một thư thông báo cho người đòi bồi thường này. Nếu không, người điều chỉnh gửi yêu cầu thanh toán.
Có ba vai trò trong quy trình nghiệp vụ này: CSR, người điều chỉnh và người giám sát. Những vai trò này được thể hiện trong Hình 3.

Hình 3. Định nghĩa vai trò của quy trình Yêu cầu bồi thường bảo hiểm tự động của Công ty ABC
Định nghĩa vai trò của quy trình Yêu cầu bồi thường bảo hiểm tự động của                      Công ty ABC
Thiết kế mô hình của hệ thống yêu cầu bồi thường bảo hiểm tự động của Công ty ABC
Hình 4 cho thấy một sơ đồ lớp mô tả các thực thể nghiệp vụ dựa trên các yêu cầu nghiệp vụ:

Hình 4. Biểu đồ lớp của Kịch bản Yêu cầu bồi thường bảo hiểm tự động
Hình 4. Biểu đồ lớp của Kịch bản Yêu cầu bồi thường bảo hiểm tự động
Hình 5 cho thấy quy trình nghiệp vụ như là một biểu đồ hoạt động:

Hình 5. Biểu đồ hoạt động của kịch bản Yêu cầu bồi thường bảo hiểm tự động
Biểu đồ hoạt động của kịch bản Yêu cầu bồi thường bảo hiểm tự động
Kiến trúc của hệ thống yêu cầu bồi thường bảo hiểm tự động của Công ty ABC
Kiến trúc hệ thống để tích hợp FileNet BPM và IBM Content Manager được quyết định sau khi phân tích yêu cầu và thiết kế mô hình. Hình 6 cho thấy kiến trúc của hệ thống yêu cầu bồi thường bảo hiểm tự động của Công ty ABC:

Hình 6. Kiến trúc của hệ thống Yêu cầu bồi thường bảo hiểm tự động của Công ty ABC
Kiến trúc của hệ thống Yêu cầu bồi thường bảo hiểm tự động của Công ty ABC
Cách tiếp cận phát triển được trình bày như sau:
  1. Tạo lược đồ CM8: Mỗi loại mục trong CM được ánh xạ từ một thực thể trong mô hình dữ liệu.
  2. Tạo các đối tượng nghiệp vụ: Chúng ta tạo một tập các đối tượng nghiệp vụ (các lớp Java®) có thể truy cập trong suốt các kho lưu trữ CM8 ở mức cao. Với mỗi thực thể trong mô hình dữ liệu, một đối tượng nghiệp vụ được tạo ra. Hơn nữa, chúng ta tạo ra một lớp cổng (gateway) kết thúc tất cả các hoạt động của tất cả các đối tượng nghiệp vụ và thực hiện chuyển đổi kiểu-dữ liệu để khắc phục một số hạn chế của FileNet P8 BPM Component Integrator.
  3. Đăng ký lớp cổng vào Component Integrator: Chúng ta đăng ký lớp cổng bằng cách sử dụng Component Integrator. Các phương thức của tất cả các đối tượng nghiệp vụ cho một kho lưu trữ cụ thể có thể được truy cập bằng các quy trình nghiệp vụ trong P8 BPM thông qua một hàng đợi thành phần duy nhất.
  4. Định nghĩa quy trình nghiệp vụ: Với việc sử dụng công cụ thiết kế quy trình P8, bạn định nghĩa quy trình ở nơi các bước quy trình có thể tham chiếu các hoạt động của lớp cổng gọi các phương thức tương ứng của các đối tượng nghiệp vụ và cuối cùng giao tiếp với các kho lưu trữ CM8.
  5. Tạo hoặc sửa đổi giao diện người dùng: Bạn có thể tạo hoặc sửa đổi mã khách hàng của giao diện người dùng khi cần để khởi chạy các quy trình, truy cập vào thông tin của những người sử dụng, chấp nhận đầu vào của người dùng và hiển thị của các đối tượng nghiệp vụ và những cái bạn muốn. Điều này được thực hiện bằng cách gọi API của BPM và các phương thức của các đối tượng nghiệp vụ.
Các bước ở trên được minh họa dưới đây khi sử dụng một ví dụ ứng dụng Xử lý yêu cầu bồi thường bảo hiểm của Công ty ABC. Với bước đầu tiên, bạn có thể sử dụng IBM Content Manager System Administrator Client để tạo ra các định nghĩa kiểu-mục. Để thiết lập nhanh, bạn cũng có thể nhập khẩu định nghĩa quy trình từ tệp XML trong phần Tải về. Hình 7 cho thấy việc nhập khẩu này:

Hình 7. Sử dụng IBM Content Manager System Administrator Client để nhập khẩu tệp lược đồ XML
Sử dụng máy khách quản trị hệ thống của nhà quản lý nội dung của IBM để                     nhập khẩu tệp lược đồ XML
Sau khi nhập khẩu tệp lược đồ XML vào IBM Content Manager, bạn sẽ thấy rằng các kiểu mục được nhập khẩu tương ứng với các lớp của biểu đồ lớp trong Hình 4. Hình 8 cho thấy lược đồ nội dung khách hàng:

Hình 8. Kiểu mục được tạo ra
Kiểu mục được tạo ra
Kết luận
Trong Phần 1 của loạt bài này, bạn đã thấy một tổng quan rộng lớn của kiến trúc của FileNet P8 BPM và IBM Content Manager V8. Dựa trên việc nghiên cứu trường hợp của Công ty ABC, chúng ta đã phân tích các yêu cầu nghiệp vụ, tạo ra một mô hình lớp nghiệp vụ và mô hình quy trình nghiệp vụ, đã thiết kế kiến trúc cho hệ thống yêu cầu bồi thường bảo hiểm tự động của Công ty ABC. Và chúng ta cũng đã tạo ra một định nghĩa mô hình dữ liệu trong hệ thống IBM Content Manager để hoàn thành bước đầu tiên của việc triển khai thực hiện hệ thống, bạn có thể tải các tệp đính kèm và nhập khẩu chúng vào hệ thống IBM Content Manager của bạn.
Phần 2 sẽ giới thiệu cho các bạn cách tạo Các thực thể nghiệp vụ Java để thao tác dữ liệu trong kho lưu trữ của IBM Content Manager và cách tạo ra một lớp cổng cho Các thực thể nghiệp vụ Java.

Thứ Tư, 15 tháng 5, 2013

Migrating from PDF forms to IBM Lotus Forms

The PDF form is a type of e-form that is different from Lotus Forms. It can be a static binary file with no interactive fields or a dynamic XML-embedded XML Forms Architecture (XFA) form. Lotus Forms Conversion Tool 3.0 is a plug-in for Lotus Forms Designer that can convert PDF forms to Lotus Forms 3.0 automatically. It supports both static PDF files and dynamic XFA forms. It also includes a number of customized rules and optimizers that can be applied to the conversion process. After the automatic conversion, the plug-in is needed to manually update the converted forms for the presentation layer, XForms instances, and business logic.
This article gives a brief introduction to the PDF migration project, with a detailed description of the Lotus Forms 3.0 conversion tool. It also includes a detailed list of manual effort and requirements, which is an important list for project sizing and estimation. You should be familiar with the IBM Lotus Forms product. Users of IBM Lotus Forms are all welcome to learn and share the project experience with the forms service project.
Introducing PDF forms
PDF is the acronym for Portable Document Format, a file format developed by Adobe® Systems Inc. PDF captures formatting information from a variety of desktop publishing applications, making it possible to send formatted documents and have them display on the recipient's monitor or printer as they were intended. To view a PDF file, Adobe Reader is required; to create or modify a PDF file, Adobe Acrobat Professional or Adobe Acrobat Designer is required.
The PDF form can be categorized into two types: the static PDF form and the interactive PDF form. The static PDF form is a traditional PDF document with no interactive elements. The form is composed of static elements such as text, dot, line, and graphic. The file is stored as a binary format.
The other type of PDF form is the interactive PDF form. In the PDF specification, there are two types of interactive forms:
  • AcroForm. This form, introduced in PDF Specification 1.2, is a collection of fields for gathering information interactively from the user. The contents and properties of an interactive form are defined by an interactive form dictionary that is referenced from the AcroForm entry in the document catalog in the PDF file.
  • XML Forms Architecture (XFA). XFA provides a template-based grammar and a set of processing rules that allow users to build interactive forms. The template-based grammar defines fields in which a user provides data. The open nature of XFA provides a common XML grammar for describing interactive forms, which is a common basis for form-related interactions between form-processing applications. This open nature means that XFA is applied in a large variety of businesses. XFA forms provides a wide range of features:
    • Workflow. This type of form includes data presentation, data capture, and data editing. XFA works as a front-end application to submit data to a back-end server; it also can be used for printing purposes.
    • Dynamic interactions. The dynamic features vary from interactive, human edited forms with dynamic calculations, validations, and other events to server-generated, machine-filled forms.
    • Dynamic layout. Forms can automatically rearrange themselves to accommodate the data supplied by a user or by an external data source, such as a database server. For example, if the data retrieved from the server has 100 rows, the form displays 100 rows.
    • Complexity. This feature includes single-page static forms, dynamic document assemblies based on data content, and huge production runs containing hundreds of thousands of transactions.
XFA, a type of interactive form, is a more advanced type than the AcroForm in the following ways:
  • XFA can be used in XML-based workflows.
  • XFA separates data from the XFA template, which allows greater flexibility in the structure of the data supported and which allows data to be packaged separately from the form.
  • XFA can specify dynamically growing forms.
  • XFA can specify Web interactions, such as HTTP and Web Services Description Language (WSDL). Such interactions can be used to submit data to a server or to request that a server perform a calculation and return the result.
  • XFA works with other XML grammars.
Based on this information, XFA is very similar to Lotus Forms in nature. Table 1 shows a detailed comparison.

Table 1. Comparing Lotus Forms and XFA
Feature listLotus FormsXFA
Elements Extensible Forms Description Language (XFDL) items, options, and XForms items, optionsXFA items and options
DynamicXForms repeatSubform and subform set
Validation testNull, data type, data pattern, and regular expression testNull, data type, format, and script test
ScriptsXForms calculation and XFDL calculationJavaScript™
Data instanceXML data instance or XForms data instanceXFA data template
WebService callSupportSupport
Digital signatureXFDL digital signatureXML digital signature and PDF digital signature
ActiveX Data Object (ADO) APINoneSupport
EmbedSupport embedded in HTMLXML Data Package (XDP), embedded in PDF
LayoutItem location represented in pixels or relative locationHandled by layout processor in object’s container
HTML Not supportedSupport to embed HTML fragment
Migration project requirement
PDF migration projects involve converting existing PDF forms to Lotus Forms. The PDF forms can be static or dynamic. It is important to have the requirement for the project clearly documented before the migration starts, and the requirement should provide element-level detail on each form so that the form developer can process each item according to clear instructions.
Usually the requirement document should contain the following contents:
  • General instructions. This content is a general guideline for the migration. It includes the scope of the migration, features list, and a clear summary of what should be converted from PDF and what should not be converted.
  • Template XFDL form. This template form includes the common style and reusable components, such as toolbar, background color, print setting, label font size and color, country and state list, and so on.
  • Detailed spreadsheet for each form. For each form to be converted, there should be a spreadsheet that describes the content and the mapping between the PDF and XFDL because the elements on Lotus Forms and PDF could have different types and properties. Without the mapping information, the form developer can be lost in trying to find a suitable item type and option value. Table 2 shows the information that should be included in the spreadsheet.

Table 2. Sample requirement information
Column name DescriptionSample value
Item nameElement labelAgency name
TypeConverted element type, which can be different from PDFField check group
Item ruleType of the element dataInteger, one selection choice
FormatValue format, such as a date or zip codeDate: MM/DD/YYYY
Default valueShould the element have a default value?Default 100
RequiredShould the element be required to be filled?Yes or no
RangeValue range, usually used for number values1 to 100
Item lengthSize of the element20
Disable/enable Logic for the enable/disable feature of the elementEnabled if the answer is yes to the first question
Visible/invisibleLogic for the visible/invisible feature of the elementVisible if the answer is yes to the first question
Help message Help text of the element Fill in the name of the agency.
SIDElement SIDAgency_Name
Data instance nameThe data instance name bound to the elementAgency_Name
CalculationFormula if the element value is calculated by other elements=Month1+Month2
PatternReusable pattern that can be applied to this elementSignature button type 1
OthersOther information or logic about the element Signature applies only to section 1 and 2
Migration steps
After the requirement is defined and documented, you can perform the actual migration from PDF to Lotus forms. In general, you need to complete two major migrations steps:
  1. Using the conversion tool, do a raw conversion from PDF to Lotus Forms automatically. The Lotus Forms conversion tool is a Lotus Forms Designer plug-in that can be used to convert from PDF forms to Lotus Forms. Using this tool can save you manual effort in the migration.
  2. Manual updating of the raw converted form. The raw converted form includes only the layout and logic. Based on the requirement spreadsheet, form developers can check each item on the form and update the items in Forms Designer one by one.
The next two sections explain these two steps in detail.
Lotus Forms conversion tool
The conversion tool for IBM Lotus Forms 3.0.1 (the Forms Conversion Tool plug-in) is an innovative, easy-to-use tool that lets business owners and forms developers easily convert Portable Document Format (PDF) files and FileNet e-forms into Lotus Forms. It can also be used to transform existing Lotus Forms. In Lotus Forms Designer, the Lotus Forms conversion tool is embedded as part of Designer 3.5. Follow the link in the Resources section to download the Forms Conversion Tool plug-in or Lotus Forms Designer trial download and install it.
Automatic PDF conversion
After the conversion tool is installed, click File - New - Convert to Lotus Forms. The window shown in figure 1 displays.

Figure 1. The initial Convert Forms window
The initial Convert Forms window
Figure 1 shows the conversion selection window of the conversion tool. Click the Add File button to add more files for conversion. In the format list, two parsers can be selected: PDF and FileNet Select the PDF parser for PDF conversion. Select pdf_default profile in the profile list, and then Click Next.

Figure 2. Selecting the file location
Selecting the file location
Figure 2 shows the window in which you can select the location to store the converted files. The default location is the same folder as the PDF file. You can also select the folder in the Designer Workspace. After you click Finish, the PDF is converted. Figures 3 and 4 show the original PDF form and the converted XFDL form.

Figure 3. Original PDF form
Original PDF form

Figure 4. Converted Lotus Forms form
Converted Lotus Forms form
From these two illustrations, you can see that most of the labels and layouts are converted by the tool.
Customized optimizers and rules
Sometimes the converted result is not as good as expected when you use the default conversion profile. By creating a customized conversion file, you can tune the conversion process in more fine-grained details. Select the Forms Designer Windows - Preferences menu, then select Forms Conversion and Transformation Profiles on the left pane of the Preference window and click New button. The Profile Edit window displays as shown in figure 5.

Figure 5. The Edit Form Conversion Profile window
The Edit Form Conversion Profile window
You can use this window to customize the conversion profile for a specific type of file. The conversion profile includes the following contents:
  • Conversion rules. The rules are used to customize the content of the generated form including adding a toolbar from a template form, updating the element font, color, and border, changing the SID generation rule, and changing the element orders in the XFDL source.
  • XForms generation. This option is used to select the list of controls that are bound to the XForms data instance.
  • Layout optimizers. The optimizers include parameters that you can adjust during the conversion of PDF elements to XFDL elements, such as parameters to create a check box from four lines and to align labels and fields. The optimizers are targeted to create new interactive items (check boxes, fields) on the form based on static items (labels, lines) on the PDF and align existing items (labels or fields) on the form.
During our migration project, we summarized these general guidelines on how to adjust a profile:
  • Create a profile for each batch of forms. Each batch of forms can have a different style. Create a profile for every batch, and tune the parameters to achieve the best result. The profile can be exported and imported, so every form developer could have the same conversion setting.
  • If the form requirement includes detailed XForms rules, you should suggest disabling the XForms instance generation because the generated instance name is based on the SID and usually it does not fit the back-end processing.
  • Enable the Use default width and height option if in the converted form some labels are truncated because an insufficient length is set for the label. This rule can remove the width and height on the label, which uses the default size calculated by Lotus Forms viewer.
  • Disable the “Combine Adjacent Lines/Labels” option if there are too few fields generated on the form. The combination of the lines and labels affects the field generation by the optimizer “Transform a line or a box into a field” because it removes some lines and labels on the form.
Manual update after automatic conversion
In most situations, the automatically converted forms cannot be used directly because the data instances on the form are not well organized and the migration project usually requires that the data instance conforms to certain schema that can be submitted to the back-end processing flow.
Manual update items
The manual update is a required step in the migration project to address the missing features that automatic conversion can not fulfill. There are a few steps required:
  1. Adjust the detailed layout, format, logic, and SID based on the documented form spreadsheet.
  2. Generate the XForms data instance and XForms binding based on the business logic.
  3. After automatic conversion, the unconverted PDF element, such as unrecognized color space or images, creates an XML comment in the XFDL. Manual update is required to clear these comments or update the unconverted items based on the comments.
  4. Update the digital signature based on the requirement. The auto conversion can generate only a Clickwap signature.
  5. Update the data submission based on the requirement. The auto conversion doesn’t handle the data submission in the original PDF form.
  6. Update the logic based on the JavaScript in the PDF form. The auto conversion doesn’t convert the JavaScript to XFDL script.
  7. Update graphic elements. In the PDF form, there could be graphic elements such as a vector image, an oblique line, and a curved line. These elements are not supported by Lotus Forms, but they can be replaced by using JPG or GIF images captured from the PDF form.
Manual QA checklist
After the manual update, the form is generated and enters the quality assurance (QA) process. Table 3 lists the items that we summarized from our migration project that need to be highlighted in the QA process.

Table 3. QA checklist
NameDescription
Font and colorSome fonts or colors in PDF do not show correctly in Lotus Forms. You need to check for any differences during the QA process.
Layout checkCompare the forms layout in Lotus Forms viewer or Webform Server with the original PDF. Focus on the labels and the lines. For example, in PDF the character width can be adjusted, but it is fixed in Lotus Forms. This discrepancy can cause the labels to look different.
Printing checkPrint out both the converted form and the PDF. Compare the printed forms on paper to check any discrepancies.
Data validation ruleCompare the data validation on PDF and the converted form by entering data on the forms.
Script logicCompare the XFDL and XForms logic with the JavaScript in the PDF to check that it is implemented correctly in the converted form.
Dynamic partPDF and XFDL both support generating dynamic contents. You can test it by generating a full set of data in the data instance.
Conclusion
In general, the PDF migration project includes a well-defined requirement for each form, an automated PDF conversion tool, and manual update and QA processes. Because part of the process is automated and requires knowledge of PDF, it is different from other Lotus Forms projects, such as creating forms from scratch. Leveraging the Lotus Forms conversion tool is a good adoption in a PDF migration project.
Gu Yi, Lead Software Engineer, IBM