Question
Virtusa
LK
Last activity: 16 Oct 2018 12:03 EDT
Writing java in a function and activity
How can I write java code in pega?.Is it different from normal java programming.If possible please give me a example scenario and What are the referencing materials regarding java programming in pega?
**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.
-
Likes (2)
Sumana Kundu Carlos Paniagua -
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
IN
Yes, it is already defined in Pega and you can use it as it is.
BUPA
AU
Sameera.
Java in Function:
Virtusa
LK
Is it possible for us to use another name instead of "tools" when calling a method in publicAPI?
Pegasystems Inc.
IN
You can write java code in Pega using activity java steps. And it's like normal java programming and there is no special/extra syntax involved. There are additional APIs available in Pega that can be utilized as well. Information about those APIs could be found in Pega Engine APIs menu.
Let us know if this helps or you need more information on this :)
Virtusa
LK
thank you,
1. I got a clear understanding of writing java in a function rule but I still need a assistance to write java in a activity "java" method,I tried it gives me a error.I want to call a function in the java activity method.
2. How can I access clipboard pages using java?
-
Suman Kumar Karamalaputi
Pegasystems Inc.
IN
Below is the syntax of calling a function from activity java step :
pega_rules_utilities.findInPageList
Where Pega-Rules is the ruleset where the function is and Utilities is the library name. You need to replace hyphen in ruleset name by underscore and append library name.
And syntax for finding clipboard page is tools.findPage("pageName")
Best way to learn about these APIs is to write the normal activity step (e.x. calling a function) and then check Generated java.
Let us know if this helps :)
And could i also know the reason for writing java step? Just asking if we can provide an better alternative.
Virtusa
LK
Actually I don't have a exact need of writing java.I am writing java just to get an Idea.What is actually "tools" means, is it a class? I looked in the java API in help also and I couldn't find it.
Pegasystems Inc.
IN
tools here refer to object of PublicAPI class.
-
Akhil Maddu
Virtusa
LK
That means tool is an already built in object?.Can you please tell me how can I access the PublicAPI and it's method in PRPC 7.2.2?
Pegasystems Inc.
IN
You can simply refer to tools. to access all methods of PublicAPI. Are you facing any issues in that ?
Virtusa
LK
Thank you for the guidance,
Found the exact location where I can access public API.Can we use any other name instead of "tools",if cannot is it means tools object is already build in pega and we just have to use it?
Accepted Solution
Pegasystems Inc.
IN
Yes, it is already defined in Pega and you can use it as it is.
Virtusa
LK
thank you very much for the help given
Pegasystems Inc.
IN
In case you are asking for documentation of this API. It's available in Engine API menu from top right corner in Pega.
Pegasystems Inc.
IN
Below is the syntax of calling a function from activity java step :
pega_rules_utilities.findInPageList
Where Pega-Rules is the ruleset where the function is and Utilities is the library name. You need to replace hyphen in ruleset name by underscore and append library name.
And syntax for finding clipboard page is tools.findPage("pageName")
Best way to learn about these APIs is to write the normal activity step (e.x. calling a function) and then check Generated java.
Let us know if this helps :)
And could i also know the reason for writing java step? Just asking if we can provide an better alternative.