How do you control the “Leftmost” upstream in the JOIN task of a Vantiq App?

In a JOIN task, I understand that the frequency of the “leftmost” upstream determines the frequency of the output stream.

How does it determine which one is the leftmost stream? Can this be explicitly controlled by the developer?

In the below example, it seems that WindStream is the leftmost one.Upstream Example

 

 

 

 

 

 

In the documentation I found the following discussion on this subject:
https://dev.vantiq.co.jp/docs/system/apps/index.html#join

An important note about joins is the order of the upstream tasks matters. The leftmost stream above the join determines the maximum frequency with which joins can be made. The output from a join task is unique for each unique event from the leftmost parent task. If the leftmost parent of the join produces events once every 10 seconds, the join will emit events at most once every 10 seconds, regardless of the frequency of the other parent tasks.

Posted: December 2, 2020 at 11:03 pm
Replies: 3
Dec 2, 2020
Posted by Ken

Let me try and clarify the behavior of the Join App Activity Pattern:

  • The left to right order shown in the App Builder will match the left to right order used by the server to process events (in your case: WindStream, HumidityStream, TempStream).
  • Tasks are implicitly ordered left to right in the order they were created. The order in your picture implies you created the tasks in the order WindStream, HumidityStream, TempStream.
  • If you delete and recreate a task it will become the right-most task when it is recreated. You could delete WindStream, recreate WindStream, and the order would then be HumidityStream, TempStream, WindStream.

There is not a direct way to re-order the tasks in the App Builder without deleting and recreating tasks. That being said, there is a similar reordering feature in the collaboration builder, so it would make sense to add something similar in the App Builder. It turns out Join is the only task in the App Builder where ordering matters, whereas it’s very important in the Collaboration Builder.

May 3, 2021
Posted by Patrick Burma

The order determines the maximum output but you can also use the duration to set the withinDuration optional value to make sure you get one recent event from all three sources. If the incoming event stream is at 5, 10 and 15 seconds you can set the withinDuration to 15 seconds to produce an outbound event that will have the most recent 5 and 10 second events tied to the 15 second event.

This probably makes more sense as it keeps the readings in context. Otherwise your application should take into account that you will  have 5 second readings paired with the old 10 and 15 second readings and you will only have an up-to-date reading from all three sources once every 3 events.

Dec 19, 2022
Posted by Roger Blumer

In version 1.35, the Join activity pattern has a new joinOrder configuration property to allow the Join order to be set dynamically.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
© Vantiq 2024 All rights reserved  •  Vantiq Corporation’s Privacy Policy and Cookie Policy