Question

1
Replies
67
Views
YujiW777 Member since 2018 4 posts
EY Advisory & Consulting Co., Ltd.
Posted: April 15, 2019
Last activity: April 25, 2019
Closed
Solved

How to avoid errors raised by Java code which collecting RH_1 information

Hi All,

I need to track updates to Decision Tables etc., and created the following 2 Rules:

(1) Trigger that tracks saving to those Rule instances
(2) Logging Activity which is kicked by the Trigger above

Java code in (2) is below:

-----
PublicAPI tools = (PublicAPI) ThreadContainer.get().getPublicAPI();
// ClipboardPage stepPage = tools.getStepPage();
ClipboardPage clipboardValue = tools.findPage("RH_1");

// generate json from this template
com.pega.dsm.dnode.util.ClipboardPageJsonConverter converter = new com.pega.dsm.dnode.util.ClipboardPageJsonConverter(false);
converter.setPrettyPrint(true);
java.nio.ByteBuffer json = converter.asJson(clipboardValue);
String jsonString = new String(json.array());

// remove pxObjClass
jsonString = jsonString.replaceAll("\"pxObjClass\"\\s*?:\\s*?\".*?\",?\\s+", "");

content = jsonString;
-----

However, when these were Checked-In in the development environment, several problems(for example, as follows) occurred:

* It becomes impossible to import a language pack file. Import process will be not progress when the progress reaches 10%
* It becomes impossible to save rules such as Decision Table. Check-Out, Check-In, Save etc. raise errors
* When editing and saving parameters of "Property-Set" Method or "StringBuffer-Append" Method of Activities, a message is displayed that WrongModeException has occurred.
* Others ...

These bugs are not occured when commenting-out the Java source code in Method "Java", but I don't know what part is the problem, and how to solve it.

I would appreciate it if you could give me any advices.

Best Regards,

Low-Code App Development Dev/Designer Studio
Moderation Team has archived post
Share this page LinkedIn