How to collect informations of a POST request ? (output connector)

1
0
-1

Hi

I have POST requests in my output connectors
The first : it works but one field of my API is ID and is auto-increment

How to use it in my second POST request in my second output connector ?

I tried to create a variable : sortie (java.lang.string) : it receives :

import java.util.logging.Logger;
Logger logger = Logger.getLogger("org.bonitasoft");
logger.severe(bodyAsString.split('"')[2].split(':')[1].split(',')[0]);
return logger

Ok I can see my ID in Log Bonita Engine but I can't use the variable sortie in the next output connector.

Thank You

1 answer

1
0
-1

Hello - I would create a variable in the scope of the task (local) and edit its value in the output operations of your first connector. The second connector should be able to use this variable with the updated value because the connectors are executed in definition order.

BTW, not sure why but it seems that you do return the logger in your code I think you want to return the extracted value instead.

Cheers,

Notifications