@@ -290,15 +290,17 @@ private TNodeTemplate getNodeTemplate(Message message, Csar csar, TRelationshipT
290
290
* @param operation The script service operation to check
291
291
*/
292
292
private void addOutputParametersToResultMap (final Map <String , String > resultMap , final Object result , final TOperation operation ) throws UnsupportedEncodingException {
293
+ LOG .debug ("Checking if operation has output parameters to update: {}" , operation .getName ());
293
294
final boolean hasOutputParams = operation .getOutputParameters () != null ;
294
295
if (!hasOutputParams ) {
296
+ LOG .debug ("No output parameters defined!" );
295
297
return ;
296
298
}
299
+ LOG .debug ("Adding output parameters to the response message." );
297
300
if (!(result instanceof HashMap <?, ?>)) {
298
301
LOG .warn ("Result of type {} not supported. The bus should return a HashMap as result class when it is used as input." , result .getClass ());
299
302
return ;
300
303
}
301
- LOG .debug ("Adding output parameters to the response message." );
302
304
final Map <?, ?> resultHashMap = (HashMap <?, ?>) result ;
303
305
304
306
// get ScriptResult part of the response which contains the parameters
@@ -317,11 +319,15 @@ private void addOutputParametersToResultMap(final Map<String, String> resultMap,
317
319
// split result in line breaks as every parameter is returned in a separate "echo" command
318
320
final String [] resultParameters = scriptResultString .split ("[\\ r\\ n]+" );
319
321
322
+ LOG .debug ("Searching for {} output parameters..." , operation .getOutputParameters ().size ());
320
323
// add each parameter that is defined in the operation and passed back
321
324
for (final TParameter outputParameter : operation .getOutputParameters ()) {
325
+ LOG .debug ("Searching for output parameter: {}" , outputParameter .getName ());
322
326
// we expect the outputparameters at the end of the result in multiple lines
327
+ LOG .debug ("Found {} lines in script result..." , resultParameters .length );
323
328
for (int i = resultParameters .length - 1 ; i >= 0 ; i --) {
324
329
if (resultParameters [i ].startsWith (outputParameter .getName ())) {
330
+ LOG .debug ("Found parameter with given name: {}" , outputParameter .getName ());
325
331
final String value = resultParameters [i ].substring (resultParameters [i ].indexOf ("=" ) + 1 );
326
332
327
333
LOG .debug ("Adding parameter {} with value: {}" , outputParameter , value );
0 commit comments