douglasbarbosa Absent Member.
Absent Member.
483 views

User's Request History are not displaying correctly

Our customer asked us to display at the Requests History a concatenated version at the workflow name, using the Request’s name first then the role name, all text localized depending on the default user’s language configuration.

We did as ordered at the Workflow’s Start Item - using the Resource Name Override functionality, changing the button to use the Ecma Script version - and the concatenated text was correctly being displayed in the user’s requests history.

However some time later (3 weeks, as an example) the request’s history usually starts to show the code initial texts (like “function roleDN(){…, etc”) and we can’t see the history display anymore.

Looking for clues searching at the code, logics work well and the code is working as expected, since the first time as we start a new request, but always presents that anomaly after some time.

I’ll post the code below, but our logic is mostly simple:

1. Try to find the source of the input (User Application or Driver)
2. Depending on the source, we search for the Request Object (at eDirectory) in the nrfSourceDN attribute looking for the role’s DN.
3. Use the role’s DN to compose a query for the role’s localized name
4. Return the concatenated result to Override the Resource Name

The problem seems to be that the Request Object has been removed after some time (3 weeks) and maybe this should be compromising all code results.

Do you have any idea of what or how we could use our Request’s Name approach?
Be welcome to contest the scenario, if you want.

We’ll really appreciate if you could help, anyway.


Below - the code:
function roleDN(){
try{ return IDVault.get(flowdata.get('nrfRequest/DN').toString(), 'nrfRequest', 'nrfSourceDN').toString();}
catch(er) { return flowdata.get('nrfRequest/DN');}
}

function getTitleName(place){
if (place == "pt"){
return "Solicitação de Acesso";
} else if (place == "es"){
return "Solicitud de acceso";
} else if (place == "de"){
return "Zugriff auf die Berechtigungsanforderung";
}
return "Access Request";
}

function getWFName(place){
var role = roleDN();
var nomeRole = IDVault.get(role, 'Roles', 'nrfLocalizedNames').toString();

var nomeRoleLocal = "";
if (place == "pt"){
nomeRoleLocal = nomeRole.replace( /.*pt~([^|]*).*/ig,'$1');
} else if (place == "es"){
nomeRoleLocal = nomeRole.replace( /.*es~([^|]*).*/ig,'$1');
} else if (place == "de"){
nomeRoleLocal = nomeRole.replace( /.*de~([^|]*).*/ig,'$1');
}

if (nomeRoleLocal == "" || nomeRoleLocal == nomeRole) {
nomeRoleLocal = nomeRole.replace( /.*en~([^|]*).*/ig,'$1');
}

if (nomeRoleLocal == "" || nomeRoleLocal == nomeRole) {
nomeRoleLocal = nomeRole;
}
return nomeRoleLocal;
}

function getName(place){
return getTitleName(place) + " - " + getWFName(place);
}

//getName("pt");
//getName("es");
//getName("de");
getName("en");








Cheers,


Douglas Barbosa
Labels (1)
0 Likes
2 Replies
Micro Focus Expert
Micro Focus Expert

Re: User's Request History are not displaying correctly

Hi,

> The problem seems to be that the Request Object has been removed after
> some time (3 weeks) and maybe this should be compromising all code
> results.


The cleanup-req-after-days option on the Role and Resource driver
controls the "Number of days before removing processed request objects".
By default it is 7 days. Seems you already have increased it.

> 1. Try to find the source of the input (User Application or Driver)
> 2. Depending on the source, we search for the Request Object (at
> eDirectory) in the nrfSourceDN attribute looking for the role�s DN.


This step will fail if the request object has been cleaned up. In your
try/catch block, you return the DN of the (deleted) request object
instead of the role's DN in this case.

> 3. Use the role�s DN to compose a query for the role�s localized name
> 4. Return the concatenated result to Override the Resource Name



--
Norbert
0 Likes
douglasbarbosa Absent Member.
Absent Member.

Re: User's Request History are not displaying correctly

klasen;2469955 wrote:
Hi,

> The problem seems to be that the Request Object has been removed after
> some time (3 weeks) and maybe this should be compromising all code
> results.

The cleanup-req-after-days option on the Role and Resource driver
controls the "Number of days before removing processed request objects".
By default it is 7 days. Seems you already have increased it.


That was my mistake - configuration remains the same (7 days - not 3 weeks), but we'll try to change the value to a similar one as is in "Completed Process Timeout" at User Application, in a way that it should fit.


> 1. Try to find the source of the input (User Application or Driver)
> 2. Depending on the source, we search for the Request Object (at
> eDirectory) in the nrfSourceDN attribute looking for the role�s DN.

This step will fail if the request object has been cleaned up. In your
try/catch block, you return the DN of the (deleted) request object
instead of the role's DN in this case.


> 3. Use the role�s DN to compose a query for the role�s localized name
> 4. Return the concatenated result to Override the Resource Name


OK, understood.

--
Norbert



We will try some configuration changes, at the environment, and see what happens before that. I will share the results here.
Thank you again for your help.

- Douglas
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.