V6 b2038 Problem with SUBSTRING

If you think that something doesn't work in Aware IM post your message here
Post Reply
GertV
Posts: 112
Joined: Thu Sep 10, 2009 9:39 am
Location: Bangkok, Thailand
Contact:

V6 b2038 Problem with SUBSTRING

Post by GertV »

I am trying to extract information from a text field using SUBSTRING. The field length of the text is 680. In a process I used several SUBSTRING commands and this is the result of the log:

Executing action XMLMessages.A_id=SUBSTRING(XMLFeed.XML,0,680)
A_id=<?xmlversion="1.0"encoding="UTF-8"standalone="yes"?><messageListxmlns="http://v2.shared.globalstar.com"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://v2.shared.globalstar.comhttp://share.findmespot.com/shared/schema/spotXml-v2.xsd"><header><totalCount>1</totalCount><mode>LIVE</mode></header><message><id>395232825</id><esn>0-2495240</esn><esnName>Gen3Test</esnName><messageType>EXTREME-TRACK</messageType><messageDetail></messageDetail><timestamp>2015-05-18T15:44:08.000Z</timestamp><timeInGMTSecond>1431963848</timeInGMTSecond><latitude>-29.73441</latitude><longitude>31.07773</longitude><batteryState>GOOD</batteryState></message></messageList>

Here the complete field is taken.

Executing action XMLMessages.A_id=SUBSTRING(XMLFeed.XML,300,380)
A_id=mode>LIVE</mode></header><message><id>395232825</id><esn>0-2495240</esn><esnName

Here all information after esnName is missing.

Executing action XMLMessages.A_id=SUBSTRING(XMLFeed.XML,400,280)
-Exception while calculating the action XMLMessages.A_id=SUBSTRING(XMLFeed.XML,400,280)
-Exception while executing process S21_Process_XML_Record. Exception class=com.bas.basserver.executionengine.ExecutionException message java.lang.StringIndexOutOfBoundsException String index out of range: -120

Here comes an error.

It looks like when the starting point of the SUBSTRING is 300 or higher, the command doesn't work.

Anybody seen this or knows a solution? AwareIM could this be a bug?
Gert (running V8.0 build 2378 on Windows Server 2008)
Post Reply