Author Message
AshokJ
Joined: Oct 12, 2017
Messages: 8
Offline
In the Log message box in using ED, can you use it to print variables like ucid, handles etc? I need it to know that what is ED retrieving from a DB. I am using a simple query like:

select name from whitelist where number=? --> Whitelist table just a simple number, Name columns

In the ED flow Read from DB task i have:

----Mapped the number vairable to the incoming handle from call events and retrieved input schema.

----Output schema shows ResultSet (Multiple Objects) & Name: String. O/P is sotred in variable ReadFromDB1_Output_1

I have then used below condition on a gateway to allow a call

------ReadFromDB1_Output_1["resultSet"][0]["Name"] == "Y"

I expect Y as the parameter retrieved from the DB in the resultset. And for simplicity i have ensured only entry for each number. So i am testing and expecting a Y to be returned when i make a call (as that number is there is DB with Name parameter as Y against it).

However i get errors.

java.lang.RuntimeException: Could not access element 0 of array
java.lang.RuntimeException: Could not access element 0 of array
com.roobroo.bpm.exceptions.InstanceCreatedWithErrorException: Could not access element 0 of array

Any idea where an i going wrong? I tested with array element 1 as well but to no avail.


AnuragAggarwal
Joined: Jun 1, 2014
Messages: 154
Offline
Hi Ahsok, can you please go to admin console and find your instance and click on db task, it would open a window showing what are the inputs and outputs of db task, can you please provide that information
AshokJ
Joined: Oct 12, 2017
Messages: 8
Offline
Thanks Anurag. I fixed this problem, i did not handle the problem of the resultset being returned empty.

However, i am still looking for info in the log message we can print the variable values? I currently think it allows only to print fixed statements, but i might be wrong. Looking for ways in which the log messages can print variable values?
AnuragAggarwal
Joined: Jun 1, 2014
Messages: 154
Offline
you can go to input mapping in log message and do the mapping to log message input (from varaible value), then that varaible value would be shown in logs
MarcusHuang
Joined: Feb 25, 2014
Messages: 157
Offline
Hi,

I am having this same issue, how do you get past this issue?

I have a DB that returns a resultset. If it returns data, it will return at [0], but if the query returns nothing, the result set looks like the following {'resultSet':[]}. After this DB lookup i have an exclusive gateway with 2 conditions, 1 for default, the 2nd if there is data return at [0]. How do i handle the condition when there is no data in the array? I keep getting this when the DB returns no data

Could not access element 0 of array
AnuragAggarwal
Joined: Jun 1, 2014
Messages: 154
Offline
you can in gateway check for length of array if it is zero or not
Go to:   
Mobile view