Show TOC

Procedure documentationUsing the CMI EJB Service in Visual Composer Locate this document in the navigation structure

 

You use a Common Model Interface (CMI) Enterprise Java Bean (EJB) to consume EJB services directly in Visual Composer instead of converting them into a Web service and then using the Web service in Visual Composer, as this can be time consuming.

You create the EJB services in the Java Enterprise Edition (JEE) perspective, import them into the Web Dynpro framework and then into Visual Composer.

Note Note

EJB services are not supported for use in dynamic entry lists.

End of the note.

Prerequisites

  • You have installed SAP NetWeaver Developer Studio 7.1.

  • You have created the EJB development component in the JEE perspective.

  • You have created the Enterprise Application (EA) development component in the JEE perspective.

  • Prepare the development components so that the EJBs defined in the EJB development component can be used from another development component. In addition, select the Permissions tab and set the following check box: Entity Forwarding Allowed for EA DC.

  • You have created the Web Dynpro model that imports the EJB service into the Web Dynpro framework. More information: Models

  • Add the EJB model to the Public Part of the Web Dynpro development component.

  • You have built and deployed the EA and the Web Dynpro development component to the same server where the Visual Composer model will be deployed.

Procedure

  1. In the Visual Composer perspective, create a development component and a model. More information: Creating a Model and Development Component

  2. Search and discover the EJB methods from the local EJB repository, which is created locally or in the DTR.

    Note Note

    To enable searching for EJBs, select   Tools   Options   and in the Options panel, under Search Options, select the Enable EJB Search check box. Then, refresh the search pane.

    End of the note.

    You can select the EJB method from either of the two types in the Type field:

    • Methods: Select an EJB method directly.

    • WD Models: Lists all the Wed Dynpro models. Expand a model to view the EJB methods wrapped within the selected model.

      Note Note

      The EJB methods are listed by their Web Dynpro naming convention.

      End of the note.
  3. Drag the EJB service and drop it onto the Design board.

  4. Create the input and output views for the EJB service.

    When dragging out from a clustered input port of an EJB service, a Data Share element is not created, because there is a data binding connection between an EJB service and the view element.

    Note Note

    Modeling of clustered input of Web services or R/3 services automatically generates a Data Share element attached to the input view, because there is a data mapping connection between the data service and the view element.

    End of the note.

    More information:

    Connecting Model Elements

    Composing the Composite View

    Note Note

    When dragging out from an input port of an EJB service, the input view is automatically generated with an Execute button that has an Execute action, which activates the EJB method.

    If you create an input view manually, then you must model a button with an Execute action that activates the EJB method (using the Component property in the Define Action dialog box).

    End of the note.
  5. Save and then build and deploy the Visual Composer model.

    More information: Compiling and Deploying Models