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