Send Messages
Sending data to the next module(s) in a flow is easy, you just call the Next method. We continue the example from the step Receive Messages and all we need to do is to add the async keyword to the method and call Next instead of returning null.
private System.Random random;
protected override async Task MessageReceived(IFlowMessage message)
{
// Generate random value based on settings
var randomValue = this.random.Next(
this.Settings.TargetMin,
this.Settings.TargetMax);
// Add value to message using the configured property name
message.Set(this.Settings.TargetName, randomValue);
// Pass the message to the next module(s) in the flow
await this.Next(message);
}
This is the normal use case, but there are times when you want to pass data from other methods than MessageReceived. We will cover that later on.