cancel
Showing results for 
Search instead for 
Did you mean: 

How to model and access a processcontext with a table?

TimoRenz
Participant
0 Kudos

Hello,

we are new to BPM and therefore we have the following question:

How should we setup a processcontect when we would like to have a table within the processcontect?

I defined a complex type within the XSD file and set the multiplicity to 1..*. So i can define more fields within the complex type and for me my processcontext looks like a table.

In one of the next steps i tried to compare one field of the table with index 1 with another value and access the field with the expression string-equals(get(ProcessContext/ComplexType/Field), 1), value) and then the process get`s the following error.

Extraction failed java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
com.sap.mapping.lib.execution.api.exception.TExecutionException at
GenericGet( StandardInvocation:invoker )
at ( DeepExpression ) at left(TerminalPart:expression ) at ( BroadMapping )
at TextSame( StandardInvocation:invoker )
at ( DeepExpression ) For more details,
decrease severity of log controller as described in SAP Note 1753560.

But in the NetWeaver Administrator "Processadministration" i can see that i have two entries in the ProcessContext/ComplexType. Why is the size 0 instead i can see two entries in the NetWeaver administrator?

Best regards,

Timo Renz

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Timo,

with the xPath expression ProcessContext/ComplexType/Field you're referencing the field, not the Complex Type. The get function the tries to get the first entry of the field not the Complex Type.

Try to do this:

get(ProcessContext/ComplexType, 1)/Field

This should retrive the ComplexType with index 1 and access the Element Field in the Complex Type.

Best regards,

Frank

TimoRenz
Participant
0 Kudos

Hello Frank,

thanks for you answer.

I tried the expression (get(ProcessContext/ComplexType, 1)/Field) you mentioned but then the message appears: "Single value is expected while you provided an element that is a list. Tip: Use expression to get a single from the values in the list."

Excluded the "Generic" folder there are no expressions available to handle tables or?

Thanks and best regards,

Timo

former_member191643
Active Contributor
0 Kudos

Hi Timo,

Instead of using the function "string-equals()", try using the function "matches()" to compare string values.

Just a suggestion.

Frank is right, it will compare with the first value first so, if it is not the same, the function string-equals() will give you a boolean output.

try doing this and let me know if it works.

/Sid

TimoRenz
Participant
0 Kudos

Hi Frank,

the first try this morning didn`t work but later again i tried it again and no error message appears. I check the process and now it is working as we would like to have it. Thanks a lot!

Thanks to you both for the reply to my answer.

Timo

Answers (0)