Business components framework6601233Abstract A method of generating software based on business components. A plurality of logical business components in a business are first defined with each business component having a plurality of capabilities. Next, functional interrelationships are identified between the logical business components. Code modules are then generated to carry out the capabilities of the logical business components and the functional interrelationships between the logical business components, wherein the code modules represent a transformation of the logical business components to their physical implementation, while ensuring the capabilities that are carried out by each code module are essentially unique to the logical business component associated with the code module. Next, the functional aspects of the code modules and the functional relationships of the code modules are tested. The code modules are then subsequently deployed in an e-commerce environment. Claims What is claimed is: Description FIELD OF THE INVENTION
Service Detail
Retrieve from Codes Table Retrieve single decode value
Retrieve all decode values
Maintain Codes Table Update single Code/Decode
Update all Codes/Decodes
Set Table Name
Add new Code/Decode
Remove Code/Decode
Add Table
Remove Table
Components The Codes Table Framework consist of the following COM objects:
Component Service
AFRetrieval Retrieve decode(s) from the codes table.
AFMaintenance Maintain the codes table.
These components are described in detailed in the following sub-sections. AFRetrieval The AFRetrieval component enables the application developer to load the specified codes table into local memory (for faster access) and retrieve the requested decode(s). Methods The IAFRetrieval interface defines the access to the AFRetrieval component. This interface supports the following methods:
Method Description
setTableName Retrieve the requested codes table into local
memory and store the table name for
subsequent retrieval requests (instead of
retrieving from MTS shared memory).
getDecode Search through the currently identified local
codes table and return the `decode` associated
with the `code`. Refer to setTableName
method.
getNumRows Return the number of code/decode pairs
contained in the currently identified local
codes table. Refer to setTableName method.
getCodesTable Return all the codes and decodes for the
specified codes table.
AFMaintenance The AFMaintenance component maintains the specified local codes table. Methods The IAFMaintenance interface defines the access to the AFMaintenance component. This interface supports the following methods:
Method Description
setTableName Store the name of local codes table to be
accessed for subsequent maintenance requests.
setCodeDecode Dynamically add a code/decode pair to the
currently identified local codes table. Refer to
setTableName method.
Add Replace all code/decode pairs of currently
identified local codes table with the passed in
code/decode pairs. Refer to setTableName
method.
Append Append the passed in code/decode pairs to the
currently identified local codes table. Refer to
setTableName method.
setCodeDecodeByTable Return fully populated codes table directly
from the database.
delCodeDecode Remove specified code/decode pair from
currently identified local codes table. Refer to
setTableName method.
DelCodesTable Remove the currently identified local codes
table from local memory. Refer to
setTableName method.
SAP Framework Design FIG. 1C illustrates a method 150 for providing an interface between a first server and a second server with a proxy component situated therebetween. Initially, in operation 152, a request for a business object is identified by an application on the first server. The first server is connected to the second server in operation 153. In operation 154, selection criteria from the first server is transmitted to the second server. In response to the selection criteria, the first server receives a first recordset and a second recordset from the second server in operation 155. Business data is included in the first recordset and result codes are included in the second recordset. The first and second recordsets are mapped to the business object in operation 156 and, in operation 157, the business object is sent to the application on the first server. The first and second recordsets may also be mapped to the business object using a utility conversion function. Additionally, the first and second recordsets may also be mapped to the business object using a utility conversion function. Optionally, the recordsets may be ActiveX data objects (ADO) recordsets. The first server may also receive a third recordset from the second server in response to the selection criteria. This third recordset may include errors and references to an error table on the first server for allowing processing of the errors. In a further embodiment of the present invention, changes to the proxy component may be prevented from affecting the application on the first server. Additionally, generation of a plurality of the proxy components by a user may be allowed. The following material provides a more detailed description of the above-described method. This portion of the present description details the ReTA SAP framework design from the perspective of the application developer. The role of this framework is to provide designs and templates that describe how to integrate an Internet application with a SAP server. Unlike the other ReTA frameworks, this does not provide any code components for connecting to SAP, but uses the SAP/DCOM component connector created jointly by Microsoft and SAP. This portion of the present description provides a framework for the design of the architecture using the SAP DCOM connector components to integrate with SAP. The DCOM Component Connector provides interoperability between R/3 objects and COM objects across a heterogeneous network through well-defined business interfaces. It provides the development tools for connecting with SAP to standard SAP BAPI's (Business Application Programmer Interface) as well as custom developed or modified BAPI's. The DCOM component connector can connect to SAP on Windows NT or UNIX. The Application server needs to be R/3 Version 2.1 or higher or R/2 with 50D. The ReTA SAP framework uses an adapter layer design that places a wrapper around the DCOM component connector. The adapter layer improves developer productivity by managing some of the lower level tasks, and improves the flexibility of the final solution. The remainder of this portion of the present description describes the Execution and Development Architectures for the SAP framework. SAP Framework Execution Architecture The DCOM Component connector uses COM proxy components that map to SAP Business Objects. There is one proxy component for each SAP business object. The SAP business objects can contain both the standard BAPI's (Business Application Programmer Interface) as well as custom developed or modified BAPI's. The SAP/DCOM component generation wizard connects to SAP, examines the SAP business object, and generates a proxy component with the same interface. The SAP/DCOM connector component can connect to SAP on Windows NT or UNIX. FIG. 1D shows the execution architecture for components that make up the SAP Framework Execution Architecture 160. Referring again to FIG. 1D, the different layers in the SAP framework architecture are shown. The SAP/DCOM connector generated components 162 provide the actual connection to SAP 164. These components are generated from the SAP Business Application Programmer Interface (BAPI) 166,168. The BAPI's are either the standard SAP BAPI's, custom created BAPI's or Remote Function Calls. The ReTA framework uses an Adapter layer to provide a thin wrapper on the SAP/DCOM connector components. The adapter layer provides the following benefits: It insulates the application from changes in the SAP/DCOM connector components. It provides utility functions for mapping the SAP/DCOM connector data types to the types required by the application. It maps the SAP return error codes to the format required by the application. The SAP/DCOM connector generated components use ADO (ActiveX Data Objects) recordsets to pass data to SAP. The adapter layer components map from these recordsets to the Business Objects or Business Data format used by the application. If a given method returns business data from SAP then this is in the form of an ADO recordset. If a method updates information in SAP then one must pass in an ADO recordset with all the data. To initialize this ADO recordset one calls a separate standard interface method of the proxy component. SAP returns business errors by returning a separate ADO recordset that references an error table. The ReTA framework's adapter layer maps the ADO recordsets that the DCOM connector uses to the business objects or data objects used by the application. The adapter layer also maps the error table recordset returned by SAP to the error handling mechanism used by the application. SAP Framework Development Architecture SAP/DCOM Component Connector Generation The SAP/DCOM connector portion of the present description gives a detailed description of how to generate a COM proxy component for a given SAP BAPI. The steps for creating a proxy component are: Using the DCOM Component Connector browser based tool, create a destination entry for the SAP Application server. Use the DCOM Connector wizard to connect to this destination. Browse through the available SAP Business Objects on the remote SAP system. Select a business object and click Generate Component DLL. The DCOM Component connector may then generate C++ and IDL files, compile these files to create the proxy component and install this component in MTS. SAP Adapter Component Design This portion of the description describes the responsibility of the SAP adapter components and gives a template for a component. The SAP Adapter components are responsible for: Insulating the application from changes in the SAP BAPI. Receiving business data from SAP Updating business data in SAP Mapping to/from the SAP returned data types Mapping the SAP error return codes to the error handling mechanism used by the application. There is a one to one mapping between the SAP Adapter components and the generated SAP/DCOM connector components. SAP Adapter Component Template This template gives an example of an SAP connector component with one method to receive business data and one method to send business data. It describes how to convert to/from the data types required by the SAP Connector component and how to manage the SAP return error codes. Function GetSAPData(<in>selectionCriteria, <out> businessObject):integer Create instance of the corresponding SAP connector component Call corresponding SAP method passing in selectionCriteria.SAP may return an ADO Recordset with the business data and a second ADO Recordset with the Result codes. Call an error utility function that maps the error return codes onto the applications error handling system. Map the return recordset onto the businessObject (possibly using utility conversion function). Return the business object to the caller of the function. Function SetSAPData(<in>businessObject):integer Create instance of the corresponding SAP connector component Call the SAP connector standard method DimAS to retrieve the recordset that may be populated from the businessObject. Populate the recordset from the businessObject (possibly using utility conversion function). Cal the corresponding SAP method passing in the recordset. Call the error utility function that maps the error return codes onto the applications error handling system. Gives an example of an adapter component that demonstrates retrieving and updating SAP data and handling the SAP error codes. MTS Framework Design FIG. 1E illustrates a method for sharing context objects among a plurality of components executed on a transaction server. In operation 170, a first component is executed on a transaction server. A context object is then generated for the first component in operation 172 to control a scope of the execution of the first component. In operation 174, a call made by the first component is identified to execute a second component. The context object of the first component is utilized for controlling the scope of the execution of the second component in operation 176. Optionally, the first and second components may be service order item components. The first component may be an activity component and the second component may be a business component. As an option, a plurality of activity components may be provided. As another option, a call made by the activity component may also be identified to execute a second business component with the context object of the activity component utilized for controlling the scope of the execution of the second business component. As a further option, a call made by the activity component may be identified to execute an error logging component with an additional context object separate from the context object of the activity component being utilized for controlling the scope of the execution of the error logging component. The following material provides a more detailed description of the above-described method. This portion of the present description details the ReTA approach to performing "logical unit of work" database operations in the context of transactions. Applications developed with ReTA implement transactions through Microsoft Transaction Server (MTS). Within the MTS transaction context, ReTA applications group business components into transactions. The application developer designs each business component to define whether its actions should be performed within a transaction. In addition, this portion of the present description details the MTS framework features and their implications on ReTA application design. MTS Transactions: Application Design Implementation Description There are two main tasks the developer performs to design applications that use MTS to support transactions: Code the application component to be MTS aware. Use MTS services to group database operations into transactions. Design MTS Aware Components FIG. 2 illustrates a create component instances method 200. MTS controls the scope of transactions by using transaction context objects. Each transaction server component has an associated MTS context object 202, which controls the transaction context. If a component 204 needs to create instances of other components 206 during its processing, it uses the CreateInstance method of the MTS context object to create the new object. Calling this method ensures that the new component has an associated MTS context object 202 with the correct transaction scope. Group Database Operations into MTS Transactions The following portions of the present description include three database operations grouping scenarios that a ReTA application developer can implement through MTS. Compose Work from Multiple Components in the Same Transaction As illustrated in FIG. 3, in this scenario, the developer composes the work of a business activity 300 into a single transaction. Activity 300 uses business objects in components 302 and 304 to compete its work. Any database operations generated by either of these business components are completed in the context of a single transaction. To achieve this functionality, the developer uses the default transaction context scope that MTS provides. The developer sets the transaction attribute of the Activity component to Requires a transaction and the attribute of the business components to either Requires a transaction or Supports transactions. When the activity component initializes, MTS creates a corresponding context object 306. Subsequently, when the activity component initializes the business components, these business components share the same context object and are therefore committed in the same transaction. When the Activity completes and the reference to the activity component is removed, the transaction is committed. If any of the database calls, fails or any of the components decides to abort the transaction, the transaction is aborted and all the database actions performed are rolled back. Force a Component's Database Operations to Use a Separate Transaction In this scenario, as illustrated in FIG. 4, the developer creates a component whose database operations are always carried out in a separate transaction. For example, an error logging component 402 should not use the transaction context of the component generating the error. This could cause the error logged to the database to be rolled back if an error occurs in a separate database operation. This scenario has an activity component 400, two business components 404,406 and an error logging component 402. If an error occurs in the activity, then an error message is sent to the error logging component (which logs the error in a database). The transaction of the activity is rolled back, however, the transaction of the error logging component is committed to the database. In this scenario, the developer uses the default behavior of MTS. The error logging component is registered as Requires a new transaction. When the activity component initializes the error logging component, MTS creates a new transaction context for the component. If an error occurs in the activity, the database operations for the activity is rolled back, but any database operations that the error component generates is committed. Compose Work from Multiple Activities in the Same Transaction With reference to FIG. 5 (which illustrates the compose work form multiple activities in the same transaction); in this scenario, the developer creates two separate activities 500,502 whose work sometimes need to be composed into a single transaction. To achieve this functionality using MTS, the developer creates a third activity component 504 that calls the other two activities. The third activity component is registered as Requires a transaction. When this component initializes, MTS creates a new transaction context. When the activity 504 initializes the other two activities 500,502, they share the same transaction context 506 (and any objects they create also have the ability to share the transaction context). MTS Features: Application Design Implications Description Note: A FinancialWorks Knowledge Exchange (kX) posting (Optimizing Performance) provided most of the content for this portion of the description. This portion of the description provides insight on the following MTS features: Connection Pooling Stateless/Stateful objects Package threading Transactions Just in Time activation Object creation Parameter Passing. Connection Pooling MTS and ODBC provide connection pooling. MTS/ODBC associates a connection pool with a specific user account. Therefore, it is important that all data access components have a pre-defined account to use when requesting database connections. In addition, connections are pooled only within the same process. This implies that every MTS package may have a pool of connections, as each MTS package runs in its own process. Note that the ODBC connections are pooled, not the ADO connections. When the application code closes the ADO connection, the corresponding ODBC connection stays in the pool until a configurable timeout expires (cptimeout). The configurable timeout key is in the registry under "Hkey_Local_Machine.backslash.Software.backslash.ODBC.backslash.ODBCINST. INI.backslash.<driver name>.backslash.cptimeout" (with a default value of 60 seconds). Connection pooling can be turned off by setting this value to 0. In effect, connection pooling keeps more connections open with the database but saves the (expensive) overhead of re-creating the connection every time. Note: Connection pooling is a feature of the ODBC resource manager. MTS automates the configuration of the ODBC resource to enable connection pooling. Implications on Application Design Create accounts for account packages. Group components under the appropriate credentials and packages. The Database server is a resource bottleneck. To improve performance, ensure high bandwidth connections exist between application and database servers. Connection pooling provides performance improvement especially in the case where connections are used and released frequently such as Internet application. Stateful and Stateless Objects MTS supports the concept of a stateful object. However, the object must satisfy the following conditions: 1) The object can not be transactional. 2) Even if it is marked as non-transactional, it cannot participate in a transaction (i.e. cannot be called from a transactional object or call a transactional object). The reason is that MTS implements an activity concept. In the activity concept, all objects participating in a transaction (or LUW) are logically "grouped" together. Upon the completion of that transaction, SetComplete is called and all objects in that activity are freed. Thus, no object in the transaction holds context (state) on transaction completion. 3) To enable a stateful object to participate in a transaction, partition the object into two parts: Stateful and Transactional. The Stateful part lives outside MTS and uses the TransactionContext object to manage manually (making explicit calls to start, commit and/or abort) the transaction inside MTS. To maintain transactional integrity, use the TransactionContext (as opposed to the ObjectContext) to create MTS objects. Therefore, the TransactionContext is passed inside MTS for later use of any MTS object instantiation. On the server, the code looks like the following: Set MtsObject=MtxTransactionContext.CreateInstance("progid") Implication on Application Design In general, be deliberate with MTS and state. When working with MTS components, it is recommended to keep the context(state) on the client and have the server components be service driven. These components are instantiated to provide a service and then are freed. Package Threading Every time a package receives a method call, MTS creates a new thread to service the request. At the time of writing this portion of the present description, MTS packages have a maximum limit of 100 threads per package. If the number of the incoming concurrent calls exceeds 100, MTS serializes all excess calls. Project testing (a FinacialWorks project) proved that performance degraded significantly after reaching the 100 concurrent threads mark. Implication on Application Design Due to this limitation, package the application DLLs in a way to minimize thread contention. For future releases of MTS, Microsoft claims the limit for concurrent calls may increase to 1000. Activities MTS defines an activity as set of objects acting on behalf of a client's request. Every MTS object belongs to one activity. The activity ID is recorded in the context of the object. The objects in an activity consist of the object created by a base client and any subsequent object created by it and all of its descendants. Objects in an activity can be distributed across several processes (and machines). Whenever a base client creates an MTS object, a new activity is created. When a MTS object is created from an existing context, the new object becomes part of the same activity. The object's context inherits the activity identifier of the creating context. Implication on Application Design Activities define a single logical thread of execution. When a base client calls into an activity, all subsequent requests from other clients are blocked until control is returned to the original caller. Automatic Transaction Control MTS initiates a transaction when a method on a transactional component is called. MTS records the transaction ID in the component's object context. This transaction ID is passed to other MTS components' context objects requiring participation in the same transaction. MTS operates with an optimistic assumption that the transaction is going to succeed. If the component never calls SetAbort, SetComplete, DisableCommit, or EnableCommit, the transaction commits when the client releases its last reference to the MTS component. If the component calls SetComplete, the transaction commits as soon as the method call returns to the client. When the component calls SetAbort the transaction aborts as soon as the method call returns to the client. If the component calls DisableCommit, the transaction aborts when the client releases its last reference to the component. If the component calls EnableCommit, the transaction commits when the client releases its last reference to the component. Implications on Application Design When designing the transaction timeout, consider the potential for slow system and network response times. The application design should avoid long running transactions and attempt to break them into smaller ones. Note There is no explicit Commit method. If no objects have aborted the transaction by calling SetAbort or disabled commitment by calling DisableCommit, MTS may automatically commit the transaction when the client releases its object references. Manual Transaction Control Transactions can also be manually controlled from a base client by using the transaction context to start and commit/abort a transaction. This is particularly useful in the case where a stateful base client activates an MTS-managed transactional object to carry out a distributed transaction. In order to achieve that, MTS uses the Transaction Context created by the base client. Just-In-Time Activation For every business object created, MTS intercepts the call and creates a sibling object called the Object Context. It is the object context that may manage the transaction and the business object activation/deactivation. One of the interface methods on the context object is SetComplete. When SetComplete is called, the transaction (if any) is signaled as ready to be committed and the instance of the business object is destroyed releasing all resources used by it. The next time the client issues a method call, MTS creates a new instance of the business object and delegates the call to it (this is assuming that the client did not release its original reference to the MTS-supplied context wrapper). In the MTS world, this is known as JIT activation. The following method call trace illustrates JIT activation: The client application starts, and the client requests an instance of the CustomerInterface of the Customer component. Set objICustomer=CreateObject("CustomerComponent.CustomerInterface"). COM searches the Running Object Table to determine whether an instance of the component is active on the client. If not, COM searches the Registry for the information describing CustomerInterface and invokes the creation of the interface. MTS 600 intercepts the Customer creation request 602, starts a process for the Customer package containing Customer component 604, creates the ContextObject 606 and returns a reference to the client. See FIG. 6. The client application requests an operation on the CustomerInterface. MTS invokes the operation and commits the transaction (if any) by calling Setcomplete. MTS 700 deactivates the component, freeing the thread, the memory and returns the result to the client. FIG. 7 shows that the customer object 702 has been deactivated (the customer object is grayed out). To take advantage of JIT activation, the clients do not release the reference to the MTS-supplied context wrapper (the client code does not set objICustomer=null). When the client requests a new operation, the Context wrapper creates a new instance of the Customer component and delegates the incoming call to it. By keeping the reference to the context wrapper, MTS does not need to recreate the object. Implications on Application Design To take advantage of JIT activation, client applications acquire references to the server components as early as possible and uses them as needed. It would be ideal to obtain references at application startup, but this has the drawback of not being reliable. If for some reason the references were lost, this may result in run time errors. Object Creation: New vs. CreateObject vs. CreateInstance This portion of the description describes the appropriate usage of the different types of object creation methods. New The keyword "New" creates an object with private instantiation property. It is used with early binding. CreateObject Normally used with late binding and used to create objects with public instantiation property. If other MTS object are instantiated using CreateObject (on the server), they run the risk of running in the wrong context. CreateObject can be used from the client to instantiate any MTS object. CreateInstance It is the interface method of the context object used to instantiate other MTS objects. This is the only way to guarantee the newly created object participates in the same current transaction. When MTS instantiates a transaction, it records the transaction ID in the component's object context. This transaction ID is passed to other MTS components only when CreateInstance is used to create these objects. Implication on Application Design When CreateObject is used, Java/VB uses COM to create an instance of the object. If the Object is registered in MTS, MTS loads the DLL and creates a new instance passing back a MTS-managed handle to the object. The object gets a new MTS context. When New is used in Java/VB, the action depends on where the object being created lives. If it is in a different DLL, COM is used and the mechanism is the same as CreateObject. If it is in the same DLL Java/VB creates the instance internally and may not create a new MTS-managed object, whereas CreateObject may. Private classes can only be created using New since they are not exposed to COM. When one MTS object creates another MTS object, the new object gets a new context. If CreateObject (or New for an object in a different DLL) is used, the contexts are independent of each other. If a transaction is involved, the new context manages a completely different transaction from the original. If CreateInstance is used, the new object's context shares the same transaction as the invoking one. Using New is only a problem in the following scenario. The application contains one DLL that contains more than one MTS-managed class. The application wants an instance of one of these classes to create an instance of the other (in separate contexts). New may not do this, whereas CreateObject and CreateInstance may. However, CreateInstance is required if they are to run under the same transaction. Parameter Passing If Visual Basic is the language of choice, make sure to pass parameters by value (as the default in VB is by reference). This may help reduce network trips and hence improves performance. If one is passing the collection object in MTS, make sure to use the Microsoft provided wrapper collection object. The standard VB collection object is known to cause errors when running under MTS. It is better to use a variant array instead of collection to pass information around. It is more robust and performs better. As parameters, MTS registered business objects are passed by reference as they use standard marshalling When working with MTS objects, ensure that object references are exchanged through the return from an object creation interface such ITransactionContext.CreateInstance or IObjectContext.CreateInstance. This allows MTS to manage context switches and Object lifetime. Data Access and Locking Policy Database Locking should be in place to ensure the integrity of the database in a multi-user environment. Locking prevents the common problem of lost updates from multiple users updating the same record. The optimistic approach of record locking is based on the assumption that it is rarely the case for multiple users to read and update the same records concurrently. Such a situation is treated as exceptional processing rather than normal. Optimistic locking does not place any locks at read time; locks are actually placed at update time. A time stamp mechanism should be provided to ensure that at update or delete times the record has not changed since the last time it is read. It is recommended to use optimistic locking with ADO and MTS to improve performance. If the data access mechanism uses ADO disconnected RecordSets, then the only possible locking policy is optimistic. Implication on Application Design If one is using optimistic locking and ADO, it is recommended that one uses disconnected recordsets to marshal data. Project experience (FinancialWorks project) shows that the application should avoid using the ADO RecordSet.GetRows method, as it significantly slows performance. Data Marshaling Use disconnected Recordsets. This may ensure high performance result when marshaling data across a network. Client applications have to reference an ADOR.Recrodset, which is a lighter version of the ADODB.Recordset designed specifically for client's use. With disconnected Recordsets only optimistic locking can be employed. If the marshalling of data from client to server is done by collection, beware to use the wrapper collection provided on the MTS site. MTS may not work correctly when passing the VB standard collection object. It is known to cause runtime errors. Activity Framework Design FIG. 8A illustrates a method for providing an activity framework. First, in operation 800 a plurality of sub-activities are created which each include sub-activity logic adapted to generate an output based on an input received from a user upon execution. In operation 802, a plurality of activities are defined, each of which execute the sub-activities in a unique manner upon being selected for accomplishing a goal associated with the activity. Selection of one of the activities is allowed in operation 804 by receiving user indicia. In operation 806, an interface is depicted for allowing receipt of the input and display of the output during execution of the sub-activities associated with the selected activity. The sub-activity logic may be adapted for verifying that all required input has been received prior to generating the output. Access to the input received from the user by each of the sub-activities of the activities may also be allowed. Optionally, the activity may include creating a service order. Further, the sub-activities each may additionally include at least one business component. The interface may include a plurality of displays that are each displayed during the execution of a corresponding one of the sub-activities. The following material provides a more detailed description of the above-described method. This portion of the present description details the ReTA Activity framework design from the perspective of the application developer. The primary role of this framework is to provide services that support the "model view controller" (MVC) design pattern. In this pattern, the application implements a "separation of concern" among the user interface (view), logical unit of work (controller) and business components (model). Separating the user interface from the business logic increases reuse of the interface and the business component. In this design pattern, different types of interfaces can reuse the same model and the same interface can view different models. Another goal of separating presentation and storage responsibilities is to reduce the impact of change. For example, changing the user interface design should only impact the user interface components and not the business logic. Through modeling the "separation of concern" pattern, the ReTA Activity framework increases application maintainability and flexibility. It also encourages "best practice" coding standards. Activity Framework Description See FIG. 8B, which illustrates the MTS runtime environment 830. The ReTA Activity framework distributes the application development responsibilities as follows: Web page (Active Server Page) (View/Controller) The application's web page logic 832 starts the activity 834, executes the sub-activity and creates the user interfaces. No business logic is contained directly in the web page code. The application developer leverages the ReTA Session, ReTA Activity and the ReTA UI frameworks from the web page code. Activity Components (Controller) The application's activity logic implements the business process logic (functional control logic) 836. Activities support high-level processes that are not the responsibility of any individual business components. This includes high-level steps related to a user's "logical unit of work" or business function. Thus, activities enable multiple web pages to implement a "logical unit of work". An example of an activity implementing a "logical unit of work" with multiple web pages is "Create Service Order". In this example activity, the user selects a service to order on the first page, enters the customer information on the second page, reviews and submits the order on the third page and receives an order confirmation on the fourth page. Business Components: (Model) Business components 837 implement the application's business entity logic. These components represent individual business entities (such as customer or account). Each entity encapsulates its own data and behavior acting on that data. Note: The Activity implements business logic that spans multiple business components. The ReTA Activity framework consists of the following three main components: Activity An activity 834 encompasses a combination of web pages, which fulfill a business function. The activity has the following responsibilities: Provide a "logical unit of work" context to all sub-activities within the activity. The Activity framework uses Microsoft Transaction Server (MTS) transactions to implement the "logical unit of work" concept. On the completion of a transaction (whether successful or abort), MTS ensures that each sub-activity may be in a consistent state (either completed or rolled back). Check that requested information and conditions are fulfilled before executing logic. Maintain information shared between the pages of the activity. Create, trigger and manage sub-activities. Check page access authorization, when browsing through activity pages. Release all maintained information when closed. Execute post-conditions when closed. Examples of post conditions are releasing resources tied up for the activity or removing pessimistic locks on tables. Commit or abort all opened sub-activities. The activity (by itself) does not contain any business logic. Sub-activities (and their associated business components) provide the business logic. Thus, the activity maintains a context and provides a "logical unit of work" for a specific business functionality. Sub-activity A sub-activity 838 executes a sub-part of the overall activity business logic. The sub-activity represents the smallest grained business logic. For example in a "Create Service Order" activity, one sub-activity retrieves all the service types information to display on the first web page. A sub-activity has the following responsibilities: Check pre-conditions. Ensure requested information and conditions are fulfilled before executing business logic. Execute business logic Execute post-conditions. View A view 840 defines the mapping between a user interface and business components containing the values to display. The view has the following responsibilities: Unplugging the user interface from the business component values. Automatically and transparent to the developer, capture all the values entered by the user and update the related business components. Display the business component values attached to the user interface. Trigger a sub-activity when capturing values. Note: The Activity component maintains a separate view for each web page defined to be part of the activity. Note The ReTA Activity framework fully supports business activity components written in Java or Visual Basic. In addition, the Activity framework provides partial support for business activity components written C++. For C++ components, the application developer must implement the services provided by the Activity utility classes AFView and AFViewBOMapping. Services The Activity Framework provides the following services:
Service Detail
Logical unit or work Microsoft Transaction Server transaction
principles
Maintain context Business Component context
User Interface context - List boxes
Sub-Activity context
Security Page access authorization - Activity scope
Validation Pre-conditions - Activity level check
Post-conditions - Activity level check
Sub-Activity - Smallest Pre-conditions - Sub-Activity level check
grained business logic Execute business logic
Post-conditions - Sub-Activity level check
View - Mapping between a Unplug user interface from business
user interface and business component
components Capture user entry and update business
component
Display value attached to business
component
Visual Basic support Wrapper to support Activities written in
Visual Basic
Components and Classes The Activity Framework implements these services through the following COM and Class objects:
Component Service
AFActivity Implements "logical unit of work".
Manages collection of Sub-
Activities and Views.
AFSubActivity Implements a sub-part of the
overall activity business logic.
AFCollection General purpose Collection
component.
AFVBActivity Wrapper Enables Activity Components
written in Visual Basic.
Class
AFView For a specific Active Server Page,
AFVBView defines the mapping between a
collection of user interface entry
fields and the business component
instances containing the values to
display. Note: Multiple views can
exist for a single ASP. For
example, a separate view can be
defined for each form on a page.
AFViewBOMapping Defines the mapping between a
AFVBViewBOMapping user interface entry field and the
business component instances
containing the value to display.
AFViewRadioButtonBOMapping Defines the mapping between a
AFVBViewRadioButtonsBOMapping user interface radio button
field and the business component
instances containing the value to
display.
AFViewDynamicBOMapping Defines the mapping between a
AFVBViewDynamicBOMapping dynamically created user interface
entry field and the business
component instances containing the
value to display.
AFViewTextAreaBOMappping Defines the mapping between a
AFVBViewTextAreaBOMapping user interface multi-line entry field
and the business component
instances containing the value to
display.
AFViewDropDownBOMapping Defines the mapping between a
AFVBViewDropDownBOMapping user interface drop down combo
box field and the business
component instances containing the
value to display.
AFViewUIListBOMapping Defines the mapping between a
AFVBViewUIListBOMapping user interface Selected List Box
field and the business components
containing the values to display.
AFViewThumbNailBOMapping Defines the mapping between a
AFVBViewThumbNailBOMapping user interface ThumbNail (iconic
pushbutton) field and the business
components containing the values
to display.
These components and classes are described in detailed in the following sub-portions of the description. AFActivity The AFActivity component provides the structure for implementing business logic, state management among web pages, management of views and sub-activities, and transactional support for carrying out a "logical unit of work". The application developer creates an activity component for each specific business activity by extending the AFActivity component. The activity component shares the services provided within the Activity framework allowing the application developer to concentrate on the business logic. Application business logic is organized into three separate areas within an activity: pre-conditions, execution, and post conditions. Methods The IAFActivity, IAFContext and IAFEventListener interfaces define the access to the AFActivity component. These interfaces support the following methods:
Method Description
Start Start the activity. The application developer
calls this method from the ASP page.
Stop Release the activity and all its associated
instances. Calls the commit method. The
application developer calls this method from
the last ASP page for the business activity.
Abort Gracefully abort the activity. Abort associated
sub-activities. Remove all references to sub-
activities, business components and stateful UI
components.
Commit Declare that the current activity and all its
sub-activities have completed their work and
should be deactivated when the currently
executing method returns to the client. This
method may call the setComplete method of
MTS. (See MTS portion of the present
description for more information)
RetrieveUIInstance Retrieve a User Interface component
instance from the UI context of the activity.
AddToUIContext Add a User Interface component to the UI
context of the activity.
ExecuteSubActivity Execute the sub-activity related to the current
page for the Activity. Call the sub-activity
precondition, execute and postcondition
methods.
IsPartOfActivity If the ASP name passed as a parameter is part
of the activity, return true. This method calls
the AFTrackingManager component of the
ReTA Session framework in order to get the
result.
CheckPageAuthorization Ask the tracking object related to the activity to
check the page authorization (uses the
AFTrackingManager component of the ReTA
Session framework). If the user is allowed to
access this page, set the current page of the
activity with the page passed as parameter.
UIFieldValue Return the business component value that is
mapped to the specified UI field (uses the
Activity framework View service).
GetName Return the activity name.
GetFrameName Return the name of the frame where to display
the encountered events.
GetPageParameter Return a string containing all parameters to
send to the next page. This string contains the
names of all UI fields of the page and the
JavaScript code needed to retrieve their values.
Called by the ReTA UI framework component
AFScriptGenerator.
GetStartPage Return the starting page of the activity.
getNextPage Return the next page for the current activity,
based on the current activity page saved in the
AFTracking object of the activity and on the
action passed as parameter.
getCurrentPage Return the current page.
retrieveBOInstance Return requested business component from
the activity business context.
AddOject Add a business object (held by the activity's
"business object context" object).
GetObject Return the instance of the requested business
object (held by the activity's "business object
context" object).
RemoveObject Remove the instance of the requested business
object (held by the activity's "business object
context" object).
ContainsKey If the "label" of the requested business object
exists (held by the activity's "business object
context" object), return true.
GetKeys Return all business object "labels" (held by the
activity's "business object context" object).
receiveEvent Method called by the ReTA Session during an
ASP start page event to enable the architecture
to capture user entry from previous web page.
The ReTA Session component holds references
to all registered listeners (Activity
components).
AFEventListener
getID Reference to the listener object. One listener
object is associated with each registered
Activity component.
Abstract Methods The application developer implements the following abstract methods in the business activity component:
Method Description
CreateSubActivity Create a Sub-Activity.
Name Return the Activity name.
Precondition Pre-conditions required before executing the
Activity.
Postcondition Post-conditions required after executing the
Activity.
RequestedObjects Return the list of the requested business
components.
Views Return all the views for the activity.
StartPage Return the Activity start page.
AFSubActivity The AFSubActivity component implements a sub-part of the overall activity business logic. The application developer creates a sub-activity component for each sub-part of a specific business activity by extended the AFSubActivity component. As with activities, the sub-activity workflow sequence is pre-condition, execution and post-condition. Note There may be zero or more sub-activities on an ASP Page. Methods The IAFSubActivity interface defines the access to the AFSubActivity component. This interface supports the following methods:
Method Description
precondition Pre-condition required before executing the
sub-Activity.
execute Execute the small grained business process
logic.
postcondition Post-conditions required after executing the
sub-Activity.
commit Declare that the current sub-activity has
completed its work and should be deactivated
when the currently executing method returns
to the client. This method may call the
setComplete method of MTS.
checkRequestedObjects Check that the business components requested
for the sub-activity are present in the Activity
context. The requested components are defined
by the application developer through
implementing the sub-activity abstract
requestedObject method.
initialize Store the requested component names (as
defined by the application developer). Store
the passed in activity component reference.
Store the sub-activity name.
getName Return the sub-activity name.
getActivity Return the reference to the activity
component associated to the sub-activity.
Abstract Methods The application developer implements the following abstract methods in the business sub-activity component:
Method Description
precondition Pre-conditions required before executing the
sub-Activity.
execute Execute the small grained business process logic.
postcondition Post-conditions required after executing the
sub-Activity.
requestedObjects Return the requested business components for the
sub-activity.
AFCollection The AFCollection component is a general purpose collection component. The collection component can be used to store and retrieve a collection of COM components, integers or strings. Methods The IAFCollection interface defines the access to the AFCollection component. This interface supports the following methods:
Method Description
size Number of elements in the collection component.
addElement Add an element to the collection component.
elementAt Return the element at the requested index.
addString Add a string element to the collection component.
stringAt Return the string element at the requested index.
addInt Add an integer element to the collection component.
intAt Return the integer element at the requested index.
isInt If collection component is storing integers, return true.
IsString If collection component is storing strings, return true.
Reset Remove all the elements from the collection component.
AFVBActivityWrapper The AFVBActivityWrapper component enables the application developer to add Activities that are written in Visual Basic. Methods The IAFActivity, IAFContext, IAFEventListener and IAFVBActivityWrapper interfaces define the access to the AFVBActivityWrapper component. These interfaces support the following methods:
Method Description
AFVBActivity Wrapper
AddVBActivity Store the VB activity name, the starting page
for the activity and the reference to the
application developer's VBActivity component
to the AFVBActivityWrapper component.
getPageParameter Return a string containing all parameters to
send to the next page. This string contains the
names of all UI fields of the page and the
JavaScript code needed to retrieve their values.
Due to non-support of class inheritance by the
VB language, the VB application developer
must implement the getPageParameter logic
supplied by superclass AFActivity for Java
applications. The VB developer copies the
required logic from the VB Activity shell
code file.
receiveEvent Method called by the ReTA Session during an
ASP start page event to enable the architecture
to capture user entry from previous web page.
The ReTA Session component holds references
to all registered listeners (Activity
components). Due to non-support of class
inheritance by the VB language, the VB
application developer must implement the
receiveEvent logic supplied by superclass
AFActivity for Java applications. The VB
developer copies the required logic from
the VB Activity shell code file.
Start Start the activity. The application developer
calls this method from the ASP page.
uIFieldValue Return the business component value that is
mapped to the specified UI field. Due to
non-support of class inheritance by the VB
language, the VB application developer must
implement the uIFieldValue logic supplied by
superclass AFActivity for Java applications.
The VB developer copies the required logic
from the VB Activity shell code file.
AFActivity
Stop Release the activity and all it associated
instances. Calls the commit method. The
application developer calls this method from
the last ASP page for the business activity.
abort Gracefully abort the activity. Abort
associated sub-activities. Remove all references
to sub-activities, business components and
stateful UI components.
commit Declare that the current activity and all
its sub-activities have completed their work
and should be deactivated when the currently
executing method returns to the client. This
method may call the setComplete method of
MTS. (See MTS portion of the present
description for more information)
retrieveUIInstance Retrieve a User Interface component instance
from the UI context of the activity.
addToUIContext Add a User Interface component to the UI
context of the activity.
executeSubActivity Execute the sub-activity related to the
current page for the Activity. Call the sub-
activity precondition, execute and postcondition
methods.
isPartOfActivity If the ASP name passed as a parameter is
part of the activity, return true. This method
calls the AFTrackingManager component of the
ReTA Session framework in order to get the
result.
checkPageAuthorization Ask the tracking object related to the
activity to check the page authorization (uses
the AFTrackingManager component of the
ReTA Session framework). If the user is
allowed to access this page, set the current
page of the activity with the page passed as
parameter.
getName Return the activity name.
getFrameName Return the name of the frame where to display
the encountered events.
getStartPage Return the starting page of the activity.
getNextPage Return the next page for the current activity,
based on the current activity page saved in the
AFTracking object of the activity and on the
action passed as parameter.
getCurrentPage Return the current page.
retrieveBOInstance Return requested business component from the
activity business context.
AddObject Add a business object (held by the activity's
"business object context" object).
GetObject Return the instance of the requested business
object (held by the activity's "business
object context" object).
Remov | ||||||
