Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Anonymous_User Absent Member.
Absent Member.
188 views

Quorum percentage


IDM 4.0.2 Patch D
Custom resource approval workflow.

I am having trouble specifying a quorum percentage using an ecma script
to retrieve the percentage from the resource object. The percent is
stored as an integer in an aux class attribute, nrfQuorumPercentage.
Here is my code:

var p = IDVault.get(flowdata.get('resDn').toString(), 'nrfResource',
'nrfQuorumPercentage');
var ps = p.toString();
Packages.java.lang.System.out.println('p: ' + ps());
var per = ps + "%";
Per

nrfQuorumPercentage is the integer value of 30.
p: never displays in the log.
The error is -

Workflow Error: Activity Id [Activity67]: Approver condition [var p =
IDVault.get(flowdata.get('resDn').toString(), 'nrfResource',
'nrfQuorumPercentage'); var ps = p.toString();
Packages.java.lang.System.out.println('p: ' + ps()); var per = ps + "%";
per] must evaluate to a number in the range from 1 to number of activity
addressees.

If I set the value to a constant of 30%, everything works.


--
ptown
------------------------------------------------------------------------
ptown's Profile: https://forums.netiq.com/member.php?userid=418
View this thread: https://forums.netiq.com/showthread.php?t=52657

Labels (1)
0 Likes
3 Replies
Anonymous_User Absent Member.
Absent Member.

Re: Quorum percentage


Packages.java.lang.System.out.println('p: ' + ps()); has been corrected
to:
Packages.java.lang.System.out.println('p: ' + ps);
The error is the same without the ().


--
ptown
------------------------------------------------------------------------
ptown's Profile: https://forums.netiq.com/member.php?userid=418
View this thread: https://forums.netiq.com/showthread.php?t=52657

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Quorum percentage

Haven't worked with reading/assigning quotes, yet.
But it seems the problem must be in the first two lines, if the println
never executes.

>> var p = IDVault.get(flowdata.get('resDn').toString(), 'nrfResource',

'nrfQuorumPercentage');
May fail if you haven't defined the DAL Entity correctly

>> var ps = p.toString();

May fail if p is undefined.

I'd try to make the logic more talkative to identify the issue. This may
make clearer, what the issue is

_________________________________

function setPercentage()
{
var result = undefined;
try {
var dn = IDVault.get(flowdata.get('resDn');
Packages.java.lang.System.out.println('dn: '+typeof(dn)+" - "+dn;
var p = IDVault.get( dn,'nrfResource','nrfQuorumPercentage');
Packages.java.lang.System.out.println('p: '+typeof(p)+" - "+p;
result = p + "%";
}
catch(ex) {
Packages.java.lang.System.out.println('ex: '+ex;
}
return( result );
}

setPercentage();
_________________________________



On 24.01.2015 01:54, ptown wrote:
>
> Packages.java.lang.System.out.println('p: ' + ps()); has been corrected
> to:
> Packages.java.lang.System.out.println('p: ' + ps);
> The error is the same without the ().
>
>

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Quorum percentage


Thanks for the nudge in the right direction. The attribute was not set
up correctly in the DAL. It was set to the default of string. As soon
as it was set to integer, it began to work.


--
ptown
------------------------------------------------------------------------
ptown's Profile: https://forums.netiq.com/member.php?userid=418
View this thread: https://forums.netiq.com/showthread.php?t=52657

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.