clarity-h2020 / csis-helpers-module

CSIS Helpers Drupal Module
GNU General Public License v3.0
1 stars 0 forks source link

Transport Module (TM) trigger specifications #19

Closed patrickkaleta closed 4 years ago

patrickkaleta commented 4 years ago

Subtask of this issue.

In order for the TM to be able to generate study-relevant output, CSIS needs to trigger the TM and sent the necessary information for the relevant Studies.

We already have something similar for another external service (Emikat), where we use REST for the communication (issue, relevant code).

@rapto: Angela told me that you would be to right person to talk to. Can you check our trigger approach for Emikat and tell me if we could do something similar for the TM?

If so, we would have to think about the following things:

1) Which Studies are considered to be relevant for the TM? -> should be just Studies of StudyType = Transport Infrastructure 2) When and with what data should we trigger the TM? -> CSIS allows users to fill their studies bit by bit. So right after it is created, it doesn't yet contain all the needed data, so it might make sense to wait a bit before we actually trigger the TM. 3) What shall we do when users change relevant parts of the Study? -> for Emikat, in such cases we trigger it again with the updated data and start a re-calculation 4) How will the CSIS know once results are available? -> for Emikat, we periodically pull the current status. But it would also be possible (maybe the better solution?) if the TM would make a REST call and update the status of the calculations 5) Which ID to use as primary identification for communication? (e.g. when requesting a map from the TM) -> for the CSIS (Drupal system) it would be easier if we could use our internal IDs and pass them along in our requests.

patrickkaleta commented 4 years ago

@ghilbrae adding you to this issue to keep you in the loop about the status.

rapto commented 4 years ago

Hello there, I'll try to answer.

  1. Which Studies are considered to be relevant for the TM? -> should be just Studies of StudyType = Transport Infrastructure

That is correct, only TI.

  1. When and with what data should we trigger the TM? -> CSIS allows users to fill their studies bit by bit. So right after it is created, it doesn't yet contain all the needed data, so it might make sense to wait a bit before we actually trigger the TM.

The study can be triggered as soon as created. The only information that willbe kept in both systems will be the bare minimum: Title and short description.

  1. What shall we do when users change relevant parts of the Study? -> for Emikat, in such cases we trigger it again with the updated data and start a re-calculation

Should the title or description change, it would be required to sync in the TM.

  1. How will the CSIS know once results are available? -> for Emikat, we periodically pull the current status. But it would also be possible (maybe the better solution?) if the TM would make a REST call and update the status of the calculations

In this specific case, CSIS is not required to monitor the results in this moment.

  1. Which ID to use as primary identification for communication? (e.g. when requesting a map from the TM) -> for the CSIS (Drupal system) it would be easier if we could use our internal IDs and pass them along in our requests.

We can add this field to the DB model and allow queries by external ID.

Please let me know if there is anything else you would like to ask.

patrickkaleta commented 4 years ago

Ok great, so we will do the following:

Setup of initial trigger:

Relevant fields to be included in initial trigger:

@rapto so how exactly can we talk to the TM? Is there a documentation or description of the API available, so that we can set this up? If you like we can have a telco and discuss this in more detail.

Also, what other fields will be needed? Don't you need the study area and the selected data package + resources, so that the TM can do its calculations? If so, we can add this information in the initial trigger, or the TM could also get these details via a REST call and inside the initial trigger I just place a link to appropriate REST endpoint on the CSIS side.

ghilbrae commented 4 years ago

We can discuss this on Monday after the weekly meeting. I'll let @rapto know when to connect.

patrickkaleta commented 4 years ago

With the help of @rapto I was able to get the TM trigger up and running. I'm considering this issue done.