0% found this document useful (0 votes)
87 views

Technical Note: Working With Java Objects in Pegarules Process Commander Version 4.2 Smartbuild Release

Uploaded by

Lias Jassi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views

Technical Note: Working With Java Objects in Pegarules Process Commander Version 4.2 Smartbuild Release

Uploaded by

Lias Jassi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

Technical Note

Working with Java Objects


in PegaRULES Process Commander
Version 4.2 SmartBuild Release

Last Updated: June 13, 2005


© Copyright 2005
Pegasystems Inc., Cambridge, MA
All rights reserved.

This document and the software describe products and services of Pegasystems Inc. It
may contain trade secrets and proprietary information. This information should not be
disclosed to third parties without the prior written consent of Pegasystems Inc. This
document and the software are protected by federal copyright law, international laws
and/or applicable treaties.

This document is current as of the date of publication only. Changes in the document may
be made from time to time at Pegasystems’ discretion. This document remains the
property of Pegasystems and must be returned to it upon request. This document does
not imply any commitment to offer or deliver the products or services provided.

This document may include references to Pegasystems product features that have not
been licensed by your company. If you have questions about whether a particular
capability is included in your installation, please consult your Pegasystems services
consultant.

Other brand or product names are trademarks or registered trademarks of their respective
holders.

This document is the property of:


Pegasystems Inc.
101 Main Street
Cambridge, MA 02142-1590
(617) 374-9600, fax: (617) 374-9620
www.pega.com
Contents

Introduction..........................................................................................................1
BRE System........................................................................................................1
BPM System .......................................................................................................2

Process Commander Structures Overview .....................................................3


Java Object Properties........................................................................................3
Java Pages..........................................................................................................5
PRObjectWrapper Interface ...............................................................................5
Custom Wrapper.................................................................................................5

Basic Structure Creation – Using the Import Rules Accelerator...................6


Example: Customer Invoice Data......................................................................6
The Java Property Transform Registry ..............................................................8

Implementing a Custom Wrapper Structure ..................................................10


Determine Data Requirements for the Java Object........................................ 11
Define a new Java Page class ........................................................................ 12
Define Java Properties on the new Java Class(es)........................................ 14
Define the Property to associate the Java Object with the Work Object ....... 17
Write the Wrapper............................................................................................ 18
PRObjectWrapper Methods ...................................................................... 19
string.................................................................................................................. 19
stringlist ............................................................................................................. 20
object................................................................................................................. 20
objectlist ............................................................................................................ 20
Attach the Java Object to the Java Page........................................................ 21
Attaching an object .................................................................................... 21
Creating an object...................................................................................... 22
Access the data in the Java object.................................................................. 22
Modifying an Existing Wrapper .......................................................................23

Appendix A: Generated Wrapper Code for Invoice.java .............................25


INTRODUCTION

Working with Java Objects


in PegaRULES Process Commander Release
4.2 SmartBuild Release

Introduction

Many PegaRULES customers wish to use pre-existing Java objects (JavaBeans) with
their PegaRULES application. For example, a health-insurance company may create a
Policy object that contains full information for an insured’s health insurance policy. This
Java object may have other objects nested in it:

• the insured’s name & address information


• the insured’s other supported dependents
• the insured’s medical records
• the medical records for the dependents
• the company that underwrites the policy

etc. All this information could be stored in the customer legacy database, accessed by an
EJB interface that creates these JavaBeans; these objects would then be used whenever
any information is required about the insured (change of address, new claim, new
dependent, merger with another health insurance company, etc.).

This data can be used by PegaRULES in two ways: in a BRE system, or in a BPM
system. The data is imported using the Rule-Services- rules (Rule-Service-JSR94) and
then exported back using Rule-Connect- rules (Rule-Connect-JSR94).

BRE System

PegaRULES can be used as a BRE – Business Rules Engine – to work with customer
data. In this setup, the customer’s application calls the PegaRULES Engine to execute
rules which make a series of decisions and return an answer. In a BRE system, the
system executes rules to come to a decision about a specific query (rather than running a
process flow). There is no process, so there are no work objects. And since there are no
work objects, nothing is saved to the database (there is no “persistence”).

The customer uses PegaRULES rather than writing their own custom Java code because
it’s easier to create, change, and maintain rules. For example, using the above scenario,
the health insurance company would pass an insured’s JavaBean to PegaRULES to
evaluate – based on the rules they defined – whether this person would be a good
insurance risk. The PegaRULES system can make changes to the information in the Java
object, which will be stored back in the customer’s legacy database.

CONFIDENTIAL 1
INTRODUCTION

BPM System

JavaBeans could also be used in a BPM (Business Process Management) system. In


BPM, the PegaRULES system executes a process flow, and creates and processes work
objects. These work objects are stored in the database (they are “persistent”).

In this setup, again using the example scenario, there may be more work to be done on
the health insurance policy. It may need to be routed to different departments (to
determine the eligibility of the insured; to obtain their medical records from their last
insurer), and have SLAs fire if the policy stays too long in one department. New accounts
may need to be created (which would require also creating new Java objects). During
these processes, the work item (“Open new insurance policy”) is saved to the database, to
track where in the flow it is, who is working on it, etc. The JavaBean with all the customer
data may or may not be serialized to the database when the work item is stored,
depending upon how the application is written.

2 CONFIDENTIAL
PROCESS COMMANDER STRUCTURES OVERVIEW

Process Commander Structures Overview

There are two ways that data stored in Java objects can be accessed by PegaRULES:

• storing the Java object in a Java Object Property on the clipboard


• creating a Java Page on the clipboard and attaching the Java object

Both of these methods might be used in an application, depending upon how it is


structured to access the external system.

The following items may be involved in using an Java object data model:

• Java Object Properties


• Java Pages and Java Properties
• PRObjectWrapper Interface (to the Java object)
• Java object Wrapper

A quick description is provided for these items in this section; following sections of the
document will provide full details of their functionality.

Process Commander Service Rule types (such as Rule-Service-JSR94, Rule-Service-


EJB, and Rule-Service-Java), and the Import Rules Accelerator may be used to quickly
and easily set up a connection to an external Java data model, so that Process
Commander may use that data in processing.

• Service Rules are documented in samples available on the www.pega.com website,


and in the Integrating with External Systems manual
• The Import Rules Accelerator is documented in the Working with Java Objects in
Process Commander tech note.

Some customers may wish to customize their setup after using the Accelerator, or build
their own custom Java setup. This document details how to create a custom wrapper
class, and manually set up the structures to work with an external Java data model.

IMPORTANT: The described custom wrapper setup will work most efficiently when the
company’s legacy Java application is in the same JVM as the PegaRULES application. If
these two applications are in different JVMs, then the Java object will have to be serialized
and deserialized in order to get data in and out. This will work, but the system will perform
slowly.

Java Object Properties

In Version 4.1, functionality was added to PegaRULES Process Commander to allow


users the ability to put a Java object on the clipboard. New Modes were added to the
PegaRULES Property definition:

• Java Object
• Java Object List
• Java Object Group

CONFIDENTIAL 3
PROCESS COMMANDER STRUCTURES OVERVIEW

Properties with this Mode hold a Java object as the property value. The Java Object
property can be put onto any kind of page in the Clipboard, just like any other Property
type. The page with this property could be a step page as well, used as a step in an
activity. When the property is saved, the information in the Java object is optionally
serialized and saved to the PegaRULES database, depending upon whether the property
was defined to be serialized (by checking the Serialize this object field in the property
definition).

One important use of Java Object Properties is to hold Java objects which have been
imported through the Process Commander Service Rules. Several of the Rule-Service-
rules (such as Rule-Service-JSR94) automatically import the Java object into the system
and put it into a Java Object property on a clipboard page, so it may be further
manipulated by Process Commander. And in order to export the Java object back to the
original system, the Rule-Connect- rules require that it be in a Java Object Property.

Overall, the Java Object Property functionality is limited. These properties cannot be used
with a Property-Set to set or change values in the Java object, but require custom code.
Since the PegaRULES Guard Rails steer developers away from creating custom Java,
using the Java Object Property by itself is no longer considered Best Practice.

4 CONFIDENTIAL
PROCESS COMMANDER STRUCTURES OVERVIEW

Java Pages

Beginning in Version 4.2, new functionality was added to PegaRULES to allow developers
to modify Java objects without using Java steps: the Java Property Mode and Java
Pages.

Java Pages and Java Properties allow the Process Commander system to have direct
access to the data in the Java object, which is attached to a Java Page in the Clipboard
(not stored in it). A Java Page is defined as a page of the PegaRULES class (or of a class
which extends) Embed-Java- . Then Java Properties, which must also be defined on the
same Embed-Java- class as the page, are used to access the data inside the Java object.

PRObjectWrapper Interface

The PRObjectWrapper interface is available through the Clipboard Java API, and enables
the application to attach any Java object which implements this interface to a clipboard
page (a Java page). This interface may be implemented by the object directly, or by a
special wrapper class.

The methods in this public interface include:

• prAdd
• prClear
• prCopy
• prGet
• prGetNew
• prGetObject
• prGetWrappedObject
• prRemove
• prSet
• prSize

Custom Wrapper

The external Java object needs to be able to implement the PRObjectWrapper interface.
This could be done with custom code in the Java object itself, or by using a wrapper. This
wrapper code uses the Java object’s public interface (the getter and setter methods) to
manipulate the values in the object for the clipboard.

The Import Rules Accelerator generates this wrapper automatically (because the
Accelerator will not have access to modify the Java object directly), but the wrapper could
also be written manually and inserted into the Process Commander Java Class.

CONFIDENTIAL 5
BASIC STRUCTURE CREATION – USING THE IMPORT RULES ACCELERATOR

Basic Structure Creation – Using the Import Rules Accelerator

The Import Rules Accelerator automatically creates many of the structures necessary for
accessing data in a Java object. It creates the Java Class and the Java Property Rules
that reflect the data model described in a DTD, Java class, or XSD file, and can be used to
implement the data model of an external Java object in Process Commander.

When using the Accelerator, the developer must enter the full name of the Java class for
the Java object to be used. The Accelerator analyzes this Java class through
introspection, then generates the appropriate Process Commander Classes and
Properties. It also creates the Java wrapper classes that implement the get and set
methods from the external Java object through the methods of the PRObjectWrapper
interface. (Please reference the Working with Java Objects in Process Commander
tech note for full details on using the Accelerator.)

Developers that wish to create their own custom structures without using the Import Rules
Accelerator must understand what structures need to be created. The following is an
example of a sample customer class and the structures that the Accelerator creates.

Example: Customer Invoice Data

Acme Co. wishes to use a Java object when processing their work objects, which are
customer invoices, in Process Commander. Their Java class Invoice contains the
following fields:

String firstName;
String lastName;
Date lastOrderDate;
Address currentAddress;

The class Address (also in this Java object) contains the following fields:

String[] street;
String city;
String state;
String country;
String zip;

In their current class structure, Acme- is the top-level class for their PegaRULES Process
Commander application.

In order to use the Accelerator, Acme has created an abstract class in their hierarchy,
Acme-CustData-, which has directed inheritance from Embed-Java-. This class will hold
all the Java Pages and Properties for the Java object.

6 CONFIDENTIAL
BASIC STRUCTURE CREATION – USING THE IMPORT RULES ACCELERATOR

Important Note: The abstract class created to hold the structures for
the Java object must end in a dash (“-“), to create the proper class
hierarchy. The Accelerator will generate a class from the name of the
Java class in the Java object, and will append it directly to the existing
class name. If there is no dash at the end of the abstract class, an
incorrect class structure is created:
Acme-
Acme-CustData
Acme-CustDataCustomer (new class “CustDataCustomer” at the
same level as CustData, instead of inheriting from it)

Running the Accelerator creates the following structures in PegaRULES Process


Commander:

Acme- existing top-level class


Acme-CustData- created abstract class inheriting from Embed-Java-
Acme-CustData-Invoice generated Class with Java Properties
Java Properties: firstName text Pega type
lastName text Pega type
lastOrderDate Date Pega type
Address Page property of class Acme-CustData-
Invoice_Address

Acme-CustData-Invoice_Address generated Java Class with Java Properties


Java Property List: street text
Java Properties: city text
state text
country text
zip text

Note that any nested objects within the Java object will be created as separate classes
with a separate wrapper. The exception to this would be nested Java objects that had
been “transformed” (see next section for full details).

The following wrappers are generated:

com.pega.test.prpcwrapper.Invoice
com.pega.test.prpcwrapper.Invoice_Address

(Appendix A contains example code for the Invoice wrapper.)

These generated wrappers are stored in the temp directory. For Tomcat, this temp
directory may be:

Tomcathome\work\Catalina\localhost\contextroot\temp

example:

e:\tomcat\jakarta-tomcat-
5.0.28\work\Catalina\localhost\prweb\temp

CONFIDENTIAL 7
BASIC STRUCTURE CREATION – USING THE IMPORT RULES ACCELERATOR

The temp directory contains two main subdirectories for generated PegaRULES code:

• PRGenClasses
• PRGenJava

Each level of the Java package name for the wrapper becomes a subdirectory under
these main directories; thus, the Invoice.java file (com.pega.test.prpcwrapper.Invoice) is
stored under:

e:\tomcat\jakarta-tomcat-
5.0.28\work\Catalina\localhost\prweb\temp\
PRGenJava\com\pega\test\prpcwrapper\Invoice.java

The Java Property Transform Registry

Some Java data elements are treated as objects, rather than strings. Normally, the Import
Rules Accelerator would create a separate Class for these objects, and define Java
properties on them (as shown above for the Address object).

However, sometimes there may be an object which the developer does not wish to be
represented as a complex type in Process Commander (a generated PegaRULES Java
Class), but as a single-value property. A good example of this is a data element of type
Date. Rather than generating an entire class for this object (“Acme-CustData-
Invoice_Date”) and generating several Java Properties as well, whenever there is a Date
element in a Java object, it is mapped to a single-value Java Property of (Pega) type Date.

This is accomplished by using the Java Property Transform Registry. Whenever there
is an object which should be represented as a single-value property, the class for that
object should be registered as an instance of Data-Registry-JavaPropertyTransform.

When the Accelerator is analyzing the class, whenever it finds a nested object, it will see if
there is a registry entry (in Data-Registry-JavaPropertyTransform) for this object. If there
is no entry, the object will be generated like any other object.

If an entry does exist, then the wrapper that is generated will call the transform class. The
transform code will take the object and either:

• go from object to string (get)


• go from string to object (put)

The name of the Data-Registry-JavaPropertyTransform instance is the class name of the


object to be transformed (example: java.util.Date). The class itself has two fields:

• Property Type
• Transform Class Name

8 CONFIDENTIAL
BASIC STRUCTURE CREATION – USING THE IMPORT RULES ACCELERATOR

Property Type – the PegaRULES property type that this object should be transformed to.
These include:

• Text
• Identifier
• Integer
• Double
• Decimal
• DateTime
• Date
• Time of Day
• True or False

Transform Class Name – This is the full name of the Java class that will execute the
transform.

For developers who wish to include this functionality for other types of objects, it is
necessary to write a Java class extending the interface JavaPropertyTransform. This
class must then be put into the ext\lib or the ext\classes directory (depending upon
whether it is a .jar file or a .class file, just like the main Java object).

public interface JavaPropertyTransform

This is the interface to use for building Java Property Transforms. These transforms are
used to transform a specific java class to a single value and single values back into
instances of the specific java class. This is useful in PRObjectWrappers where, for
example, java.util.Date should map a single value date property rather than a page
property of class Date.

Two methods are implemented:

instanceToString(ClipboardProperty associatedProperty,
java.lang.Object sourceInstance)

stringToInstance(ClipboardProperty associatedProperty,
java.lang.String sourceString)

NOTE: In the example wrapper code in Appendix A, the call to the Transform class for
Date is highlighted.

CONFIDENTIAL 9
IMPLEMENTING A CUSTOM WRAPPER STRUCTURE

Implementing a Custom Wrapper Structure

For many reasons, a developer may decide to create a custom wrapper structure for their
application:

1. Depending upon the structure of the external Java object, the Import Rules Accelerator
may create more than one wrapper class (see above example); customers may wish only
one wrapper.

2. The structure of the Java object may also include not only basic fields, but methods
calling another method or a class, or have Java code that calculates or processes data. In
these cases, customers may wish to modify the wrapper the Accelerator creates, or they
may not wish to use the Accelerator at all to create the structures, but may wish to create
their own customized structures and write their own wrapper.

3. The Accelerator uses the JavaBean specification when analyzing the Java object to
determine what Process Commander Classes and Properties to create. This means that
only the data elements which meet the following criteria will have corresponding
PegaRULES structures created:

• are defined as public


• have no arguments/parameters
• have getter and setter methods defined which start with get and set
• for indexed properties, must also provide an indexed get method for the property, so
the data type can be determined

If the developer has a Java object that doesn’t meet all of these criteria, the Accelerator
will not create the appropriate Process Commander structures.

4. It may be that the Java object is a nested object that goes down for a number of levels.
For example, if this is a health-insurance policy object, then the structure might be:

String CustID;
Insured insuredInfo;

public class Insured {


String name;
Dependents insuredDependents;
}

public class Dependents {


String numberDependents;
Spouse dependentSpouse;
Child dependentChild;
}

public class Child {


String childName;
String childAddress[ ]
String childAge;
}

etc.

10 CONFIDENTIAL
IMPLEMENTING A CUSTOM WRAPPER STRUCTURE

If the Import Accelerator were used, many classes would be created, each with their own
separate Java Properties:

Acme-HIPolicy-
Acme-HIPolicy-Insured
Acme-HIPolicy-Insured_Dependents
Acme-HIPolicy-Insured_Dependents_Child
Acme-HIPolicy-Insured_Dependents_Spouse
etc.

Rather than have all of these classes created by the Accelerator as wholly separate
structures with separate properties, the developer may want to use inheritance to manage
some of the Java Properties. In the above example, there are a number of properties that
could be inherited by the Dependents class from the main Insured class: street, city,
state, zip code, phone number, name of main insured person, etc. With such a complex
nested structure in the Java object, the Accelerator could not make this change; a custom
wrapper would be necessary.

5. The complex nested object may be a standard JavaBean for the customer. For
PegaRULES processing, only a few data elements of this bean may be required. Rather
than having a series of unnecessary classes created in the application, the developer
could write a single custom wrapper that would hide the complexity of the Java data
model, and expose only the necessary fields.

If the Accelerator is not being used, a developer should follow this process to create all the
necessary structures:

1. Determine what data within the Java object would be required in PegaRULES.

2. Define the new “base” Java Page class.

3. Define the appropriate Java Properties on this new class.

4. Define the property to associate the Java object with the appropriate PegaRULES
object.

5. Write the wrapper for the Java object.

6. Attach the Java object to the Java Page in the clipboard.

7. Access the data in the Java object.

These steps are explained in detail below.

Determine Data Requirements for the Java Object

As stated above, the assumption made for the Java object functionality is that the
customer has a Java data model which represents their business objects, and that they
wish to use the information stored there in their PegaRULES system. There may be one
or more Java classes that hold this data. In addition, there may be a number of fields in
the class that hold different types of data, including date fields, or a variable which is a
class itself with its own fields (a subclass).

CONFIDENTIAL 11
IMPLEMENTING A CUSTOM WRAPPER STRUCTURE

The developer should determine what data will be used in the PegaRULES system, so
that appropriate matching structures may be built in PegaRULES. They should consider
whether they wish to create separate wrappers for Java data elements which are
themselves Java classes (like java.util.date); whether these should appear as separate
PegaRULES classes in the hierarchy, or whether they wish to write the wrapper code
such that the data for these fields is entered as single-value Pega Java properties in one
class. (In other words, does the customer want the Date property in “Acme-CustData-
Customer” to be an Embedded Page property pointing to the Acme-CustData-Date class,
with its own properties, or do they wish to have Date be a basic date-type property and not
an embedded page?) They should decide what their class structure should be, and
whether some of the classes (for the data from the Java object) should inherit from others.

Important: Only one Java object may be attached to one page (one-to-one relationship);
thus, each Java object from the Java class becomes one instance of the new
PegaRULES Java Page class.

Define a new Java Page class

Once the developer has determined the one or more Java classes that will be used to
provide data, analogous Classes must be set up in PegaRULES. A new class, Embed-
Java-, has been created in PegaRULES Process Commander; Java Pages must either
be of this class or of a class extending Embed-Java-. PegaRULES Best Practice
recommends that a new class inheriting from Embed-Java- Class be created for each
Java class that the customer is using.

Example:

Embed-Java-CustData (pattern inheritance)

- or -

Acme-CustData- (directed inheritance from Embed-Java-)

Depending upon the structure of the Java object and whether the developer is writing one
or more wrappers, one or more classes may be necessary.

When using the Accelerator, one abstract class inheriting from Embed-Java is created
by the developer, and specified in the Accelerator. Additional concrete classes are then
created by the Accelerator, which contain the name of the appropriate wrapper, as well as
the Java properties for the Java object.

12 CONFIDENTIAL
IMPLEMENTING A CUSTOM WRAPPER STRUCTURE

Example:

Acme- existing top-level class


Acme-CustData created abstract class inheriting from Embed-Java-
Acme-CustData-Customer generated Java Class with Java Properties
Acme-CustData-Address generated Java Class with Java Properties

When creating a custom setup, it is not necessary to create the abstract class as an
intermediate layer (unless desired); the concrete classes may be created directly.

Example:

Acme- existing top-level class


Acme-Customer concrete created class with Java properties

On the Advanced tab of the Class form, the Wrapper Name must be specified. This field
may be completed now, if the developer knows the name of the wrapper to be written, or it
may be left blank and filled in later.

CONFIDENTIAL 13
IMPLEMENTING A CUSTOM WRAPPER STRUCTURE

Define Java Properties on the new Java Class(es)

The next step in the process is to define the PegaRULES properties that will manipulate
the fields of the Java object. One PegaRULES property of the appropriate mode must be
defined for each field to be accessed in the Java object.

There are four types of data that might be found in a Java object used by Process
Commander. Each of these types has a corresponding PegaRULES property type.

Java data type Process Commander property type

string Java Property

stringlist Java Property list

object Page

object list PageList

There are two new PegaRULES property modes that have been added to work with the
Java fields:

• Java Property
• Java Property List

Important: Java Properties (and Java Property Lists) may only be defined on a Java
Class.

For objects of type string, the PegaRULES property must be defined with a Property
Mode of Java Property. For the Java property:

String firstName;

the following Process Commander property was defined:

14 CONFIDENTIAL
IMPLEMENTING A CUSTOM WRAPPER STRUCTURE

Stringlist objects are defined in PegaRULES as properties of mode Java Property List.

Objects are Java classes within the main class. As such, they are defined as
PegaRULES properties of mode Page, with their fields defined as PegaRULES properties
on the class of that Page. (Similarly, object lists would become a PegaRULES Property
of mode PageList.)

For example, if the Java fields in the Java object include:

String firstName;
String lastName;
Address currentAddress;

and

public class Address {


String[] street;
String city;
String state;
String country;
String zip;

then the PegaRULES property would be defined with Property Mode of Page, and
defined on the PegaRULES Class (of type Java Class) that corresponds to the original
class that was created for the Address item.

CONFIDENTIAL 15
IMPLEMENTING A CUSTOM WRAPPER STRUCTURE

Field Description

Property Mode Value: Page (in order to hold the embedded Java page)

PageClass The class created for the object field. The class entered into
this field must inherit from Embed-Java-, and contain the
appropriate Java Properties to address the fields in the object.

Validate embedded page When validating the top-level page (in this case,
PegaSample-CustomerRequest), if this box is checked, then
the validation will continue onto the embedded page (in this
case, Acme-Customer).
NOTE: This field is used for all Page-mode properties, not
just Java Page properties.

Java Page If this box is checked, then the Serialize this object field will
appear on the form. (If the box is not checked, that field will
not display.) Whether or not the box is checked, this Class
will contain Java Pages, as it descends from Embed-Java-.

Serialize this object If this box is unchecked, then when a Save is done on the top-
level page, then only the “regular” (non-Java) properties are
saved to the page.

If this box is checked, then when a Save is done, the Java


object that is attached to the embedded page is serialized and
saved to the database (in the BLOB/stream – it can’t be saved
to an exposed column).

16 CONFIDENTIAL
IMPLEMENTING A CUSTOM WRAPPER STRUCTURE

All of the string or stringlist fields embedded in the Java object for this class (“street,”
“city,” “state,” etc.) then become Java Properties defined on the class of this embedded
Page (in this example, Acme-SalesData-Invoice_Address).

Define the Property to associate the Java Object with the Work Object

In order for the data in the Java object to be available to the desired PegaRULES process,
the new Java Class (page) must be embedded in the page of that PegaRULES process.
For example, if a customer wishes to use the data from their Java object in their Work
Items, they need to create a Page property defined on the class of their Work Item which
references the new Java Class as their PageClass, in order for the Work Items to be able
to find the data for the Java object.

In this example, the developer wishes to be able to use the data from the Java object in
the CustomerRequest work item; therefore, the class of the Work Item is in the Applies
To field: PegaSample-CustomerRequest. Note that this class does not have to descend
from Embed-Java-, as the Java object will not be attached directly to a page of this class.

CONFIDENTIAL 17
IMPLEMENTING A CUSTOM WRAPPER STRUCTURE

Field Description

Property Mode Value: Page (in order to hold the embedded Java page to
which the Java object is attached)

PageClass The class of the embedded page which will contain the
Java object. The class entered into this field must inherit
from Embed-Java-, and contain the appropriate Java
Properties to address the fields in the Java object.

(For details on all fields in this form, please reference the example in the previous section.)

Important: It is possible to save the Java object attached to the Java Page to the
database in serialized form, by checking Serialize this object for the “connecting”
property. If this box is checked, the Java object for this work item will be saved into the
Storage Stream in the database, along with the work item itself.

The Java Properties are meant only to manipulate the data in the Java object (think of
them as conduits to the Java fields in the Java object). These Java Properties cannot be
saved as exposed columns in the database, as they are on an embedded page. They are
also not saved into the Storage Stream; only the Java object is saved. However, when
data is requested from the Java objects (by calling on one or more of the Java Properties),
the Java object will be deserialized and reloaded onto the clipboard, just as data would be
decompressed and loaded onto the clipboard from the Storage Stream – the process is as
transparent to the user.

Write the Wrapper

The wrapper is required to connect the external Java object to the PRObjectWrapper
interface, so the PegaRULES system can access the information in the object.

As stated previously, wrappers which are generated through the Import Rules Accelerator
are stored under the temp directory. Since these are generated wrappers, they can be
stored in a temporary directory, as the information to regenerate them is available in the
system.

A custom wrapper must not be stored in the temporary directory, as it cannot be deleted.
Therefore, custom-written wrappers should be stored in the same directory as a .jar file:
\ext\lib. For Tomcat, this directory would be:

TomcatHome/webapps/contextroot/ext/lib

Example:

e:\tomcat\jakarta-tomcat-5.0.28\webapps\prweb\ext\lib

Once the wrapper is created and stored in this directory, the fully-qualified name of the
wrapper must be entered into the Rule-Obj-Class instance for the Java object associated
with that wrapper.

18 CONFIDENTIAL
IMPLEMENTING A CUSTOM WRAPPER STRUCTURE

Important: In a multi-node system, a custom wrapper must be copied into each system.
If the custom wrapper .jar or .class file is not present, a PRRuntimeException error will
occur (when the system cannot find the wrapper).

A note on naming: All system-generated wrappers include the name “prpcwrapper”


(example: com.acme.java.prpcwrapper.Customer). This designation should only be used
for generated wrappers; when naming a custom wrapper, give it a name that does not
include “prpcwrapper,” so it is clear this is not a generated wrapper (example:
com.acme.java.newdata.Customer).

PRObjectWrapper Methods

As stated above, there are four types of data that might be found in a Java object used by
PegaRULES Process Commander:

• string
• stringlist
• object
• objectlist

Depending upon the property type, different PRObjectWrapper methods should be used.
The available methods for each type are listed below; for full details on implementing
these methods and on writing the wrapper, please reference the Javadocs.

string

prGet(PublicAPI aTools, ClipboardProperty aProperty,


java.lang.String aMethodName)
Called when retrieving a Java Property's value. Returns java.lang.String

prSet(PublicAPI aTools, ClipboardProperty aProperty,


java.lang.String aMethodName, java.lang.String aValue)
Called when a Java Property's value is being set. Returns a boolean value

prSize(PublicAPI aTools, ClipboardProperty aProperty,


java.lang.String aMethodName)
Returns the number of elements in a list or the number of characters in a string
value. Returns an integer.

CONFIDENTIAL 19
IMPLEMENTING A CUSTOM WRAPPER STRUCTURE

stringlist

prAdd(PublicAPI aTools, ClipboardProperty aProperty,


java.lang.String aMethodName, int aIndex,
java.lang.String aValue)
Called when adding a String to a list.

prClear(PublicAPI aTools, ClipboardProperty aProperty,


java.lang.String aMethodName)
Called when a Java Property List property is being cleared.

prGet(PublicAPI aTools, ClipboardProperty aProperty,


java.lang.String aMethodName, int aIndex)
Called when retrieving a Java Property List element's value. Returns
java.lang.String

prRemove(PublicAPI aTools, ClipboardProperty aProperty,


java.lang.String aMethodName, int aIndex)
Remove an element from a Page List or Java Property List.

prSet(PublicAPI aTools, ClipboardProperty aProperty,


java.lang.String aMethodName, int aIndex,
java.lang.String aValue)
Called when a Java Property List element's value is being set. Returns a boolean
value.

prSize(PublicAPI aTools, ClipboardProperty aProperty,


java.lang.String aMethodName)
Returns the number of elements in a list or the number of characters in a string
value. Returns an integer.

object

prGetObject(PublicAPI aTools, ClipboardProperty aProperty,


java.lang.String aMethodName)
Called when retrieving an embedded object from this object. Returns
PRObjectWrapper

prSet(PublicAPI aTools, ClipboardProperty aProperty,


java.lang.String aMethodName, PRObjectWrapper aValue)
Called when an embedded object is being set. Returns a boolean value

objectlist

prAdd(PublicAPI aTools, ClipboardProperty aProperty,


java.lang.String aMethodName, int aIndex, PRObjectWrapper aValue)
Called when adding an element to an object list.
prClear(PublicAPI aTools, ClipboardProperty aProperty,
java.lang.String aMethodName)
Called when a Java Property List property is being cleared.

20 CONFIDENTIAL
IMPLEMENTING A CUSTOM WRAPPER STRUCTURE

prGetNew(PublicAPI aTools, ClipboardProperty aProperty,


java.lang.String aMethodName)
Called when retrieving a new element to be added to a list. Returns
PRObjectWrapper

prGetObject(PublicAPI aTools, ClipboardProperty aProperty,


java.lang.String aMethodName, int aIndex)
Called when retrieving an embedded object from a list contained in this object.
Returns PRObjectWrapper

prRemove(PublicAPI aTools, ClipboardProperty aProperty,


java.lang.String aMethodName, int aIndex)
Remove an element from a Page List or Java Property List.

prSet(PublicAPI aTools, ClipboardProperty aProperty,


java.lang.String aMethodName, int aIndex, PRObjectWrapper aValue)
Called when an embedded object in a list is being set. Returns a boolean value

prSize(PublicAPI aTools, ClipboardProperty aProperty,


java.lang.String aMethodName)
Returns the number of elements in a list or the number of characters in a string
value. Returns an integer.

The following two methods apply to the whole Java object, not just the property type:

prCopy()
Called when a Page that has an attached object is copied. Returns
PRObjectWrapper.

prGetWrappedObject()
Used to get the object contained in this wrapper. Returns java.lang.Object

Attach the Java Object to the Java Page

In order to access the data in the Java object with Java Properties, the Java object must
be attached to the Java Page. Depending upon how the application uses the Java
objects, there are two different ways to attach the Java object to the Java Page:

• attach the object


• create the object

Attaching an object

Some customer applications will be importing their Java objects using one of the
PegaRULES interfaces, such as Rule-Service-JSR94. In this case, part of the import
process automatically maps the Java object into a placeholder Java Object property on a
page in the clipboard. Other applications may have other ways of importing the Java
object into the system.

Once the Java object is in the system, however, it must be attached to a Java Page in
order for Process Commander to directly access the data. This is generally done using a
step of an Activity, in one of two ways:

CONFIDENTIAL 21
IMPLEMENTING A CUSTOM WRAPPER STRUCTURE

• using a Java step with the Java method attachJavaObject


• calling the PegaRULES activity Embed-Java-.AttachJavaObject

Creating custom Java steps is no longer Process Commander Best Practice, so the
AttachJavaObject activity is strongly recommended. This activity uses the wrapper class
to attach the Java object to the Java page on the clipboard. (Please reference the
Working with Java Objects in Process Commander tech note for full details on using
the AttachJavaObject activity.)

Creating an object

Once the structures have been created in Process Commander to work with Java objects
(such as the Java Page, the Java Properties, the classes, and the wrapper), it is also
possible to create Java objects in the system.

This is useful if the application uses Java objects to store and manipulate data. For
example, in the health insurance policy example, a new customer may have just signed
up, and call in with a question. The user can create a new policy object for this customer
in Process Commander, and fill it in with their information, which can then be saved into
the customer legacy system.

Important: Java objects may only be created in Process Commander if the Java object
structure complies with the JavaBean specification (see point #3 under the Implementing a
Custom Wrapper Structure section).

Creating a new Java object begins with a reference to a Java Property. In an Activity, this
can be done two ways:

• start with a Page-New step which creates the embedded Java Page (of the class of
the Java Property), and then (in the next step) do a Property-Set of the Java Property
• just do a Property-Set directly to the Java Property, using the full property reference
(“.Acme-CustData-Customer.firstName”), which will create the page and then do the
Property-Set

When the activity references this Java Property, the system will look for the Java object,
which should be attached to the Java Page for this property. If the Java object is not
attached to the Java Page (which it won’t be, as this is a new Java object), Process
Commander will attempt to instantiate a Java object, using the information in the system.
From the class definition, it will identify the wrapper and attempt to load it into the JVM. If
the wrapper can be loaded, then Process Commander will use that information to
automatically create and attach a new Java object.

If the system can’t load the wrapper, then it tries to generate the code and then use it. If
the Import Rules Accelerator was used to create the wrapper, then the wrapper code can
be generated and loaded. If, however, a custom wrapper was created for this class, then
the system can’t generate the code, and a PRRuntimeException error will occur.

Access the data in the Java object

After the Java Properties are defined and the Java object is attached to the Java Page,
the Java Properties may be used and referenced throughout the Process Commander
system as though they were PegaRULES properties. Anywhere a String property is valid
– expressions, Activities, Declarative Processing – the Java Properties may be used; the

22 CONFIDENTIAL
MODIFYING AN EXISTING WRAPPER

system will extract the appropriate value of the Java Property from the attached Java
object. Property-Set may also be used to directly change the value of the data in the Java
object.

Customers who imported their Java objects through a Rule-Service- rule (such as Rule-
Service-JSR94) may also wish to export the Java object back to the originating system
after processing is complete. In this case, they need to put the Java object back into the
“placeholder” Java Object property, in order to export it using a Rule-Connect- rule (such
as Rule-Connect-EJB). The activity Embed-Java-.GetAttachedJavaObject may be
used to move the Java object into the Java Object property in preparation for export.
(Please reference the Working with Java Objects in Process Commander tech note for
full details on using the GetAttachedJavaObject activity.)

Modifying an Existing Wrapper

Some developers may prefer to use the Import Rules Accelerator to create all the
appropriate structures, and then modify them as appropriate, rather than writing them
“from scratch.” If the Accelerator-created wrapper is going to be modified, the developer
must first save it into another location, and then change the name of the wrapper (to
prevent system confusion) before modifying it.

As stated previously, wrappers which are generated through the Import Rules Accelerator
are stored under the temp directory. Since these are generated wrappers, they can be
stored in a temporary directory, as the information to regenerate them is available in the
system.

A modified wrapper must not be stored in the temporary directory, as it cannot be deleted.
Therefore, custom-written wrappers should be stored in the same directory as a .jar file:
\ext\lib. For Tomcat, this directory would be:

TomcatHome/webapps/contextroot/ext/lib

Example:

e:\tomcat\jakarta-tomcat-5.0.28\webapps\prweb\ext\lib

The name of the wrapper must also be changed. All system-generated wrappers include
the name “prpcwrapper” (example: com.acme.java.prpcwrapper.Customer). This
designation should only be used for generated wrappers; change the name to indicate that
this wrapper has been modified (example: com.acme.java.newdata.Customer).

Once the wrapper is modified, renamed, and stored in the ext\lib directory, the fully-
qualified new name of the wrapper must be entered into the Rule-Obj-Class instance for
the Java object associated with that wrapper.

CONFIDENTIAL 23
MODIFYING AN EXISTING WRAPPER

24 CONFIDENTIAL
APPENDIX A: GENERATED WRAPPER CODE FOR INVOICE.JAVA

Appendix A: Generated Wrapper Code for Invoice.java

/*
* Copyright (c) 2005 Pegasystems Inc.
* All rights reserved.
*
* This software is governed by a License Agreement that restricts its
* use. The software contains valuable trade secrets and proprietary
* information of Pegasystems Inc and is protected by federal copyright
* law. It may not be copied, modified, translated or distributed in any
* form or medium, disclosed to third parties or used in any manner not
* expressly provided for in said License Agreement except with written
* authorization from Pegasystems Inc.
*/
/**
* Notice: This is a generated java class; do not modify this source
* directly. Custom wrappers should not be written in a package with
* a name that ends with 'prpcwrapper'.
*
* Date Created: Wed May 25 11:52:11 EDT 2005
*/

package com.pega.test.prpcwrapper;

import com.pega.pegarules.priv.LogHelper;
import com.pega.pegarules.priv.util.JavaPropertyTransformRegistry;import
com.pega.pegarules.pub.PRRuntimeException;
import com.pega.pegarules.pub.clipboard.ClipboardPage;
import com.pega.pegarules.pub.clipboard.ClipboardProperty;
import com.pega.pegarules.pub.clipboard.JavaPropertyTransform;import
com.pega.pegarules.pub.clipboard.PRObjectWrapper;
import com.pega.pegarules.pub.runtime.PublicAPI;

import java.io.Serializable;

CONFIDENTIAL 25
APPENDIX A: GENERATED WRAPPER CODE FOR INVOICE.JAVA

public class Invoice implements PRObjectWrapper, Serializable {


static final long serialVersionUID = -456123893L;
private static final LogHelper oLog = new LogHelper(Invoice.class);
private com.pega.test.Invoice theBean;

public Invoice() {
theBean = new com.pega.test.Invoice();
}
public Invoice(ClipboardPage javaPage) {
theBean = new com.pega.test.Invoice();
javaPage.attachJavaObject(this);
}
public Invoice(com.pega.test.Invoice theBean) {
this.theBean = theBean;
}
public Invoice(ClipboardPage javaPage, com.pega.test.Invoice theBean) {
this.theBean = theBean;
javaPage.attachJavaObject(this);
}

public void prAdd(PublicAPI aTools, ClipboardProperty aProperty, String aMethodName, int aIndex,
PRObjectWrapper aValue) {
try {
if (oLog.isDebugEnabled())
oLog.debug("Wrapper call: Object prAdd(" + aMethodName + "["+ aIndex+"])");
throw new PRRuntimeException("Java Property '"+aMethodName+"' not recognized in object wrapper.");
} catch(Throwable th) {
if (th instanceof PRRuntimeException) {
throw (PRRuntimeException)th;
}
throw new PRRuntimeException("Exception in java property wrapper method.",th);
}
}

public void prAdd(PublicAPI aTools, ClipboardProperty aProperty, String aMethodName, int aIndex, String
aValue) {

26 CONFIDENTIAL
APPENDIX A: GENERATED WRAPPER CODE FOR INVOICE.JAVA

try {
if (oLog.isDebugEnabled())
oLog.debug("Wrapper call: String prAdd(" + aMethodName + "["+ aIndex+"])");
throw new PRRuntimeException("Java Property '"+aMethodName+"' not recognized in object wrapper.");
} catch(Throwable th) {
if (th instanceof PRRuntimeException) {
throw (PRRuntimeException)th;
}
throw new PRRuntimeException("Exception in java property wrapper method.",th);
}
}

public void prClear(PublicAPI aTools, ClipboardProperty aProperty, String aMethodName) {


try {
if (oLog.isDebugEnabled())
oLog.debug("Wrapper call: prClear(" + aMethodName + ")");
throw new PRRuntimeException("Java Property '"+aMethodName+"' not recognized in object wrapper.");
} catch(Throwable th) {
if (th instanceof PRRuntimeException) {
throw (PRRuntimeException)th;
}
throw new PRRuntimeException("Exception in java property wrapper method.",th);
}
}

public PRObjectWrapper prCopy() {


try {
if (oLog.isDebugEnabled())
oLog.debug("Wrapper call: prCopy()");
// NOTICE: this is a shallow copy!
return new Invoice(theBean);
} catch(Throwable th) {
if (th instanceof PRRuntimeException) {
throw (PRRuntimeException)th;
}
throw new PRRuntimeException("Exception in java property wrapper method.",th);
}
}

CONFIDENTIAL 27
APPENDIX A: GENERATED WRAPPER CODE FOR INVOICE.JAVA

public PRObjectWrapper prGetObject(PublicAPI aTools, ClipboardProperty aProperty, String aMethodName) {


try {
if (oLog.isDebugEnabled())
oLog.debug("Wrapper call: Object prGet(" + aMethodName + ")");
if (aMethodName.equals("currentAddress")) {
com.pega.test.Invoice.Address theValue = theBean.getCurrentAddress();
return theValue==null?null:new com.pega.test.prpcwrapper.Invoice_Address(theValue);
} else {
throw new PRRuntimeException("Java Property '"+aMethodName+"' not recognized in object
wrapper.");
}
} catch(Throwable th) {
if (th instanceof PRRuntimeException) {
throw (PRRuntimeException)th;
}
throw new PRRuntimeException("Exception in java property wrapper method.",th);
}
}

public PRObjectWrapper prGetObject(PublicAPI aTools, ClipboardProperty aProperty, String aMethodName,


int aIndex) {
// We will not attempt to grow an *array*. *Lists* we will grow when a
// no-arg constructor is available for the lists component type.
//
try {
if (oLog.isDebugEnabled())
oLog.debug("Wrapper call: Object prGet(" + aMethodName + "["+ aIndex+"])");
throw new PRRuntimeException("Java Property '"+aMethodName+"' not recognized in object wrapper.");
} catch(Throwable th) {
if (th instanceof PRRuntimeException) {
throw (PRRuntimeException)th;
}
throw new PRRuntimeException("Exception in java property wrapper method.",th);
}
}

public String prGet(PublicAPI aTools, ClipboardProperty aProperty, String aMethodName) {

28 CONFIDENTIAL
APPENDIX A: GENERATED WRAPPER CODE FOR INVOICE.JAVA

try {
if (oLog.isDebugEnabled())
oLog.debug("Wrapper call: String prGet(" + aMethodName + ")");
if (aMethodName.equals("birthDay")) {
java.util.Date theValue = theBean.getBirthDay();
JavaPropertyTransform jpTransform =
JavaPropertyTransformRegistry.getTransformInstance("com.pega.pegarules.priv.util.javaproperty.Transform
UtilDate");
return jpTransform.instanceToString(aProperty,theValue);
} else if (aMethodName.equals("firstName")) {
java.lang.String theValue = theBean.getFirstName();
return theValue;
} else if (aMethodName.equals("lastName")) {
java.lang.String theValue = theBean.getLastName();
return theValue;
} else {
throw new PRRuntimeException("Java Property '"+aMethodName+"' not recognized in object
wrapper.");
}
} catch(Throwable th) {
if (th instanceof PRRuntimeException) {
throw (PRRuntimeException)th;
}
throw new PRRuntimeException("Exception in java property wrapper method.",th);
}
}

public String prGet(PublicAPI aTools, ClipboardProperty aProperty, String aMethodName, int aIndex) {
try {
if (oLog.isDebugEnabled())
oLog.debug("Wrapper call: String prGet(" + aMethodName + "["+ aIndex+"])");
throw new PRRuntimeException("Java Property '"+aMethodName+"' not recognized in object wrapper.");
} catch(Throwable th) {
if (th instanceof PRRuntimeException) {
throw (PRRuntimeException)th;
}
throw new PRRuntimeException("Exception in java property wrapper method.",th);
}

CONFIDENTIAL 29
APPENDIX A: GENERATED WRAPPER CODE FOR INVOICE.JAVA

public Object prGetWrappedObject() {


try {
if (oLog.isDebugEnabled())
oLog.debug("Wrapper call: prGetWrappedObject()");
return theBean;
} catch(Throwable th) {
if (th instanceof PRRuntimeException) {
throw (PRRuntimeException)th;
}
throw new PRRuntimeException("Exception in java property wrapper method.",th);
}
}

public void prRemove(PublicAPI aTools, ClipboardProperty aProperty, String aMethodName, int aIndex) {
try {
if (oLog.isDebugEnabled())
oLog.debug("Wrapper call: prRemove(" + aMethodName + "["+ aIndex+"])");
throw new PRRuntimeException("Java Property '"+aMethodName+"' not recognized in object wrapper.");
} catch(Throwable th) {
if (th instanceof PRRuntimeException) {
throw (PRRuntimeException)th;
}
throw new PRRuntimeException("Exception in java property wrapper method.",th);
}
}

public boolean prSet(PublicAPI aTools, ClipboardProperty aProperty, String aMethodName, PRObjectWrapper


aValue) {
try {
if (oLog.isDebugEnabled())
oLog.debug("Wrapper call: Object prSet(" + aMethodName + ")");
if (aMethodName.equals("currentAddress")) {
com.pega.test.Invoice.Address theValue =
(com.pega.test.Invoice.Address)aValue.prGetWrappedObject();
theBean.setCurrentAddress(theValue);
return true;

30 CONFIDENTIAL
APPENDIX A: GENERATED WRAPPER CODE FOR INVOICE.JAVA

} else {
throw new PRRuntimeException("Java Property '"+aMethodName+"' not recognized in object
wrapper.");
}
} catch(Throwable th) {
if (th instanceof PRRuntimeException) {
throw (PRRuntimeException)th;
}
throw new PRRuntimeException("Exception in java property wrapper method.",th);
}
}

public boolean prSet(PublicAPI aTools, ClipboardProperty aProperty, String aMethodName, int aIndex,
PRObjectWrapper aValue) {
try {
if (oLog.isDebugEnabled())
oLog.debug("Wrapper call: Object prSet(" + aMethodName + "["+ aIndex+"])");
throw new PRRuntimeException("Java Property '"+aMethodName+"' not recognized in object wrapper.");
} catch(Throwable th) {
if (th instanceof PRRuntimeException) {
throw (PRRuntimeException)th;
}
throw new PRRuntimeException("Exception in java property wrapper method.",th);
}
}

public boolean prSet(PublicAPI aTools, ClipboardProperty aProperty, String aMethodName, String aValue)
{
try {
if (oLog.isDebugEnabled())
oLog.debug("Wrapper call: String prSet(" + aMethodName + ")");
if (aMethodName.equals("birthDay")) {
JavaPropertyTransform jpTransform =
JavaPropertyTransformRegistry.getTransformInstance("com.pega.pegarules.priv.util.javaproperty.Transform
UtilDate");
java.util.Date theValue = (java.util.Date)jpTransform.stringToInstance(aProperty,aValue);
theBean.setBirthDay(theValue);
return true;

CONFIDENTIAL 31
APPENDIX A: GENERATED WRAPPER CODE FOR INVOICE.JAVA

} else if (aMethodName.equals("firstName")) {
String theValue = aValue;
theBean.setFirstName(theValue);
return true;
} else if (aMethodName.equals("lastName")) {
String theValue = aValue;
theBean.setLastName(theValue);
return true;
} else {
throw new PRRuntimeException("Java Property '"+aMethodName+"' not recognized in object
wrapper.");
}
} catch(Throwable th) {
if (th instanceof PRRuntimeException) {
throw (PRRuntimeException)th;
}
throw new PRRuntimeException("Exception in java property wrapper method.",th);
}
}

public boolean prSet(PublicAPI aTools, ClipboardProperty aProperty, String aMethodName, int aIndex,
String aValue) {
try {
if (oLog.isDebugEnabled())
oLog.debug("Wrapper call: String prSet(" + aMethodName + "["+ aIndex+"])");
throw new PRRuntimeException("Java Property '"+aMethodName+"' not recognized in object wrapper.");
} catch(Throwable th) {
if (th instanceof PRRuntimeException) {
throw (PRRuntimeException)th;
}
throw new PRRuntimeException("Exception in java property wrapper method.",th);
}
}

public int prSize(PublicAPI aTools, ClipboardProperty aProperty, String aMethodName) {


try {
if (oLog.isDebugEnabled())
oLog.debug("Wrapper call: prSize(" + aMethodName + ")");

32 CONFIDENTIAL
APPENDIX A: GENERATED WRAPPER CODE FOR INVOICE.JAVA

throw new PRRuntimeException("Java Property '"+aMethodName+"' not recognized in object wrapper.");


} catch(Throwable th) {
if (th instanceof PRRuntimeException) {
throw (PRRuntimeException)th;
}
throw new PRRuntimeException("Exception in java property wrapper method.",th);
}
}

public PRObjectWrapper prGetNew(PublicAPI arg0, ClipboardProperty arg1, String aMethodName) {


try {
if (oLog.isDebugEnabled())
oLog.debug("Wrapper call: prGetNew(" + aMethodName + ")");
throw new PRRuntimeException("Java Property '"+aMethodName+"' not recognized in object wrapper.");
} catch(Throwable th) {
if (th instanceof PRRuntimeException) {
throw (PRRuntimeException)th;
}
throw new PRRuntimeException("Exception in java property wrapper method.",th);
}
}
}

CONFIDENTIAL 33

You might also like