on 03-02-2018 12:23 AM
Hi Gaurav,
It's a warning. Please try to deploy the iflow and let us know if you are getting an error.
thanks and regards,
Praveen T
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
add "}" at the end of your script my friend.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gaurav,
Few issues that I noticed in your code:
Have a look into the adjusted code below:
def Message processData(Message message) {
def msgBodyOriginal = message.getBody(java.lang.String) as String
def msgBodyModified = msgBodyOriginal.replace('test', 'US')
message.setBody(msgBodyModified)
return message
}
Regards,
Vadim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I forgot to update you
I already added the closing bracket and still get different error
1 error , cause: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: script.groovy: 4: You defined a method without body. Try adding a body, or declare it abstract. at line: 4 column: 1. File: script.groovy @ line 4, column 1. public java.lang.Object getBody() ^
SCRIPT:
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
public java.lang.Object getBody() def Message processData(Message message){
//Body def body = Message.getBody(); message.setBody(body + "Body is modified");
def body_xml= Message.getBody(java.lang.String); def input_xml=body_xml.replace("test","US");
Message.setBody(input_xml);
return Message; }
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you checking it....
Below is the error
Processing exchange ID-vsa in bean[ref:scriptprocessor method:process]: StartTime = Fri Mar 02 03:56:18.031 UTC 2018 StopTime = Fri Mar 02 03:56:18.035 UTC 2018 ChildCount = 9 Error = javax.script.ScriptException:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: script.groovy: 18: expecting '}', found '' @ line 18, column 16. return message; ^ 1 error , cause: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: script.groovy: 18: expecting '}', found '' @ line 18, column 16. return message; ^
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.