Situation: You want to make sure that only one instance of an integration flow is active at the same time (exclusivity). Any additional (incoming) message shall be refused (be it triggered by a sender or by a timer event)
Solution: Use the Datastore to make sure your iflow is executed only once at the same time:
import com.sap.gateway.ip.core.customdev.util.Message; import java.util.HashMap; def Message processData(Message message) { def messageLog = messageLogFactory.getMessageLog(message); def error = message.getHeaders().get("Error"); if(messageLog != null){ messageLog.addCustomHeaderProperty("Error", error); } return message; }
Monitoring