Main changes and deprecated features (v5.3 > v5.7)

Main changes

Scripting adjustments for Progress

In TAS 5.7 we are working with users with the Display Name parameter. For this reason, it is also necessary to modify the scripts that plot the process progress on the Case Overview or on tasks (Progress). The scripts can be taken from the New Origin instance (if you have access) or contact support.

Adjustment in the behavior of hidden columns in the Dynamic Rows

Within the DR, a change was made so that by default the value of hidden columns is transferred when copying. The original behavior was that the value was not transferred.

Consultant check: Need to check if a blank value is not expected in the calculations in the hidden column.

The setting can be adjusted in the column definition for the DŘ using the "copy" parameter.

Using LoggedUserStore on dynamic conditions

In case of using LoggedUserStore and expecting userNickName in the returned object, the parameter has changed. Currently, from v5.7, instead of the userNickName parameter, use userName

 const LoggedUserStore = Require.stores.LoggedUserStore;

let {
roles,
// userNickName,
userName
} = LoggedUserStore.state;

Using LoggedUserStore is not the right approach, LoggedUserStore is not observable within development. If necessary, it is possible to complete functions that replace the use of LoggedUserStore.

Deprecated Functions

Due to the development of new technologies, it happens that some functions are no longer supported or are replaced by better and more secure functions. For these reasons, it is sometimes necessary to replace some functions and 100% backward compatibility cannot be maintained. Here are described the functions that need to be replaced when switching from version 5.3 to version 5.7. To find these functions in the environment, you can use one of the validation functions .

lib.dmsPdfFileToText

This function is no longer available, it has been replaced by the lib.pdfToText function.

The function currently returns all extracted content from the pdf. The consultant then has full control over the data and can use what he needs (e.g. metadata about the document).

Here is a sample example of how the function can be used to process a pdf stored in the contractCleanCopy variable:

 const extractTextFromPdfJson = (pdfToJsonContent) => {
const texts = [];
proc.warn("data", {
pdfToJsonContent
})
if (!pdfToJsonContent || !Array.isArray(pdfToJsonContent.Pages)) {
return texts;
}

for (let pageIndex = 0; pageIndex < pdfToJsonContent.Pages.length; pageIndex++) {
const page = pdfToJsonContent.Pages[pageIndex];
if (!page || !Array.isArray(page.Texts)) {
continue;
}

for (let textIndex = 0; textIndex < page.Texts.length; textIndex++) {
const textObj = page.Texts[textIndex];
if (!textObj || !Array.isArray(textObj.R)) {
continue;
}

for (let r = 0; r < textObj.R.length; r++) {
const textRun = textObj.R[r];
if (textRun && typeof textRun.T === 'string') {
try {
texts.push(decodeURIComponent(textRun.T));
} catch (e) {
proc.warn("Failed to decode text:", textRun.T, e);
}
}
}
}
}

return texts;
}

const pdfToText = lib.pdfToText(vars['contractCleanCopy'].getValue()[0])
const texts = extractTextFromPdfJson(pdfToText);
const fullText = texts.join('');

Alternatively, you can use the following script to process the content obtained using the lib.pdfToText function

 const transformPdfToJsonResponse = (input) => {
const pages = [];

input.Pages.forEach((page, i) => {
const words = [];

page.Texts?.forEach((text) => {
text.R?.forEach((row) => {
if (row.T) {
words.push(decodeURIComponent(row.T));
}
});
});

if (words.length) {
pages.push(`--- Page ${i + 1} ---\n${words.join("")}`);
}
});

return pages.join("\n\n");
}

Frantisek Brych Updated by Frantisek Brych

Lodash upgrade v4.17.x (>v5.5)

Using validation functions

Contact

Syca (opens in a new tab)

Powered by HelpDocs (opens in a new tab)