Dataclay — Automating Digital Production
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Register
    • Login

    Can data source field in templater-options.json take a parameter (like $id) ?

    Scheduled Pinned Locked Moved
    Remote URL Feeds
    2
    4
    660
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jonathanundefined
      jonathan
      last edited by

      We are using templater with RabbitMQ (AMQP messaging) with a python software.

      This software take a message from the queue, and launch the shell script templater.ps1 with arguments.

      We want to add an extra argument to this templater.ps1 which is the id to take from our API to render the right film.

      Is this possible ?

      Our message from rabbitMQ also give the json to use, is the data source field can take this local Json someway ?

      ariestavundefined 1 Reply Last reply Reply Quote 0
      • ariestavundefined
        ariestav @jonathan
        last edited by

        @jonathan What you want to achieve is possible for sure, but you cannot pass the .json file an argument — it’s not a script, it’s a configuration file. However, you can absolutely have an app write to the templater-options.json file before calling the .ps1 file.

        The software app you are building might do the following steps:

        1. Read new message from the RabbitMQ
        2. Write the new job’s re-versioning JSON data to a file.
        3. Write a new, or modify an existing, templater-options.json file, namely with the data_source property with the correct value. In your case, the data_source property should point to the file that contains the created re-versioning JSON file that was created in step 2.
        4. Launch the .ps1 file in the same directory as the newly written templater-options.json file.

        Does this help?

        Thanks,
        Arie

        1 Reply Last reply Reply Quote 0
        • jonathanundefined
          jonathan
          last edited by

          Hi, thanks for your answer.

          We try to not update nor rewrite templater-options.json file. It’s too much for one field. But we can do the contrary :
          We gonna try to rewrite a file named data.json with the current data source from rabbitMQ and point our templater-options.json data source field to it.

          Is it gonna work ?

          1 Reply Last reply Reply Quote 0
          • ariestavundefined
            ariestav
            last edited by

            It should work, yes. Keep in mind that when you use the CLI, it’s essentially a synchronous process because you cannot execute more than one AE instance at any given time. If that is not an issue, then it will work perfectly.

            However if you plan on having concurrent CLI calls, then you might consider using the CLI to “Enable Bot” and have Bot “watch” the data source. If your data object contains a “render-status” property and it’s set to “ready” then Templater will process that job. In this way, you can have you app keep writing to the data.json file with new objects and then Templater will just pick them up.

            There is another forum post that describes the different deployment techniques. Take a read through that one and see if it helps you understand the broader methods for architecting your solution.

            Thanks,
            Arie

            1 Reply Last reply Reply Quote 0
            • First post
              Last post