Hi All,
I have a requriement in CPI mapping where the value of the field1 and field 2 from the source need to be concatenated and then the length of the field1 is checked , if the length is greater than 20 characters then the first 20 characters need to be sent to the field1 on the target side and rest of the characters need to be sent to the second field on the target side. Kindly help me with the script code for this.
Request clarification before answering.
probably you are talking about mapping issue, on Message mapping you can create the logic, or just send 2 fields on groovy custom function and use the result.
def String exampleValue(String field1, String field2, Output first20, Output restOfus) {
//Your code here
def result = field1+field2;
if (result.length() > 20)
first20 = result.substring(0,20)
resfOfus = result.substring(20,result.length())
return result;
}
//def result = exampleValue("field1_string_example_VERYVERYVERYVERYVERYVERYLONG","field2_string_example")
//println(result)
//println(result.length())I'm not sure about code, is it late night here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rakesh,
if you can provide more information or sample message(XML, CSV, Json) with header and properties, I can try to help you.
Thanks,
Burak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.