Question

Dynamic Filter

  • 30 November 2022
  • 7 replies
  • 22 views

Badge +3

Hello there

we have the geo-location of the car and we do have multiple users

we need to create a notification based on the geofence value set by each user,

The car location is streamed in reel time, we don't know in advance the number of users

is there any way we could create a dynamic filter that will notify the users based on their setting

to be more specific

user 1: notified when the car is within 500 m

user 2: notified when the car is within 1km

....

the only problem we have is we don't know in advance the user and the value of the geofence

could we send those values to the filter as for example JSON ??

Thanks


7 replies

Badge +10

Hi @boubcher​ ,

 

We have this Demo that I think might be a good example for you. It showcases how you can take in different real-time feeds, and could be easily adapted to use a buffer, filter, and then trigger an email. Depending on your workflow if it's a stream you could have a workspace continually process the stream and have the buffer "group by" a window so it outputs after each new input.

Badge +3

Hi @boubcher​ ,

 

We have this Demo that I think might be a good example for you. It showcases how you can take in different real-time feeds, and could be easily adapted to use a buffer, filter, and then trigger an email. Depending on your workflow if it's a stream you could have a workspace continually process the stream and have the buffer "group by" a window so it outputs after each new input.

@richardatsafe​ 

Thanks for your response

its working fine as described in the demo, the problem I have is we don't know the filter we should apply in advance, we need to read the filter parameter from another table and process the data, and to add more complexity we need to do that for each user since each one has a different filter setting

I think we should create a loop, but I don't see how to create a dynamic Filter

Thanks

 

Badge +10

@richardatsafe​ 

Thanks for your response

its working fine as described in the demo, the problem I have is we don't know the filter we should apply in advance, we need to read the filter parameter from another table and process the data, and to add more complexity we need to do that for each user since each one has a different filter setting

I think we should create a loop, but I don't see how to create a dynamic Filter

Thanks

 

I'm not sure I fully grasp the scenario, but with the buffer, you can add dynamically created attributes into a buffer or filter parameters. As long as the name of an attribute is constant the dynamic values can change. So feature A (user A) could have a geometry of X and a filter of X and the next feature could have a completely different geometry and filters.

Badge +3

@richardatsafe​ 

Thanks for your response

its working fine as described in the demo, the problem I have is we don't know the filter we should apply in advance, we need to read the filter parameter from another table and process the data, and to add more complexity we need to do that for each user since each one has a different filter setting

I think we should create a loop, but I don't see how to create a dynamic Filter

Thanks

 

@richardatsafe​ 

Thanks for your replay

let me explain the use case

we are getting a streaming message of trucks' positions and their loads

we do have in the control room different inspectors, getting notifications based on their own filter parameter

let say:

user 1 : needs to be notified when each truck gets into zone 1 and its load is over 30 tones

user 2 : neet to be notified when each truck load is below 20 tones

and so on, each user could create a different filter

we could store those conditions in a database.

When we get the data from the stream we need to test it for all sets of conditions stored in the database and then send a notification to each appropriate user

this data is coming in reel time and from a lot of trucks

 

Its similar to have testfilter transformer but the conditions are based on dynamic reading from another source, and each time data gets into the flow it will be passed through the dynamic testfilter

 

we are looking to use FME to build this case.

 

 

Badge +10

@richardatsafe​ 

Thanks for your response

its working fine as described in the demo, the problem I have is we don't know the filter we should apply in advance, we need to read the filter parameter from another table and process the data, and to add more complexity we need to do that for each user since each one has a different filter setting

I think we should create a loop, but I don't see how to create a dynamic Filter

Thanks

 

Hi @boubcher​ ,

 

I think you should be able to do this fine with the help of a stream window to evaluate each time block assuming that the conditions are being passed in or at least a reference id that can be used to retrieve the conditions from a database.

Badge +3

@richardatsafe​ 

Thanks for your response

its working fine as described in the demo, the problem I have is we don't know the filter we should apply in advance, we need to read the filter parameter from another table and process the data, and to add more complexity we need to do that for each user since each one has a different filter setting

I think we should create a loop, but I don't see how to create a dynamic Filter

Thanks

 

@richardatsafe​ 

totally agree, and this is what we are using, the issue now is how we could apply this condition to the seemed features, do we use a test filter ??

if we do that we need to pass those conditions to the attribute and then test against the value of this attribute using the text editor, ??

Badge +10

@richardatsafe​ 

Thanks for your response

its working fine as described in the demo, the problem I have is we don't know the filter we should apply in advance, we need to read the filter parameter from another table and process the data, and to add more complexity we need to do that for each user since each one has a different filter setting

I think we should create a loop, but I don't see how to create a dynamic Filter

Thanks

 

Yes, the testFitler could be a good way to filter things like weight. You could make use of the VariableSetter and VariableRetriever instead of a merge. In most cases, you do not need to loop in FME, but it's possible a custom transformer that loops with a group by parameter may be helpful.

Reply