You are here: Reference > Tools, accelerators, and wizards > Connector and Metadata wizard > About importing JavaBeans with the Connector and Metadata wizard

About importing JavaBeans with the Connector and Metadata wizard

Importing a JavaBean with the Connector and Metadata wizard helps to implement the Pega Platform Java Pages feature. This feature enables you to use rules and the clipboard to interact with Java objects in the same way that you use them to interact with Pega Platform classes and properties. The wizard creates class and Java properties (properties of mode Java Property or Java Property List) that reflect the data model described in a Java class file.

You start the wizard and identify the source Java class. The wizard imports the Java class through introspection and then generates the appropriate classes and properties. It also creates Java wrapper classes that implement the get and set methods from the Java class through the PRObjectWrapper interface of the PublicAPI Clipboard class. The Java wrapper classes provide you with a standard way to access Java objects as clipboard pages from within the Pega Platform.

For more information about using the Java Pages feature, see the PDN document Working with the Java Pages Feature. For information about the PRObjectWrapper interface, see the PublicAPI JavaDocs topics.

Setup

Before you begin, complete the following steps:

  1. Identify the RuleSet and version to contain the generated rules.
  2. (Optional, but recommended) Create or identify an abstract class rule for the wizard to use as the container or base for the generated items. This class must inherit from the Embed-Java- class. If you do not create the base class before you begin, the wizard can create one for you.
  3. Review the definition of the class rule you identified to confirm that it allows subclassing and allows rules to be added to the RuleSet you identified.
  4. Make sure the Java class is on both the Pega Platform runtime and compile time class paths. For help with this step, see the PDN article About the Process Commander class paths.

Requirements for the Source Java Class

Pega Platform uses the JavaBeans coding standard to determine the identities of properties in a Java class. The getter and setter methods for a property must begin with get and set.

The JavaBeans coding standard defines an indexed property as one that has an array value. In Pega Platform, that definition includes java.util.List and any of its implementing classes (java.util.ArrayList, for example). However, because list properties are not typed, the source Java class must provide an indexed get method for the property so the data type can be determined. Without an indexed get method for the property, the Pega Platform does not interpret the property as a list property.

If the source Java class implements the Serializable interface, the Pega Platform can persist instances of the Java class with other clipboard data. For example, it can save information from the Java object with work items.

Starting the wizard

To start the wizard, select Designer Studio > Integration > Connectors > . When the wizard starts you can click the help button on any form for help about that form.