Discussion
Ernst & Young LLP
MT
Last activity: 3 Jan 2023 19:09 EST
Page Change Class - Data Transform
Unlike Activity rule, Data transform doesn't have anything equivalent of 'Page-Change-Class' method.
Moreover, if you use a Set action against a page type property (e.g. pyWorkPage.CustomerData) to change its class, it will clear/reset the existing content of the page while changing the page class.
In absence of any appropriate OOTB function or API activity rule to achieve this from a Data transform, you may create a simple function rule with two input parameters -
- PageName (String)
- NewClassName (String)
boolean isSuccess = false;
PublicAPI tools = ThreadContainer.get().getPublicAPI();
ClipboardPage targetPage = tools.findPage(PageName, true);
if (targetPage != null) {
ClipboardPage tempPage = tools.createPage(NewClassName, "");
targetPage.putAll(tempPage, ClipboardPage.PUTALL_KEEPNEW);
isSuccess = tools.getDictionary().validate(targetPage, false);
}
return isSuccess;
This function can be used to change class of both Top level and embedded pages without losing existing data on such pages.
Thanks