Service-Based Application Development From a Single Source (Part 1)

SAP employs composite applications to support customers who want to continually improve their business processes with innovative and service-based applications. These are developed on the basis of a model-oriented approach and consist of a process layer, a user-interface layer and a layer for business and application logic. The business logic is made available to the overlying process and user-interface layers by means of services. This layer architecture enables composite applications to be constructed quickly and adjusted flexibly.

Central platform for modeling

The central platform for building composite applications is SAP NetWeaver Composition Environment (SAP NetWeaver CE), the integrated development, modeling and runtime environment in which SAP has bundled key technologies and tools. These include SAP Composite Application Framework (SAP CAF), guided procedures and SAP NetWeaver Visual Composer, Web Dynpro and SAP Interactive Forms by Adobe for modeling user interfaces.

SAP NetWeaver CE is oriented towards open industry standards. Only the new SAP modeling tools based on open standards enable shorter development times and a further industrialization of software development.

Key components of SAP NetWeaver CE are a runtime environment based on SAP NetWeaver Application Server and a development environment that is deployed via SAP NetWeaver Developer Studio. SAP NetWeaver Application Server supports Java Platform Enterprise Edition version 5 (JEE 5), which includes among other things Enterprise JavaBeans (EJB) version 3.0 as a standardized component technology and JavaServer Faces (JSF) 1.2 for developing user interfaces.

Further, specifications such as Java API for XML-based Web services 2.0 (JAX-WS) enable the development of Web services in Java. SAP NetWeaver Developer Studio in turn is based on the Eclipse 3.3 open-source development platform. As SAP NetWeaver CE as a whole is both a development and a runtime environment, composite applications can be both built and deployed.

Creating business objects

The business and application logic is defined in SAP CAF. The services for a composite application, which themselves draw data from business objects, are created and modeled here. The business objects derive either from SAP ERP and the applications of the SAP Business Suite or are specially created for building a composite application. In this case they are fixed components of a composite application and are therefore termed “local” business objects.

Thus the “Material” business object originates in SAP ERP, whereas an RMA number (Return Merchandise Authorization) for handling returns is a local business object. It is created using SAP CAF. Here the developer also defines both the attributes of the object, like RMA number or RMA status, and the operations and services that the business object is to execute within a composite application. In the simplest case this may be a matter of basic services, such as create, read, update und delete (CRUD) and search methods that are used to create, query, update, delete and locate records.

Conversely, more complex services are required for the construction of a composite application that have a considerably larger functionality than the basic services and incorporate comprehensive enterprise-focused business logic. These enterprise services are stored in the Enterprise Services Repository (ESR) of SAP NetWeaver.

An example of such an enterprise service is Cancel Order. As well as the mandatory deletion of entries in the database, it may be necessary to delete production orders or inform suppliers of the deletion. The stock level must also be corrected and adjusted. These are just some of the activities that an enterprise service handles and that differ considerably from the tasks of a simple Web service.

Naturally, Web services from other sources such as an external UDDI directory or external Web services defined by a WSDL file can also be used. These can be located using SAP CAF and imported into and consumed in SAP CAF. The requirement for this is that SAP CAF is linked to the ESR or an external service registry. External Web services that are not listed in a registry can be integrated easily by specifying their WSDL address.

Smooth interplay

A composite application “consumes” different types of services, such as enterprise services and external Web services, and the smooth interplay of these must be guaranteed. This is done by means of an additional layer of abstraction that SAP CAF deploys with the composite application services (CAS). Composite application services embrace all services used in a composite application, provide standard interfaces to other services within the application, and are linked to both the process layer and the presentation layer.

As soon as a user makes and submits entries in the user interface of a composite application, a composite application service is called, which in turn executes the services and the business logic linked to them. The composite application service always – regardless of whether enterprise services or external Web services are called – returns the same return values. These may be simple structures or nested tables. It thus simplifies the call of the business logic within a composite application.

In order to fulfill their task, the composite application services also need to be made available as Web services. Only in this way can they be called within a composite application both in the process layer and the interface layer. A dedicated perspective within SAP NetWeaver Developer Studio – the Composite Application Explorer – provides for this. There the corresponding Web service can be generated for each composite application service – to do so, the “Expose service as Web Service” function from the context-sensitive menu has to be selected.

The Composite Application Explorer lists all development objects that are used in a composite application in the business object and service layer, such as composite application services, business objects, external services and their operations or parameters. It thereby enables simple navigation to individual elements and properties of the composite application.

Standard organization of business logic

SAP CAF provides pre-defined composite application services to organize the business logic of a composite application. With the “DocContent” application service, for example, documents can be versioned and their contents displayed. The “ClassificationApplication” composite application service, on the other hand, enables the construction and management of hierarchical folder structures.

Further, developers can model their own composite application services. This is necessary for example when new business logic is deployed in the construction of a composite application via the Composite Application Services based on the local business objects.

All operations that a composite application is to execute using business objects or the composite application services deployed as Web services can be tested in advance using the service browser, which is a Web-based tool. The service browser is called directly from SAP NetWeaver Developer Studio which, as the development environment of SAP NetWeaver CE, displays all business objects and services that were modeled using SAP CAF. This “quality check” ensures that the services are subsequently executed within a composite application in the required form.

Orchestrating processes

The logical sequence of individual process steps and the call of corresponding user interfaces and services are specified in the process layer using guided procedures. These are located within SAP NetWeaver Application Server as the runtime environment of SAP NetWeaver CE. Guided procedures orchestrate the user interfaces and services into application-specific collaborative processes and regulate which user receives which data when. At the same time the individual process steps of a composite application are worked through in turn in the specified sequence in guided procedures.

Guided procedures also consist of a development and a runtime environment. The process templates for a composite application are created in the development environment and can be launched within the runtime environment. The processes defined in guided procedures consist of phases and steps. Several steps are grouped into one phase. A step in turn is defined by an action that describes which user interface or enterprise service is called.

Modeling instead of coding

The user interface on which the data from the business objects is deployed to the respective user is specified in the interface layer. The central tool here is SAP NetWeaver Visual Composer. It enables interfaces to be modeled from pre-defined components such as fields, buttons, tables or graphics. At the same time it defines which elements are displayed to the user at runtime and how they are to interact. For example, a search term can be entered in an input field, a service called at the click of the search button and its result displayed in a table. As a visual modeling tool, SAP NetWeaver Visual Composer requires no specialist programming knowledge as the code is generated from the model.

The heart of SAP NetWeaver Visual Composer is the storyboard. It contains all tools relevant for the user-interface modeling. A user interface is only saved when it has been fully modeled, at which point the code is generated via a compiler. The code is then passed to the Visual Composer Server for execution. This is a further key architectural component of SAP NetWeaver Visual Composer. As well as the functionality for the storyboard, the server also provides the services for persistence and communication with other components on the server.

A further new feature in SAP NetWeaver Visual Composer is the option to model portal applications. A portal page can be defined for each process step into which a user interface from a composite application is integrated. Both portal page and user interface can be assigned a joint user role via SAP NetWeaver Visual Composer.

Web Dynpro Java and SAP Interactive Forms by Adobe represent two further user-interface technologies in SAP NetWeaver CE. Web Dynpro Java is used to model user interfaces with highly complex user-interface logic. Form-based processes and their offline processing can be mapped via the interactive forms in which PDF files are sent to the process participants who then fill them in and return them to the process.

Part 2