Anonymous_User

Absent Member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2015-01-24
00:14
213 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
3 Replies
Anonymous_User

Absent Member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2015-01-24
00:54
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
Anonymous_User

Absent Member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2015-01-24
10:12
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 ().
>
>
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 ().
>
>
Anonymous_User

Absent Member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2015-01-27
22:24
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