Discussion

To call External Java code from PRPC?

Is there a way to call external java code from Java written in Acitivity with out using Connectors(ie Rule-Connec-Java,Rule-Connect-EJB)?

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

July 28, 2010 - 6:35am

Hi

Please read the following article, it has most of the information you need.

Using existing Java code — A comparison of design alternatives

Thanks and Regards
Indrajith

August 1, 2010 - 7:40am

The above topic explains how to access the methods of already existing standard interface PRAuthentication.

I want an example how to access methods of custom java class(developed by some user) with out using connectors ie Rule-Connect-Java.

I have a little knowledge of doing this that we need to import java class in some folders of tomcat and there by we can access the methods of that class. but i dont have complete information on end to end implementation. can you provide me an example and detailed steps to the possible extent.

August 2, 2010 - 12:31pm

1. Create the Jar file out of External custom Java code
2. Place the Jar file in your PEGA lib folder (App Server Lib or Application Lib - > /AppServer/installedApps/XXXserverNameXXX/XXXX.ear/APP-INF/lib
if it is ear file deployment.
3. Use normal java code and call the methods from your activity (JAVA step of activity)
4. Use full package name and call. For example
corp.nb.Policy newpolicy = new corp.nb.Policy()
String returnValue = newpolicy.method01();

** NO PEGA DEVELOPERS LIKE THIS METHOD SINCE WE HAVE TO CODE JAVA **
** BUT IF YOU DO NOT HAVE OTHER CHOICE, USE IT..IT IS SIMPLE **

July 24, 2014 - 7:14am

Hi Lingasamy,

Can you explain how can I import the jar file to the Pega? What we need to do to create PEGA lib folder, etc?

August 21, 2014 - 2:10pm

u no need to create the Pega Lib Folder. in the Path which Lingaswamy mentioned u need to place. Its Websphere Path, where pega is deployed.

Ex. In Tomcat "%Tomcat_Home%\WebApps\prweb\Web-INF\Lib\"

Similarly for websphere " /AppServer/installedApps/XXXserverNameXXX/XXXX.ear/APP-INF/lib"

July 29, 2016 - 4:23am

Is the process same even for the versions of Pega 6 and above. Please anyone clarify.

TIA