IBM Business Process Manager


Error in insertintoList script


Hi,
I have created a new string list variable and I am trying to populate it from another complex list variable parameter value. Basically the number of items in the variable may be different so I have created the following loop statement:
for (var i = 0; i < tw.local.NewRisks.length; i++) {
tw.local.NewRiskIDs.insertIntoList(i, tw.local.NewRisks[i].id);
}
Even when I remove the reference to the complex variable and put a string value I get the same error message:
However when I run it I get the following error message:
Instance name:
Link EUC to EMS:115
Instance error:
[<289message:Runtime error in script ("TypeError" 2:-1).TypeError: Cannot call method "insertIntoList" of undefined (<JSScript>#2) Script (line 2): 1 : for (var i = 0; i < tw.local.NewRisks.length; i++) {< B> 2 : tw.local.NewRiskIDs.insertIntoList(i, tw.local.NewRisks[i].id);</B> 3 : }>< 95flowObjectID:/25.632e8f48-cb15-4fec-9c87-e06ca7aee663//e9023951-1209-4bf1-8aad-88b712db9d9f/Step (User Task)>]
Snapshot ID:
dd00a9e6-340c-47e6-aa10-0ebfac7f104c
Error time stamp:
Sep 25, 2017 6:00 AM (12 hours ago)
Instance ID:
115
Task ID:
Any ideas what I am doing wrong here?
Did you initialize your list before the loop?
tw.local.NewRiskIDs = new tw.object.listOf.String();
String must not be initialized but listOf String must be.
Did you initialize your list before the loop?
tw.local.NewRiskIDs = new tw.object.listOf.String();
String must not be initialized but listOf String must be.
QuikJean
2700013C3V
‏2017-09-26T06:22:55Z
Did you initialize your list before the loop?
tw.local.NewRiskIDs = new tw.object.listOf.String();
String must not be initialized but listOf String must be.
More...
Thank you QuikJean that was it! Phew.
And if NewRisks is a BPM list then you should probably do that instead:
for (var i = 0; i < tw.local.NewRisks.listLength; i++) {

Related Links

Hiding / Showing section / coach views / fields based on selection of a checkbox
Calling IBM BPM coaches from other portals
href link is not working in process portal
REST calls failing when load balanced
Tabs control - Current Tab
Online Process Server not in Process Center
V8.0.1.1 - coach view refresh issue
Retrieving data variables from a Started Instance/Task BPM 8.0.1.1
[URGENT] "Available in Search" variables: how to delete one aliased variable from the…
List of ENV\'s through JS code
Is it Possible to Install IBM BPM 8.5 and ODM 8.5 in the same WAS?
Authorization in REST API calls
Sending Business Object as one of the input to the AJAX service
How to get swimlane documentation using rest api
Creating Coach Views Dynamically
rest call from a service

Categories

DW
IBM Security
Application Performanc...
BigFix
Cast Iron Community
ibm_ru
test
University
Globalization
IBM Connections Cloud ...
IBM OS Pattern Kit
Content Analytics
IBM Kenexa Talent Mana...
IBM Kenexa Hot Lava Mo...
Installation and Setup
Cloud assurance
IBM SmartCloud Applica...
IBM SmartCloud Applica...
Environmental and Ener...
Transportation Managem...
Collaboration Network
Cast Iron Web Manageme...
R Programmability in S...
IBM Analytic Catalyst ...
.NET Programmability
IBM SPSS Collaboration...
Cognos Express
Eventos en Latinoamérica
Development Tools (RAD...
Installing/Configuring...
grid
linux
aix
eserver
lotus
Test for satish
Greenhouse
Solaris to Linux Migra...
Telecommunications
Industry Network Forums
Pattern Modeling and A...
IBM LanguageWare Resou...
aW
IBM Storage Insights (...
Multicore enablement
Open Source
.NET Development with ...
Optim LUW
IBM Business Process M...
IBM WebSphere Transfor...
WebSphere eXtreme Scale
WebSphere Service Regi...
Tivoli Security Compli...
IBM Security Identity ...
Network Surveillance, ...
Reporting
Bottom of the BB
Developer Tools, Utilt...
Sterling Commerce Stuff
JSP Webpages in GIS
Gentran Server for Win...
IBM Control Center
Connect:Express z/OS
Connect:Express Windows
Selling System Release...
C3 Configurator
Application Best Pract...
Performance & Optimiza...
JavaServer Page & UI
Picking
Performance Tuning
WebSphere-Default Mess...
General BRMS Discussion
Gauges, Indicators and...
General Discussions
OLAP & Pivot Charts
Higher Education
Форумы ОС Linux
FAQ
IBM Image Construction...
Replication Monitoring...
IT architecture forum
IBM System Storage
Server-side Java progr...
Enterprise Application...

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile