cancel
Showing results for 
Search instead for 
Did you mean: 

Error Mapping XI: String index out of range.

RJSA
Active Participant
0 Kudos

Hi Experts,

I have a problem with the mapping in XI. The transformation of data is very complex (see below) for field HBKID. I'm not having understanding the process of mapping is performed for the field HBKID. The creation of the transformation was performed using the graphical method for mapping in XI for this case. I think the person who created this data transformation didn't know that could be used USER DEFINED FUNCTION. Could you explain in more detail this MAPPING?

In the test displays the message: RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ns1:ZSD000TF01/ZVBAP/item[2]/HBKID.

The message is: Exception:java.lang.StringIndexOutOfBoundsException: String index out of range: 3]

Edited by: Rafael Sá on Feb 9, 2010 10:40 PM

Accepted Solutions (1)

Accepted Solutions (1)

RJSA
Active Participant
0 Kudos

Text Preview: HBKID=iF(const([value=]), stringEquals(const([value=]), /ns0:OrdemVenda_Leitura/row/CHAVE_BANCO=), iF(const([value=237BA]), stringEquals(/ns0:OrdemVenda_Leitura/row/MEIO_PGTO=, const([value=D])), iF(const([value=237DA]), stringEquals(/ns0:OrdemVenda_Leitura/row/MEIO_PGTO=, const([value=E])), iF(iF(const([value=AMEX]), stringEquals(/ns0:OrdemVenda_Leitura/row/TP_CARTAO_CREDITO=, const([value=AMEX])), iF(const([value=VISA]), stringEquals(/ns0:OrdemVenda_Leitura/row/TP_CARTAO_CREDITO=, const([value=VISA])), iF(const([value=CRED]), stringEquals(/ns0:OrdemVenda_Leitura/row/TP_CARTAO_CREDITO=, const([value=MC])), const([value=])))), stringEquals(/ns0:OrdemVenda_Leitura/row/MEIO_PGTO=, const([value=J])), iF(iF(const([value=001DB]), stringEquals(substring([start=0, count=3]/ns0:OrdemVenda_Leitura/row/CHAVE_BANCO=), const([value=001])), iF(const([value=033DB]), stringEquals(substring([start=0, count=3]/ns0:OrdemVenda_Leitura/row/CHAVE_BANCO=), const([value=033])), iF(const([value=151DB]), stringEquals(substring([start=0, count=3]/ns0:OrdemVenda_Leitura/row/CHAVE_BANCO=), const([value=151])), iF(const([value=237DB]), stringEquals(substring([start=0, count=3]/ns0:OrdemVenda_Leitura/row/CHAVE_BANCO=), const([value=237])), iF(const([value=341DB]), stringEquals(substring([start=0, count=3]/ns0:OrdemVenda_Leitura/row/CHAVE_BANCO=), const([value=341])), iF(const([value=347DB]), stringEquals(substring([start=0, count=3]/ns0:OrdemVenda_Leitura/row/CHAVE_BANCO=),const([value=347])), iF(const([value=356DB]), stringEquals(substring([start=0, count=3]/ns0:OrdemVenda_Leitura/row/CHAVE_BANCO=), const([value=356])), iF(const([value=409DB]), stringEquals(substring([start=0, count=3]/ns0:OrdemVenda_Leitura/row/CHAVE_BANCO=), const([value=409])), const([value=]))))))))), stringEquals(/ns0:OrdemVenda_Leitura/row/MEIO_PGTO=, const([value=W])), const([value=]))))))

Former Member
0 Kudos

I think the IndexOutOfRangeException is raised by one of your substring clauses, when value is smaller than expected (instead of specifying a fixed length, use a dymanic length calculation to make substring more flexible) ...

Rgds

Chris

Former Member
0 Kudos

Hi Rafael,

Please go to test tab and then paste the payload in source xml and then move to Design and go to the field which is giving out error.Check the display queue option for that particular field mapping.Check the input values and do recheck the desired output after each condition.I believe its an issue beacuse of an input value length.

Regards,

Nutan

RJSA
Active Participant
0 Kudos

Hi Experts,

So, I've done several tests on the tab of tests with various XML and I can't understand reason of the error in MAPPING.

I'll detail a little more the problem:

The processing of the interface is made by many items.

MAPPING ERROR:

When the interface processes a first item with the information below:

CHAVE_BANCO = EMPTY

MEIO_PGTO = D

TP_CARTAO_CREDITO = EMPTY

AND a second item with the information below:

CHAVE_BANCO = 314/3705

MEIO_PGTO = W

TP_CARTAO_CREDITO = EMPTY

The error occurs: The message is: Exception:java.lang.StringIndexOutOfBoundsException: String index out of range: 3]

MAPPING OK:

But when the processing is performed inversely, the MAPPING is done correctly.

When the interface processes a first item with the information below:

CHAVE_BANCO = 314/3705

MEIO_PGTO = W

TP_CARTAO_CREDITO = EMPTY

AND a second item with the information below:

CHAVE_BANCO = EMPTY

MEIO_PGTO = D

TP_CARTAO_CREDITO = EMPTY

I don't understand logic mapping for the field HBKID.

Former Member
0 Kudos

Try to debug step by step

/people/venkat.donela/blog/2005/06/09/introduction-to-queues-in-message-mapping

Edited by: Senthil Nattamai Sekar on Feb 10, 2010 10:36 PM

Former Member
0 Kudos

Rafael,

As I said, I'm almost sure this is raised by one of the substring clause when CHAVE_BANCO is empty (IOOR with length = 3, as stated in your mapping) ... Depending on how data are processed and all test conditions in your mapping, it could explain why it does not occur in case #2

Chris

Former Member
0 Kudos

Hi

Its a clearcut issue of substring. Remove the standard function and use this UDF( var1 being the source input string).

if (var1.length() > 0)
{
	String var2 = var1.substring(0,1);
	return var2;
}
else
{
return "";
}

Here if you have a string of desired length you will get teh desired output else you will get a blank value. You can change the return statement under ELSE as per your need. And under IF put the required values for trimming the string(substring function).

Hope it helps.

Regards

Soumen...

Answers (0)