Anonymous_User Absent Member.
Absent Member.
421 views

UserApp - Workflow - Script error evaluating expression


Hi,

I get this error "Script error evaluating expression" in the log.

How do you get the system to log where in the script the error lies?

Your help would be appreciated.

Thanks,
Bruno

11:30:40,532 INFO [STDOUT] WARN [RBPM]
[com.novell.soa.af.impl.core.WorkflowNotification:evaluateMappings]
Script error evaluating expression [//We don't use the current
LM as this may have changed during the course of the workflow if the
person has no LM assigned
function getNotifyArrayList(){
var manager = IDVault.get(recipient , 'frgoUser',
'frgaReportsToAuthManager');
System.out.println("\n" + "Recipient: " + recipient + "\n" +
"Recipient's manager: " + manager + "\n" + "real: " + recipient);
var managerDN = IDVault.globalQuery("query_newfrgoUser",
{"firstName":"*" + "*", "lastName":"*" + "*", "loginDisabled":"FALSE",
"fNumber":manager, "companyCode":"*", "costCentreCode":"*",
"division":"*"});
System.out.println("\n" + "manager dn: " + managerDN + "\n" +
"type: " + typeof managerDN + "\n" + "size: " + managerDN.size());
if( managerDN.size() > 0 ) {
try {
System.out.println("\n" + "Manager Approval
Notification : " + "Manager Email: " + IDVault.get( managerDN.get(0) ,
'user', 'Email') );
System.out.println("\n" + "Manager Approval
Notification : " + "Recipient Email: " +
IDVault.get(flowdata.get('recipient'), 'user', 'Email') );
return IDVault.get( managerDN.get(0) , 'user',
'Email') + "||" + IDVault.get(flowdata.get('recipient'), 'user',
'Email');

} catch (e) {
System.out.println("\n Exception " + e);
}
} else {
System.out.println("\n" + "Manager Approval Notification
: " + "Recipient Email: " + IDVault.get(flowdata.get('recipient'),
'user', 'Email') );
return IDVault.get(flowdata.get('recipient'), 'user',
'Email');
}
};
getNotifyArrayList();] .
11:30:40,632 INFO [STDOUT] INFO [RBPM]
[com.novell.soa.af.impl.LogEvent:logAFEvent] [Workflow_Forwarded]
Initiated by System, Process ID: 42860f6ed2e14d0bbbe621a369da6488,
Process Name: cn=Approval
Model,cn=RequestDefs,cn=AppConfig,cn=UserApplication,cn=DriverSet1,ou=services,o=frg:261,
Activity: access_approved, Recipient:
cn=062f0bbc-d8fe-435c-8359-b32708ab3ee2,ou=Users,ou=Tanzania,ou=BusinessGroups,o=frg

UserApp - Workflow - Script error evaluating expression


--
bzanin
------------------------------------------------------------------------
bzanin's Profile: https://forums.netiq.com/member.php?userid=9162
View this thread: https://forums.netiq.com/showthread.php?t=53423

Labels (1)
0 Likes
1 Reply
Highlighted
wschreiber1 Absent Member.
Absent Member.

Re: UserApp - Workflow - Script error evaluating expression

Often the cause of the problem is shown in the log lines right before
the messages that you posted.

You may also want to reduce assumptions in your code - like
IDVault.get() will always return a valid manager, or
IDVault.globalQuery() returning a valid result vector.

Add conditional logic to avoid a call to managerDN.size() where
managerDN is null.

Something like

if (managerDN && (managerDN.size() > 0)) {
System.out.println("\n" + "manager dn: " ...

Then, runtime error, the function doesn't always return a value (1st
catch clause)


Side note: the construct of "*" + "*" in your query is valid syntax but odd.

Good luck
Wolfgang


On 04.05.2015 12:47, bzanin wrote:
>
> Hi,
>
> I get this error "Script error evaluating expression" in the log.
>
> How do you get the system to log where in the script the error lies?
>
> Your help would be appreciated.
>
> Thanks,
> Bruno
>
> 11:30:40,532 INFO [STDOUT] WARN [RBPM]
> [com.novell.soa.af.impl.core.WorkflowNotification:evaluateMappings]
> Script error evaluating expression
[//We don't use the current
> LM as this may have changed during the course of the workflow if the
> person has no LM assigned
> function getNotifyArrayList(){
> var manager = IDVault.get(recipient , 'frgoUser',
> 'frgaReportsToAuthManager');
> System.out.println("\n" + "Recipient: " + recipient + "\n" +
> "Recipient's manager: " + manager + "\n" + "real: " + recipient);
> var managerDN = IDVault.globalQuery("query_newfrgoUser",
> {"firstName":"*" + "*", "lastName":"*" + "*", "loginDisabled":"FALSE",
> "fNumber":manager, "companyCode":"*", "costCentreCode":"*",
> "division":"*"});
> System.out.println("\n" + "manager dn: " + managerDN + "\n" +
> "type: " + typeof managerDN + "\n" + "size: " + managerDN.size());
> if( managerDN.size() > 0 ) {
> try {
> System.out.println("\n" + "Manager Approval
> Notification : " + "Manager Email: " + IDVault.get( managerDN.get(0) ,
> 'user', 'Email') );
> System.out.println("\n" + "Manager Approval
> Notification : " + "Recipient Email: " +
> IDVault.get(flowdata.get('recipient'), 'user', 'Email') );
> return IDVault.get( managerDN.get(0) , 'user',
> 'Email') + "||" + IDVault.get(flowdata.get('recipient'), 'user',
> 'Email');
>
> } catch (e) {
> System.out.println("\n Exception " + e);
> }
> } else {
> System.out.println("\n" + "Manager Approval Notification
> : " + "Recipient Email: " + IDVault.get(flowdata.get('recipient'),
> 'user', 'Email') );
> return IDVault.get(flowdata.get('recipient'), 'user',
> 'Email');
> }
> };
> getNotifyArrayList();] .
> 11:30:40,632 INFO [STDOUT] INFO [RBPM]
> [com.novell.soa.af.impl.LogEvent:logAFEvent] [Workflow_Forwarded]
> Initiated by System, Process ID: 42860f6ed2e14d0bbbe621a369da6488,
> Process Name: cn=Approval
> Model,cn=RequestDefs,cn=AppConfig,cn=UserApplication,cn=DriverSet1,ou=services,o=frg:261,
> Activity: access_approved, Recipient:
> cn=062f0bbc-d8fe-435c-8359-b32708ab3ee2,ou=Users,ou=Tanzania,ou=BusinessGroups,o=frg
>
> UserApp - Workflow - Script error evaluating expression
>
>
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.