Professional Documents
Culture Documents
Copyright 2006
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 unless otherwise provided for by a contract or business
agreement with Pegasystems. 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 the discretion of Pegasystems. 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 service
consultant.
For Pegasystems trademarks and registered trademarks, all rights are reserved. Other
brand or product names are trademarks of their respective holders.
Although Pegasystems Inc. strives for accuracy in its publications, any publication may
contain inaccuracies or typographical errors. This document could contain technical
inaccuracies or typographical errors. Changes are periodically added to the information
herein. Pegasystems Inc. may make improvements and/or changes in the information
described herein at any time.
Contents
About this Document ...............................................................................................2
Introduction...............................................................................................................3
Key Terms and Concepts ...................................................................................3
The Process .......................................................................................................4
About the JSR 94 Service Sample .....................................................................6
Summary of Steps for Building JSR 94 Services................................................8
About the JSR 94 Service ........................................................................................9
Rules and Data Objects for JSR 94 Services.....................................................9
Session State ...................................................................................................10
Authentication...................................................................................................10
Data Mapping for JSR 94 Services...................................................................11
Result Filter ......................................................................................................13
TCK and Compliance........................................................................................13
Creating a JSR 94 Service .....................................................................................14
Plan the JSR 94 Service...................................................................................14
(Optional) Create the Data Model of the Incoming Java Object .......................15
Create or Identify the Class Rule and Properties .............................................16
Create or Identify the Service Activities............................................................16
Create the Service Package and Service Rules...............................................20
Build the JSR 94 Client.....................................................................................26
Run the Client and Test the Service.................................................................29
Running the Sample...............................................................................................30
PegaRULES Setup...........................................................................................30
Client Application Setup ...................................................................................31
Run the PegaClaimSample Client Application .................................................35
Troubleshooting .....................................................................................................36
Examining Log Files .........................................................................................37
The System Pulse and JSR 94 Services...............................................................39
A PegaRULES Process Commander service is a set of rules and data objects that define
and implement an interface between an external application that acts as the client and a
Process Commander application that acts as the server. You use services to enable an
external system to access Process Commander or PegaRULES data and processing.
Java Specification Request 94 (JSR 94) describes a Java Application Programming
Interface (API) for rule engines defined by the Java Community Process (JCP).
PegaRULES JSR 94 services receive and respond to requests from external
applications through JSR 94 invocations.
PegaRULES implements all the Java interfaces described in the JSR 94. An external JSR
94 client application accesses the rules in the PegaRULES database by starting and then
communicating directly with an embedded PegaRULES engine through the JSR 94
interface, and not with the Process Commander Web application.
`This document contains the following sections:
Introduction
Troubleshooting
Introduction
A service receives input from an external system and can respond in some way. For
example, it can reply with data that was requested, it can use the incoming data to create
a work object and initiate a flow, and so on.
A JSR 94 client starts a new instance of the PegaRULES engine, which then runs in the
same Java Virtual Machine (JVM) as the client. Because the JSR 94 client accesses your
application rules directly through the PegaRULES engine, the application server and the
Process Commander Web application do not need to be running for the JSR 94
communication to take place. If the Web application is online, however, both Process
Commander and the JSR 94 client can share the same PegaRULES database as separate
applications.
Any rules the service activity calls or runs: additional activities, declarative rules,
utility functions, and so on
Rules Engine
The rules engine refers to the PegaRULES engine.
com.pega.pegarules.pub.services.jsr94.PRuleServiceProvider
Service URI
The Service URI of a PegaRULES JSR 94 service is typically the name of the service
rule, which is defined by a three-part key:
Package name
For example, the URI of the sample JSR 94 service is the following:
SampleJSR94.ClaimService.ProcessClaim
If the external client application requires that the URIs of the services it calls use some
other naming convention, you can provide a different URI for the service by entering the
value you want to use in the Alternate URI field on the Service tab of the service rule.
The Process
Figure 1 illustrates the architecture of the JSR 94 service.
A Single
JVM
JSR-94 Client
request
response
Data-AdminServicePackage
Rule-Service-JSR94
PegaRULES
Engine
Page
Clipboard
Java
Page
Service Activity
2.
Using the RuleRuntime reference and the URI of the JSR 94 service (either the
Service URI or the alternate URI), the client obtains a RuleSession object, which
can be stateful or stateless.
3.
The client gathers parameters, packages them into a java.util.List object, and sends
it to PegaRULES by executing the RuleSession and providing the object list.
4.
The JSR 94 service maps the incoming list of objects to the clipboard and then
invokes the service activity.
5.
The service activity completes the tasks that it is programmed to do. It sets
properties on the clipboard, processes property values, invokes other activities, and
so on. When the activity completes processing, typically it has changed property
values on the clipboard.
6.
7.
The JSR 94 service invokes the appropriate rules to create a response for the
JSR 94 client.
8.
If an object filter was provided either a default object filter is specified in the
JSR 94 service rule or one was passed in by the client application the JSR 94
integration interface filters the items in the java.util.List object being returned to
the client.
9.
The JSR 94 service returns control to the JSR 94 client. If there are any objects to
return, they are returned in a java.util.List.
10. The JSR 94 client evaluates the response and takes appropriate actions.
The PegaRULES JSR 94 service, which makes the AutoClaim application available
to the PegaClaimSample application. The service receives requests from and sends
responses to the PegaClaimSample application.
Claim
Damage
Vehicle
These classes make up an insurance claim object that describes the damage to a
policyholders vehicle. The pegaclaimsampleclient51.zip file contains both the class files
and their Java source files so that you can examine the code.
The class and property rules implement the data model described in the Java classes
Claim, Damage, and Vehicle.
The AutoClaim application was created by using the Import JavaBeans Accelerator to
import the Java class named Claim into the base class rule named SampleJavaBase-. The
Claim class contains a variable that refers to an object of the Damage Java class and a
variable that refers to an object of the Vehicle Java class. Therefore, the accelerator
created a class rule for each of the Java classes and a property rule of mode Java
Property for each of the variables specified in all three Java classes.
After the accelerator created the data model described in the Claim, Damage, and Vehicle
Java classes, an additional property was manually created for the Vehicle class: age. The
value of the age property is calculated with an expression rule (Rule-Obj-Expressions).
Incoming claim objects provide values for the year, make, and model of the vehicle. The
expression rule calculates the age of a vehicle by subtracting the value in the year
property from the value of the current year.
The accelerator also generated three Java classes that implement the PRObjectWrapper
interface of the Clipboard Java API. These Java wrapper classes provide you with a
standard way to access Java objects as clipboard pages from within PegaRULES. The
service activity in the JSR 94 service example uses these wrapper classes to manipulate
the Claim Java objects that the PegaClaimSample client application sends.
For more information about Java properties, Process Commander Java pages, and
generated Java wrapper classes, see Working with the Java Pages Feature, posted on the
Integration pages of the PDN.
For information about the PRObjectWrapper interface, see the PegaRULES Process
Commander Javadocs, located on your installation CD.
Create the Process Commander properties and Java wrapper classes necessary to
support the processing of the service activity. See Data Mapping for JSR 94
Services on page 11 and Create or Identify the Class Rule and Properties on
page 16.
2.
Create the rules and data objects that make a JSR 94 service, as described in
Creating a JSR 94 Service on page 14.
3.
Create the JSR 94 client that uses the JSR 94 service to communicate with
PegaRULES. Although it is outside the scope of this document to describe how to
develop JSR 94 clients, this document does provide the information a client
application uses to identify and communicate with PegaRULES. See Build the JSR
94 Client on page 26.
Component
Purpose
Service package
(Data-AdminServicePackage)
Service rule
(Rule-Service-JSR94)
Service activity
(Rule-Obj-Activity)
10
Session State
As with all Process Commander services, if the session is stateless, the service package
uses requestor pooling. Additionally, the clipboard is cleared for the requestor when the
service completes its response. Subsequent requests to the same service do not have
access to any previous values.
Requestor pools do not contain authenticated requestors (users). Therefore, if the session
is stateless and the service runs as an authenticated user, requestor pooling is not
available.
The state of a RuleRuntime session (stateless vs. stateful) is specified in two places:
The session semantics of the JSR 94 client and the service package must match. If they
do not, unexpected results may occur when you test your service because session state for
the service is determined by the service package, not the JSR 94 client:
If the JSR 94 client requests a stateless session but the service package is set to
stateful, the session is stateful and requestor pooling is disabled.
If the JSR 94 client requests a stateful session but the service package is set to
stateless, the session is stateless and the clipboard properties are cleared when the
service completes its processing.
For more information about requestor pooling, see PegaRULES Process Commander
Integrating With External Systems.
Authentication
A JSR 94 service can run as either an authenticated or an unauthenticated user.
11
On the Context tab of the Service Package form, select the Requires Authentication
option.
2.
In the JSR 94 client application, provide the user name and password of the
appropriate PegaRULES operator ID with the request for the RuleSession object.
For example:
Note that the session state of the RuleSession object must match that specified in the
service package.
For more information about building the JSR 94 client, see Build the JSR 94 Client on
page 26.
Use the Request tab to specify how to map the input list to the clipboard (Map To).
Use the Response tab to specify how the service rule constructs the output list to be
sent from PegaRULES to the external application (Map From).
To determine how to configure the data mapping for a JSR 94 service rule, assess the
data that will be transmitted. For example, is the data a list of Java objects that are
instances of JavaBeans? Is the data list of Java objects that are not instances of
JavaBeans? Your assessment reveals how to map the input and output lists.
12
If the message contains a homogenous list, you can map the entire object directly to
an embedded page list property whose page class is one that inherits from the
Embed-Java- base class, that is, a Java page.
If the message contains a mixed list, you can map the individual components to
individual Java pages.
If, for some reason, you cannot map the Java object directly to a Java page on the
clipboard, map it to a property of mode Java Object List. Then, configure the service
activity to attach the list to a Java Page with the Embed-Java-.AttachJavaObject
activity.
For more information about how to use the Process Commander Java pages feature with a
JSR 94 service, see Working with the Java Pages Feature. The document describes how
to use the Import JavaBeans Accelerator to create within Process Commander the data
model of the java.util.List objects delivered by the JSR 94 client application. It also
describes how to use the Embed-Java-.AttachJavaObject activity to attach the
java.util.List objects to the clipboard.
Note: Even though the request and response messages in the JSR 94 sample could
be mapped directly to and from an embedded Page List property, the messages are
mapped to and from a Java Object List property in order to illustrate how to use the
AttachJavaObject activity in a service activity.
13
Result Filter
A JSR 94 object filter constrains the result set returned by the service activity based on
some set of criteria. To use an object filter with your JSR 94 interface, complete the
following steps:
1.
Code a Java class that implements javax.rules.ObjectFilter and that specifies how to
limit the results from a call to the JSR 94 service.
2.
Put the object filter Java class in the PegaRULES Process Commander class paths.
For information about putting Java classes in the class paths, go to the PDN
(http://pdn.pega.com) and locate the article PRKB-20931 About the Process
Commander Class Paths. Follow the instructions in the section Adding ThirdParty jar Files and Java Class Files to the Class Paths.
3.
The client application can pass in the fully qualified name of an ObjectFilter Java
class when it calls the JSR 94 service rule with the StatefulRuleSession.getObjects or
the StatelessRuleSession.executeRules methods.
Specify it in the service rule. Enter its fully qualified name in the Result Filter field
on the Response tab of the JSR 94 service rule. In this case, the filter is used to limit
the results every time the service rule is invoked, unless an ObjectFilter is passed in
by the client application, which would override it.
14
15
Choose names for the individual components in the JSR 94 service and use Figure 3 to
keep track of the names. For reference purposes, the middle column of Figure 3 lists the
component names in the JSR 94 service example. Write the names of the components
you or the Service Accelerator create in the remaining column. Choose meaningful,
explanatory names.
Component
JSR94ServiceExample
RuleSet
PegaSample-IntSvcs
RuleSet version
(various)
Access group
sampleuser@samples.com
SampleJavaBase-
Properties for
service activity
class
ClaimObjectList (mode=Java
Object List)
Service activity
name
ProcessClaim
Service package
name
SampleJSR94
ClaimService
Service method
name
ProcessClaim
16
If the service starts or resumes a flow for a work object, the Services Accelerator
assigns the createWorkProcess or the resumeWorkProcess activity to the service, as
appropriate. For information about these activities, see Using the Service
Accelerator, which is available on the PDN. Then continue with Create the Service
Package and Service Rules on page 20.
If the service uses a custom activity, for each activity, identify the class rule it
applies to (that is, its primary page), the properties that it manipulates, the parameters
it expects, and the step pages that it needs, if any.
2.
Field
Selection
Applies to
17
Enter the name that you chose for the service activity
in the planning stage (see Figure 3).
For example, the name of the service activity for the
JSR 94 service example is ProcessClaim.
In the Activity form, on the Pages and Classes tab, configure step pages for each of
the following class rules:
The class rule for the service activity. For example, the class rule for the JSR 94
service example is SampleJavaBase-.
The class rule that represents the main Java class in the JSR 94 client application.
For example, the appropriate class rule for the JSR 94 service example is
SampleJavaBase-Claim.
Write down the names as indicated in Figure 5.
Project
JSR94Service
Example
Class name:
SampleJavaBase-
Your JSR 94
Project
Figure 5. Pages and Classes Tab in Activity Window
For example, Figure 6 shows the Pages and Classes tab for the ProcessClaim service
activity.
18
Figure 6. Pages and Classes Tab for the Service Activity Example
4.
5.
(Optional) If the incoming object will be mapped to a property of mode Java Object
List in the service rule, configure steps that use the AttachJavaObject activity to
attach the object to a Java page:
Use the first step on the Steps tab to create the step page (Java page) for the class
rule that represents the main Java class in the JSR 94 client application. For example,
the first step in the Process Claim activity uses the Page-New method to create the
ClaimPage page.
Configure the second step to call the AttachJavaObject activity, passing in the
identity of the Java Object List property that holds the object to attach.
Configure the remaining steps for the service activity, as appropriate for your goals.
For example, the ProcessClaim service activity has one more step that uses a map
value rule (Rule-Obj-MapValue) to determine whether to approve or deny the claim
based on the age of the car and the amount of the claim. For more information about
this step and the map value rule, see Service Activity Example: the Map Value Rule
Step on page 18.
6.
7.
On the History tab, enter a description in both the Full Description and the Usage
fields.
8.
Click Save.
19
Figure 7. Running the DetermineApprovalStatus Map Value Rule in the ProcessClaim Activity
The DetermineApprovalStatus map value rule evaluates the age of the vehicle and the
amount of the claim and then sets the value of the approvalStatus property to either
Approved or Denied.
Figure 8 shows the decision map on the Matrix tab of the DetermineApprovalStatus map
value rule.
Figure 8. The Decision Map Matrix for the DetermineApprovalStatus Map Value Rule
As mentioned, the age of the vehicle is determined by an expression rule (Rule-DeclareExpression) that calculates the age from the year of the vehicle. Figure 9 shows the
Expressions tab for the expression rule that calculates the value of the age property.
20
From the main Process Commander page, click the Integration icon.
2.
3.
Click New.
4.
In the New form, in the Service Package name field, enter the name that you chose
for the service package in your planning stage (See Figure 3). For example, the
service package in the JSR 94 service example is SampleJSR94.
5.
In the Service Package form, on the Context tab, complete the fields as shown in
Figure 10.
Field
Value
Processing Mode
Access Group
Requires authentication?
Suppress Show-HTML
Figure 10. Fields on the Context Tab of the Service Package Window
6.
If you selected stateless as the Processing Mode on the Context tab, select the
Pooling tab and configure the requestor pool for your service. Because requestor
pooling is possible for stateless, unauthenticated services only, the Pooling tab is
ignored if Processing Mode is set to Stateful.
7.
On the History tab, enter a description in both the Full Description and the Usage
fields.
8.
Click Save.
Note: The Deployment and Methods tabs are not used by a service package for a
JSR 94 service.
21
22
On the Rules by Type explorer, select Integration-Services > Service JSR 94.
2.
Click New.
3.
Field
Value
Enter the name that you chose for the service class in
the planning stage (see Figure 3). This name must
match the className component of the URI specified
by the JSR 94 client; it is not the name of a Rule-ObjClass rule.
For example, the service class name for the JSR 94
service example is ClaimService.
Enter the name that you chose for the service method
in the planning stage (see Figure 3). This name must
match the methodName component of the URI
specified by the JSR 94 client.
For example, the service method name for the
JSR 94 service example is ProcessClaim.
In the Service Rule form, on the Service tab, complete the fields as shown in
Figure 12.
Field
Value
Alternate URI
Page Class
Page Model
Page Name
Activity Name
Figure 12. Fields on the Service Tab for a JSR 94 Service Rule
Figure 13 shows the Service tab for the service rule example.
23
24
On the Request tab, click in the Map Input List field and specify whether you are
mapping the entire input list as a single object or whether you are mapping each
element in the list as separate objects.
6.
If you are mapping the input list as a single object, enter java.util.List.
If you are mapping the individual elements, enter the data type of the object. For the
primitive Java types, enter String, boolean, byte, int, short, long, float, or double, as
appropriate. For a custom Java class, use the fully qualified Java class name of the
object.
7.
8.
9.
If you selected Clipboard in the Map To field, then, in the Map To Key field, select
the name of a property that is either a Java Object List property or an embedded
page list property whose page class is one that inherits from the Embed-Java- base
class. The sample JSR 94 service rule maps the list to a Java Object List property
named ClaimObjectList that belongs to the SampleJavaBase- class rule.
25
Figure 14. Request Tab for the Sample JSR 94 Service Rule
10. If you are mapping individual elements from the input list, repeat steps 6 through 9
for each element in the input list.
11. On the Response tab, click in the Map Output List field and specify whether you are
mapping the entire output list as a single object or whether you are mapping each
element in the list as separate objects.
12. (Optional) If you are using a result filter, enter its fully qualified name in the Result
Filter field. See Result Filter on page 13 for more information.
13. Click in the Data Type field and do one of the following:
If you are mapping the output list as a single object, enter java.util.List.
If you are mapping the individual elements, enter the data type of the object. For the
primitive Java types, enter String, boolean, byte, int, short, long, float, or double, as
appropriate. For a custom Java class, use the fully qualified Java class name of the
object.
26
Figure 15. Response Tab for the Sample JSR 94 Service Rule
17. If you are mapping individual elements from the output list, repeat steps 13 through
16 for each element in the input list.
18. On the History tab, enter a description in both the Full Description and the Usage
fields.
19. Click Save.
27
com.pega.pegarules.pub.services.jsr94.PRuleServiceProvider
Authentication
As described in The Process on page 4, by using the RuleRuntime reference and the
Service URI of the JSR 94 service, the client obtains a RuleSession object. If the service
is to run as an authenticated user, the client application must provide appropriate
credentials for the service.
To identify the service as an authenticated user, provide the user name and password of
the appropriate PegaRULES operator ID with the request for the RuleSession object. For
example:
28
Note that in the sample client code, the values for the UserName and Password properties
are set as constants just after the statement that sets the value of the Service URI as a
constant. See the source SubmitClaim.java file in the pegaclaimsampleclient51.zip file.
As mentioned, the session semantics of the RuleSession code must match that of the
service package. For more information about session state, see Session State on page
10. For more information about authentication, see Authentication on page 10.
The PegaRULES JAR files. That is, the JAR files located in the WEB-INF\lib or
APP-INF\lib directory.
Because the PegaRULES engine needs it, the servlet .jar file that contains the Java
class javax.servlet.http.HttpServletResponse.
The appropriate database driver files for your database. For example, for SQL
Server: msbase.jar, mssqlserver.jar, and msutil.jar. For Oracle: classes12.zip.
The directory from which you run the JSR 94 client application. For the JSR 94
example, that directory is the pegasample-05-01_jsr94serviceapp\classes directory.
The prconfig.xml and prlogging.xml configuration files. If you place these files in
the directory from which you run the JSR 94 application, the class path statement for
the client directory also covers the prconfig.xml and prlogging.xml files.
29
The PegaClaimSample batch and shell scripts and the PegaClaimSample Ant script for
the sample provide an example of how to ensure that all the required items are in the
classpath of a JSR 94 client application.
30
PegaSample-IntSvcs.zip. This zip file is the RuleSet with the Integration Services
examples, including the sample JSR 94 service rule and the class and property rules
that make up the Process Commander application used in the JSR 94 sample,
AutoClaim.
Java class and source files for the JSR 94 sample client application
Java class and source files that create the Claim objects the JSR 94 sample client
application sends to Process Commander for processing
An Apache Ant script file that runs the sample client application
A batch file and a shell script that set certain environment variables and then invoke
the run script
This section describes how to set up and run the JSR 94 sample. You upload the
PegaSample-IntSvcs RuleSet, download the client application, install Apache Ant,
configure the client applications runtime environment, and then invoke the
PegaClaimSample.xml script to start the application.
PegaRULES Setup
To set up PegaRULES to run the sample, you import the PegaSample-IntSvcs RuleSet.
Complete the following steps:
1.
2.
From the Process Commander menu, choose File > Import Archive.
3.
4.
Click the Browse button next to the File Name field to choose the file.
5.
Click Upload File. The wizard uploads the file to the Process Commander
ServiceDirectory directory and displays the message File Uploaded Successfully.
6.
7.
From the list of files, choose the one you just uploaded. The wizard examines the
file and displays several options.
8.
Click Import. Process Commander processes the zip file. When it is finished, it
displays a status message.
9.
Log out of Process Commander and log back in as the sample user:
31
Note: If you need help with any of the steps in this procedure, see PegaRULES
Process Commander Administration and Security.
Create a directory for the client application in a location that has network access to
the PegaRULES Process Commander system named pegaclaimsample. Do not use
any spaces in the directory name.
2.
3.
Unzip the downloaded zip file into the client application directory.
32
Locate the prconfig.xml and prlogging.xml files for your PegaRULES installation.
If Process Commander is deployed as a Web application, they are located in the
WEB-INF\classes directory. If Process Commander is deployed as an Enterprise
application, they are located in the prresources.jar file, which is located in the APPINF\lib directory.
2.
Specify a top-level directory that is different than the one used by the Process
Commander application as the temporary directory. As described in Location of the
temp Directory on page 29, the temporary directory stores generated Java for the
PegaRULES instance.
Edit the compiler node statement to include the path to the sample client
applications \classes subdirectory because the Claim.class, Damage.class, and
Vehicle.class files are located in that directory. The instance of the PegaRULES
engine that the sample client application starts must have in its class path the Claim,
Damage, and Vehicle Java classes or it cannot run the service activity successfully.
Edit the database settings to specify the location of the PegaRULES database
through a JDBC URL rather than a JDBC connection pool. Most likely, the
prconfig.xml file you copied specifies a JDBC connection pool, which is managed
by the application server hosting the Web component. Your JSR 94 client application
cannot use a JDBC connection pool to connect to the database.
Create a top-level directory to serve as the temp directory for the PegaRULES
instance that will be started by the client application.
2.
From the client application directory, open the copy of prconfig.xml file in a text
editor.
3.
33
4.
Scroll to the initServices settings and set them to false. For example:
<env
<env
<env
<env
5.
Immediately before the first database statement, insert the following node
statements, replacing the value represented in italics with the value that is
appropriate for your configuration.
<env name="compiler/defaultPaths" value="pathto\pegaclaimsample\classes" />
Note: The prconfig.xml file should contain one compiler node statement only. If the
file already contains a compiler node statement, add (append) your defaultPaths
value to the existing defaultPaths value. Do not create a second compiler node
statement.
6.
Examine the database settings. If the prconfig.xml file specifies a JDBC connection
pool as the method of connecting to the PegaRULES database (theres a value set
for the database/databases/PegaRULES/dataSource setting), either remove it or
comment it out. Then, remove the comments from the sample database entries that
indicate how to configure a JDBC URL to point at the PegaRULES database. Edit
their values so they are appropriate for your environment. For example:
7.
34
Go to http://ant.apache.org/
2.
Download and install Apache Ant version 1.5 or later. Be sure that you set the
ANT_HOME environment variable according to the Ant installation instructions.
In the client directory that you created, select and open the appropriate
PegaClaimSample script in a text editor.
2.
3.
4.
5.
6.
Verify that you have completed all the setup tasks in the Running the Sample
section.
2.
3.
4.
Run the PegaClaimSample batch or shell script, as appropriate. This file sets the
build session environment variables and then invokes the PegaClaimSample.xml
Ant script, which builds the client application.
5.
Open the PegaClaimSample batch file or shell script again. Comment out the
buildfile statement that invokes the BuildClaim method.
6.
Remove the comment from the buildfile statement that invokes the SubmitClaim
method.
7.
8.
Watch the console as the client application runs. When it is finished, the output
should be similar to the following:
35
36
Troubleshooting
If the JSR 94 client cannot successfully interact with your JSR 94 service, the problem
typically falls into one of the following categories:
The class path of the client application is missing a Java class needed by the
client, the PegaRULES engine instance, or the JSR 94 service rule. Examine the
output to determine the name of the class, locate the JAR file that contains the Java
class, and put the JAR in the class path.
The access privileges specified by the service rule do not give the client access to
the rules it needs to function properly. Examine the access group assigned to the
service package.
You did not create all the required components. Review Creating a JSR 94
Service (starting on page 14) and verify that you created all the necessary rules.
You are using clipboard pages improperly. Examine the following fields and tabs
to verify that the page names (and their class rules) are configured correctly:
Be aware that you cannot use the System Management application to monitor JSR 94
communications. To run rules, the JSR 94 client application starts a separate instance of
the PegaRULES engine it does not use the PegaRULES Process Commander Web
application. Therefore, you cannot use the tools in the PegaRULES Process Commander
Web application or the System Management application to troubleshoot your JSR 94
service. However, you can use the logging facility to gather information and you can unit
test the service rule. (For information about unit testing service rules, see Testing Services
and Connectors, which is posted on the PDN.)
37
com.pega.pegarules.services.jsr94
com.pega.pegarules.priv.services.jsr94
com.pega.pegarules.pub.services.jsr94
com.pega.pegarules.services.ServiceAPI
com.pega.pegarules.services.ServiceHelper
Use the information from Administration and Security to insert appropriate logging
category statements into the prlogging.xml file. Start by setting the log severity level for
the jsr94 packages to info. If you need more information, insert category statements for
the other packages and classes in the list.
Next, follow the instructions in Chapter 8 of Administration and Security that describe
how to install the remote logging feature on your workstation.
To enable remote logging for your JSR 94 service, code the JSR 94 client application to
specify where the service should send its status messages by providing values for the host
name of your computer (RemoteLogHost) and the port number on which it is listening
(RemoteLogPort).
For example:
// Set session properties
Map props = new HashMap();
//props.put("UserName", USERNAME);
//props.put("Password", PASSWORD);
props.put("RemoteLogHost", theServerName);
props.put("RemoteLogPort", 8887);
38
Now when you run the JSR 94 client application, the log4j socket server captures and
writes information about the JSR 94 services to the prlogging.xml file which is displayed
in the LogFactor5 window on your workstation
39
Create a JSR 94 service rule that uses the Code-.SystemPulse activity as its service
activity.
2.
Run the System Pulse service before making rules changes. (The System Pulse
works by determining which rules have changed since the last time it ran.
Therefore you must run it once to set a base level before you make changes to
rules that the JSR 94 application uses.)
3.
4.
5.
If you plan to run a System Pulse service regularly, start by running it no more than every
30 seconds, which is how frequently Process Commander runs the System Pulse by
default.