<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article Using file triggers in Talend Cloud in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/Using-file-triggers-in-Talend-Cloud/ta-p/2150401</link>
    <description>&lt;P&gt;You may use file triggers to execute Talend Jobs in the Talend Administration Center Job Conductor; however, you won’t find a similar construct in Talend Management Console. Currently, Talend Management Console does not offer an explicit method of triggering task execution when there is a change in the status of a file in a filesystem.&lt;/P&gt;
&lt;P&gt;This article shows you two useful workarounds: Job triggering, and task triggering using a Talend Route. Jobs have a start and an end, and Routes run until stopped.&lt;/P&gt;
&lt;P&gt;These workarounds provide a proof of concept (POC), not drop-in solutions. You can modify these POCs to meet your use case requirements and create a fully deployable solution. Links to additional workarounds for AWS, Azure, and Google Cloud Platform are provided in the&amp;nbsp;References section of this article.&lt;/P&gt;
&lt;P&gt;The &lt;STRONG&gt;FileTriggers.zip&lt;/STRONG&gt; file, attached to this article, contains the Talend Studio 7.3 proof of concept Jobs discussed in this article. Although the Jobs included in this file require Talend Studio 7.3, you can build the same Jobs in earlier versions.&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Job trigger&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;The Job trigger method relies on the Studio &lt;STRONG&gt;tWaitForFile&lt;/STRONG&gt; component to detect an external file action in a filesystem. The filesystem must be accessible from a Remote Engine because the Job cannot run using a Cloud Engine. The Job is designed to run continuously in Talend Management Console, and it provides user-level log information to Talend Management Console and detailed log information in the Job log found on the Remote Engine.&lt;/P&gt;
&lt;P&gt;The Job waits for any action (create, update, or delete) on a file that matches the file mask in the &lt;STRONG&gt;tWaitForFile&lt;/STRONG&gt; component, then it formats the full path of the file and passes it to a Talend Management Console task that is triggered by the file action.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqERAAY.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123644iE82F19FAB38D5F38/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqERAAY.png" alt="0693p000008uqERAAY.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H3&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Using context variables&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;P&gt;The Job uses the following context variables, which are implicitly loaded from a delimited file into a &lt;STRONG&gt;tContextLoad&lt;/STRONG&gt; component.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqLvAAI.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124519i8B52F8AD35FDD95E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqLvAAI.png" alt="0693p000008uqLvAAI.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;parameter_interval&lt;/STRONG&gt; defines the time in seconds between iterations of the &lt;STRONG&gt;tWaitForFile&lt;/STRONG&gt; component.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;parameter_directory&lt;/STRONG&gt; is the directory for the &lt;STRONG&gt;tWaitForFile&lt;/STRONG&gt; component to scan.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;parameter_mask&lt;/STRONG&gt; is the file mask used to match files in the directory used by &lt;STRONG&gt;tWaitForFile&lt;/STRONG&gt;.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;parameter_task_id&lt;/STRONG&gt; is the Task ID of the Job to be triggered and is used by the &lt;STRONG&gt;tFixedFlowInput&lt;/STRONG&gt;. You can find the Task ID on the &lt;STRONG&gt;Task Details&lt;/STRONG&gt; page in the Talend Management Console:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uq48AAA.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123943i8C156B43CE30C0AC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uq48AAA.png" alt="0693p000008uq48AAA.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;parameter_auth_id&lt;/STRONG&gt; is a Base64-encoded string of the user’s Talend Cloud login ID and password in the format &lt;EM&gt;&amp;lt;uid&amp;gt;:&amp;lt;password&amp;gt;&lt;/EM&gt;. The parameter is used on the &lt;STRONG&gt;Advanced settings&lt;/STRONG&gt; tab of the &lt;STRONG&gt;tRestClient&lt;/STRONG&gt; component.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Processing flow&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;In this case, the &lt;STRONG&gt;tWaitForFile&lt;/STRONG&gt; component is configured to fire on any file action (including creation, update, or delete) for any file that matches the file mask in the scanned directory. After the Job starts, the loop continues indefinitely, until the Job is terminated.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqM0AAI.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122904i82203005BC1A07DD/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqM0AAI.png" alt="0693p000008uqM0AAI.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The &lt;STRONG&gt;tWaitForFile&lt;/STRONG&gt; component transfers all information known about the file and the action that caused the firing to a &lt;STRONG&gt;tMap&lt;/STRONG&gt; component, which formats the full path of the triggering file for later use.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqM5AAI.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/121959i88E3741695731398/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqM5AAI.png" alt="0693p000008uqM5AAI.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;If multiple files cause the trigger to fire, a &lt;STRONG&gt;tFlowToIterate&lt;/STRONG&gt; component creates a loop. For each iteration of the loop, data about the file is logged to &lt;STRONG&gt;stdout&lt;/STRONG&gt; by a &lt;STRONG&gt;tJava&lt;/STRONG&gt; component. In Talend Cloud, this information can be found in the Job log of the Remote Engine for the instantiation of the Job.&lt;/P&gt;
&lt;P&gt;Next, higher-level information about the start of processing for the triggered file is posted to the task's user log in Talend Management Console.&lt;/P&gt;
&lt;P&gt;When core processing starts, the ID of the task to be executed and the path of the triggering file is picked up by a &lt;STRONG&gt;tFixedFlowInput&lt;/STRONG&gt; component and passed to a &lt;STRONG&gt;tMap&lt;/STRONG&gt; component, which formats them to the Talend Cloud Swagger API specification for the &lt;A href="https://api.eu.cloud.talend.com/tmc/swagger/swagger-ui.html#!/executions/execute" target="_blank" rel="noopener"&gt;executions&lt;/A&gt; API method.&lt;/P&gt;
&lt;PRE&gt;{
  "executable": "57f64991e4b0b689a64feed0",
  "parameters": {
      "parameter_filepath": row2.filepath
  }
}&lt;/PRE&gt;
&lt;P&gt;In this method, the called Job has one parameter: the path of the triggering file. The formatted API message is passed to a &lt;STRONG&gt;tRESTClient&lt;/STRONG&gt; component and then to the Talend Cloud Swagger API. The authorization token is passed in the HTTP header for the API call.&lt;/P&gt;
&lt;P&gt;API return information is logged to one of two &lt;STRONG&gt;tLogRow&lt;/STRONG&gt; components (Response and Error). Final information is posted to the Talend Management Console task log.&lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Triggered task&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;In this batch file method, the triggered task is based on a simple Talend Job called &lt;STRONG&gt;tdye_file_triggered_job&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008upxMAAQ.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123229i22DBE237435BB5E3/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008upxMAAQ.png" alt="0693p000008upxMAAQ.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The Job picks up a context parameter for the file path as passed from the triggering task, formats it (&lt;STRONG&gt;tJavaRow&lt;/STRONG&gt; instead of &lt;STRONG&gt;tMap&lt;/STRONG&gt;), and writes a formatted message to the Talend Management Console task log.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqMAAAY.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123705i418BB21325E00024/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqMAAAY.png" alt="0693p000008uqMAAAY.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Executing the batch file triggered task&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;The configuration details to execute the batch file triggered task are as follows:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;Publish the triggered task to Talend Cloud.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Assign the task to a Remote Engine. You do not need to supply a value to the user-defined parameter.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Click the &lt;STRONG&gt;Go Live&lt;/STRONG&gt; button.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Copy the &lt;STRONG&gt;Task ID&lt;/STRONG&gt; value, because you will need it for the parameters file you are about to create.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqMFAAY.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123533iFC7EAB9EFC4B08C9/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqMFAAY.jpg" alt="0693p000008uqMFAAY.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Create a CSV file similar to the example below that contains the user-defined parameters and values for the task, and store it somewhere in the filesystem on your Remote Engine. The value set in the Studio Job is &lt;STRONG&gt;/var/tmp/batch_file_trigger_poc.csv&lt;/STRONG&gt;.&lt;/P&gt;
&lt;PRE&gt;parameter_interval;3
parameter_directory;/tmp/fileTriggerTest
parameter_mask;junk.txt
parameter_task_id;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
parameter_auth_id;yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy&lt;/PRE&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;For the &lt;STRONG&gt;parameter_task_id&lt;/STRONG&gt; include the Task ID of the triggered task you copied.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;For the &lt;STRONG&gt;parameter_auth_id&lt;/STRONG&gt; include your user credentials as a base64-encoded string in the format &lt;EM&gt;&amp;lt;uid&amp;gt;:&amp;lt;password&amp;gt;,&lt;/EM&gt; where &lt;EM&gt;uid&lt;/EM&gt; and &lt;EM&gt;password&lt;/EM&gt; are your Talend Cloud user ID and password, respectively.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Enter values for the other user-defined parameters and save the CSV file.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Publish the &lt;STRONG&gt;batch_file_trigger_poc&lt;/STRONG&gt; Job to Talend Cloud.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Execute the &lt;STRONG&gt;Batch File Trigger POC&lt;/STRONG&gt; task. The Job runs and does not stop until terminated.&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Testing the Job triggering&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;The process flow steps are:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;While the Batch File Trigger POC task is running, check the logs in Talend Management Console. The logs should be empty.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Log in to the machine running your Remote Engine server and navigate to the directory you defined in the &lt;STRONG&gt;parameter_directory&lt;/STRONG&gt; for this task. In this case, the &lt;STRONG&gt;parameter_directory&lt;/STRONG&gt; points to &lt;STRONG&gt;/var/tmp/fileTriggerTest&lt;/STRONG&gt;. Initially, the directory should be empty.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Create a file that matches the &lt;STRONG&gt;parameter_mask&lt;/STRONG&gt; you defined&lt;STRONG&gt;.&lt;/STRONG&gt; In this example, the mask parameter is a file called &lt;STRONG&gt;junk.txt&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqKjAAI.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/125199i5ECCEC766545598C/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqKjAAI.png" alt="0693p000008uqKjAAI.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Switch back to Talend Management Console. Open the task for the triggered Job (&lt;STRONG&gt;tdye_file_triggered_job&lt;/STRONG&gt;) and see if the Job ran.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uq7LAAQ.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122595i070ADAAB82DC08CC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uq7LAAQ.jpg" alt="0693p000008uq7LAAQ.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Click &lt;STRONG&gt;View Logs&lt;/STRONG&gt; and check the user log for the triggered Job. There should be a single entry that shows the file that caused the Job to trigger.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqMKAAY.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/121890iDA21868DD0762E21/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqMKAAY.png" alt="0693p000008uqMKAAY.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;In Talend Management Console, return to the &lt;STRONG&gt;Batch File Trigger POC&lt;/STRONG&gt; task and view the logs. You can find start and stop entries for the &lt;EM&gt;triggering&lt;/EM&gt; of the task in the user logs for this task.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqKBAAY.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/121555i9EDCAC062C995F79/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqKBAAY.png" alt="0693p000008uqKBAAY.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Go to the Job logs on the Remote Engine file system to see additional log details.&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;H3&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Talend Route trigger&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;P&gt;This method uses an ESB Route to detect the creation of a file and trigger a Talend Job that uses the &lt;STRONG&gt;cTalendJob&lt;/STRONG&gt; component. The Route use case is a bit more complicated than the Job use case and more limited in scope. You must have the ability to execute a Route in Talend Cloud, and you must have a Remote Engine with Talend Runtime installed, paired, and available.&lt;/P&gt;
&lt;P&gt;By design, a Route runs continuously upon deployment to a Remote Engine with Runtime installed in Talend Cloud. The Route monitors a specific directory for the appearance of a file.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqIUAAY.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124313i84D19423C5D93CC9/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqIUAAY.png" alt="0693p000008uqIUAAY.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The process flow steps are:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;When deployed, a &lt;STRONG&gt;cFile&lt;/STRONG&gt; component monitors a directory passed into the Route by a context variable.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;When a file appears, the &lt;STRONG&gt;cFile&lt;/STRONG&gt; component fires a message, and the filename and path are logged. The full path is put into the message body and passed to a &lt;STRONG&gt;cTalendJob &lt;/STRONG&gt;component.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqBIAAY.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123471iCB10BA3F8DF47D73/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqBIAAY.png" alt="0693p000008uqBIAAY.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;The &lt;STRONG&gt;cTalendJob&lt;/STRONG&gt; component calls the Job, in this case, &lt;STRONG&gt;tdye_route_triggered_job&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uq6iAAA.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122113i9C0FE1B038AF4126/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uq6iAAA.png" alt="0693p000008uq6iAAA.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;The Job simply deletes the file passed in from the Route and exits. No data is returned to the Route. The new file must be deleted or moved out of the monitored directory. Otherwise, when undeploying and deploying the Route, any file can cause the &lt;STRONG&gt;cFile&lt;/STRONG&gt; component to generate messages for all files in the directory.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqJgAAI.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124951i54F8DE0EA3A984DE/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqJgAAI.png" alt="0693p000008uqJgAAI.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;In the Job, the Camel message is captured for processing by the &lt;STRONG&gt;tRouteInput&lt;/STRONG&gt; component. The only item of interest is the message body, which contains the path of the file that caused the Route to fire a message.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqMUAAY.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123717i92B2DE64B9382FD8/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqMUAAY.png" alt="0693p000008uqMUAAY.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;The message body is stored in the Talend Global Map and retrieved by a &lt;STRONG&gt;tFileDelete&lt;/STRONG&gt; component. Status from this component is logged to stdout and to the Talend Cloud Manager user log.&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3 id="h_291124359181590073195268" class="lia-message-template-content-zone"&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Related Content&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;P&gt;For more information on triggering Jobs in other cloud services, see the following Knowledge Base (KB) articles:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;A href="https://community.qlik.com/t5/Official-Support-Articles/Automate-S3-file-processing-with-Talend-Cloud-and-AWS-Lambda/ta-p/2150614" target="_blank" rel="noopener"&gt;Automate S3 file processing with Talend Cloud and AWS Lambda&lt;/A&gt;&lt;BR /&gt;&lt;A style="font-family: inherit; background-color: #ffffff;" href="https://community.qlik.com/t5/Official-Support-Articles/Using-Azure-Functions-to-trigger-Talend-Cloud-Jobs/ta-p/2151853" target="_blank" rel="noopener"&gt;Azure Functions to Trigger Talend Cloud Jobs&lt;/A&gt;&lt;BR /&gt;&lt;A style="font-family: inherit; background-color: #ffffff;" href="https://community.qlik.com/t5/Official-Support-Articles/Automate-file-processing-from-Google-Storage-with-Talend-Cloud/ta-p/2150611" target="_blank" rel="noopener"&gt;Automating File Processing from Google Storage with Talend Cloud&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Aug 2024 05:57:23 GMT</pubDate>
    <dc:creator>TalendSolutionExpert</dc:creator>
    <dc:date>2024-08-14T05:57:23Z</dc:date>
    <item>
      <title>Using file triggers in Talend Cloud</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Using-file-triggers-in-Talend-Cloud/ta-p/2150401</link>
      <description>&lt;P&gt;You may use file triggers to execute Talend Jobs in the Talend Administration Center Job Conductor; however, you won’t find a similar construct in Talend Management Console. Currently, Talend Management Console does not offer an explicit method of triggering task execution when there is a change in the status of a file in a filesystem.&lt;/P&gt;
&lt;P&gt;This article shows you two useful workarounds: Job triggering, and task triggering using a Talend Route. Jobs have a start and an end, and Routes run until stopped.&lt;/P&gt;
&lt;P&gt;These workarounds provide a proof of concept (POC), not drop-in solutions. You can modify these POCs to meet your use case requirements and create a fully deployable solution. Links to additional workarounds for AWS, Azure, and Google Cloud Platform are provided in the&amp;nbsp;References section of this article.&lt;/P&gt;
&lt;P&gt;The &lt;STRONG&gt;FileTriggers.zip&lt;/STRONG&gt; file, attached to this article, contains the Talend Studio 7.3 proof of concept Jobs discussed in this article. Although the Jobs included in this file require Talend Studio 7.3, you can build the same Jobs in earlier versions.&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Job trigger&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;The Job trigger method relies on the Studio &lt;STRONG&gt;tWaitForFile&lt;/STRONG&gt; component to detect an external file action in a filesystem. The filesystem must be accessible from a Remote Engine because the Job cannot run using a Cloud Engine. The Job is designed to run continuously in Talend Management Console, and it provides user-level log information to Talend Management Console and detailed log information in the Job log found on the Remote Engine.&lt;/P&gt;
&lt;P&gt;The Job waits for any action (create, update, or delete) on a file that matches the file mask in the &lt;STRONG&gt;tWaitForFile&lt;/STRONG&gt; component, then it formats the full path of the file and passes it to a Talend Management Console task that is triggered by the file action.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqERAAY.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123644iE82F19FAB38D5F38/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqERAAY.png" alt="0693p000008uqERAAY.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H3&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Using context variables&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;P&gt;The Job uses the following context variables, which are implicitly loaded from a delimited file into a &lt;STRONG&gt;tContextLoad&lt;/STRONG&gt; component.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqLvAAI.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124519i8B52F8AD35FDD95E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqLvAAI.png" alt="0693p000008uqLvAAI.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;parameter_interval&lt;/STRONG&gt; defines the time in seconds between iterations of the &lt;STRONG&gt;tWaitForFile&lt;/STRONG&gt; component.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;parameter_directory&lt;/STRONG&gt; is the directory for the &lt;STRONG&gt;tWaitForFile&lt;/STRONG&gt; component to scan.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;parameter_mask&lt;/STRONG&gt; is the file mask used to match files in the directory used by &lt;STRONG&gt;tWaitForFile&lt;/STRONG&gt;.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;parameter_task_id&lt;/STRONG&gt; is the Task ID of the Job to be triggered and is used by the &lt;STRONG&gt;tFixedFlowInput&lt;/STRONG&gt;. You can find the Task ID on the &lt;STRONG&gt;Task Details&lt;/STRONG&gt; page in the Talend Management Console:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uq48AAA.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123943i8C156B43CE30C0AC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uq48AAA.png" alt="0693p000008uq48AAA.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;parameter_auth_id&lt;/STRONG&gt; is a Base64-encoded string of the user’s Talend Cloud login ID and password in the format &lt;EM&gt;&amp;lt;uid&amp;gt;:&amp;lt;password&amp;gt;&lt;/EM&gt;. The parameter is used on the &lt;STRONG&gt;Advanced settings&lt;/STRONG&gt; tab of the &lt;STRONG&gt;tRestClient&lt;/STRONG&gt; component.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Processing flow&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;In this case, the &lt;STRONG&gt;tWaitForFile&lt;/STRONG&gt; component is configured to fire on any file action (including creation, update, or delete) for any file that matches the file mask in the scanned directory. After the Job starts, the loop continues indefinitely, until the Job is terminated.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqM0AAI.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122904i82203005BC1A07DD/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqM0AAI.png" alt="0693p000008uqM0AAI.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The &lt;STRONG&gt;tWaitForFile&lt;/STRONG&gt; component transfers all information known about the file and the action that caused the firing to a &lt;STRONG&gt;tMap&lt;/STRONG&gt; component, which formats the full path of the triggering file for later use.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqM5AAI.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/121959i88E3741695731398/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqM5AAI.png" alt="0693p000008uqM5AAI.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;If multiple files cause the trigger to fire, a &lt;STRONG&gt;tFlowToIterate&lt;/STRONG&gt; component creates a loop. For each iteration of the loop, data about the file is logged to &lt;STRONG&gt;stdout&lt;/STRONG&gt; by a &lt;STRONG&gt;tJava&lt;/STRONG&gt; component. In Talend Cloud, this information can be found in the Job log of the Remote Engine for the instantiation of the Job.&lt;/P&gt;
&lt;P&gt;Next, higher-level information about the start of processing for the triggered file is posted to the task's user log in Talend Management Console.&lt;/P&gt;
&lt;P&gt;When core processing starts, the ID of the task to be executed and the path of the triggering file is picked up by a &lt;STRONG&gt;tFixedFlowInput&lt;/STRONG&gt; component and passed to a &lt;STRONG&gt;tMap&lt;/STRONG&gt; component, which formats them to the Talend Cloud Swagger API specification for the &lt;A href="https://api.eu.cloud.talend.com/tmc/swagger/swagger-ui.html#!/executions/execute" target="_blank" rel="noopener"&gt;executions&lt;/A&gt; API method.&lt;/P&gt;
&lt;PRE&gt;{
  "executable": "57f64991e4b0b689a64feed0",
  "parameters": {
      "parameter_filepath": row2.filepath
  }
}&lt;/PRE&gt;
&lt;P&gt;In this method, the called Job has one parameter: the path of the triggering file. The formatted API message is passed to a &lt;STRONG&gt;tRESTClient&lt;/STRONG&gt; component and then to the Talend Cloud Swagger API. The authorization token is passed in the HTTP header for the API call.&lt;/P&gt;
&lt;P&gt;API return information is logged to one of two &lt;STRONG&gt;tLogRow&lt;/STRONG&gt; components (Response and Error). Final information is posted to the Talend Management Console task log.&lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Triggered task&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;In this batch file method, the triggered task is based on a simple Talend Job called &lt;STRONG&gt;tdye_file_triggered_job&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008upxMAAQ.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123229i22DBE237435BB5E3/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008upxMAAQ.png" alt="0693p000008upxMAAQ.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The Job picks up a context parameter for the file path as passed from the triggering task, formats it (&lt;STRONG&gt;tJavaRow&lt;/STRONG&gt; instead of &lt;STRONG&gt;tMap&lt;/STRONG&gt;), and writes a formatted message to the Talend Management Console task log.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqMAAAY.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123705i418BB21325E00024/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqMAAAY.png" alt="0693p000008uqMAAAY.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Executing the batch file triggered task&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;The configuration details to execute the batch file triggered task are as follows:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;Publish the triggered task to Talend Cloud.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Assign the task to a Remote Engine. You do not need to supply a value to the user-defined parameter.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Click the &lt;STRONG&gt;Go Live&lt;/STRONG&gt; button.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Copy the &lt;STRONG&gt;Task ID&lt;/STRONG&gt; value, because you will need it for the parameters file you are about to create.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqMFAAY.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123533iFC7EAB9EFC4B08C9/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqMFAAY.jpg" alt="0693p000008uqMFAAY.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Create a CSV file similar to the example below that contains the user-defined parameters and values for the task, and store it somewhere in the filesystem on your Remote Engine. The value set in the Studio Job is &lt;STRONG&gt;/var/tmp/batch_file_trigger_poc.csv&lt;/STRONG&gt;.&lt;/P&gt;
&lt;PRE&gt;parameter_interval;3
parameter_directory;/tmp/fileTriggerTest
parameter_mask;junk.txt
parameter_task_id;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
parameter_auth_id;yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy&lt;/PRE&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;For the &lt;STRONG&gt;parameter_task_id&lt;/STRONG&gt; include the Task ID of the triggered task you copied.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;For the &lt;STRONG&gt;parameter_auth_id&lt;/STRONG&gt; include your user credentials as a base64-encoded string in the format &lt;EM&gt;&amp;lt;uid&amp;gt;:&amp;lt;password&amp;gt;,&lt;/EM&gt; where &lt;EM&gt;uid&lt;/EM&gt; and &lt;EM&gt;password&lt;/EM&gt; are your Talend Cloud user ID and password, respectively.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Enter values for the other user-defined parameters and save the CSV file.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Publish the &lt;STRONG&gt;batch_file_trigger_poc&lt;/STRONG&gt; Job to Talend Cloud.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Execute the &lt;STRONG&gt;Batch File Trigger POC&lt;/STRONG&gt; task. The Job runs and does not stop until terminated.&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Testing the Job triggering&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;The process flow steps are:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;While the Batch File Trigger POC task is running, check the logs in Talend Management Console. The logs should be empty.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Log in to the machine running your Remote Engine server and navigate to the directory you defined in the &lt;STRONG&gt;parameter_directory&lt;/STRONG&gt; for this task. In this case, the &lt;STRONG&gt;parameter_directory&lt;/STRONG&gt; points to &lt;STRONG&gt;/var/tmp/fileTriggerTest&lt;/STRONG&gt;. Initially, the directory should be empty.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Create a file that matches the &lt;STRONG&gt;parameter_mask&lt;/STRONG&gt; you defined&lt;STRONG&gt;.&lt;/STRONG&gt; In this example, the mask parameter is a file called &lt;STRONG&gt;junk.txt&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqKjAAI.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/125199i5ECCEC766545598C/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqKjAAI.png" alt="0693p000008uqKjAAI.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Switch back to Talend Management Console. Open the task for the triggered Job (&lt;STRONG&gt;tdye_file_triggered_job&lt;/STRONG&gt;) and see if the Job ran.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uq7LAAQ.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122595i070ADAAB82DC08CC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uq7LAAQ.jpg" alt="0693p000008uq7LAAQ.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Click &lt;STRONG&gt;View Logs&lt;/STRONG&gt; and check the user log for the triggered Job. There should be a single entry that shows the file that caused the Job to trigger.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqMKAAY.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/121890iDA21868DD0762E21/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqMKAAY.png" alt="0693p000008uqMKAAY.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;In Talend Management Console, return to the &lt;STRONG&gt;Batch File Trigger POC&lt;/STRONG&gt; task and view the logs. You can find start and stop entries for the &lt;EM&gt;triggering&lt;/EM&gt; of the task in the user logs for this task.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqKBAAY.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/121555i9EDCAC062C995F79/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqKBAAY.png" alt="0693p000008uqKBAAY.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Go to the Job logs on the Remote Engine file system to see additional log details.&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;H3&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Talend Route trigger&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;P&gt;This method uses an ESB Route to detect the creation of a file and trigger a Talend Job that uses the &lt;STRONG&gt;cTalendJob&lt;/STRONG&gt; component. The Route use case is a bit more complicated than the Job use case and more limited in scope. You must have the ability to execute a Route in Talend Cloud, and you must have a Remote Engine with Talend Runtime installed, paired, and available.&lt;/P&gt;
&lt;P&gt;By design, a Route runs continuously upon deployment to a Remote Engine with Runtime installed in Talend Cloud. The Route monitors a specific directory for the appearance of a file.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqIUAAY.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124313i84D19423C5D93CC9/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqIUAAY.png" alt="0693p000008uqIUAAY.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The process flow steps are:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;When deployed, a &lt;STRONG&gt;cFile&lt;/STRONG&gt; component monitors a directory passed into the Route by a context variable.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;When a file appears, the &lt;STRONG&gt;cFile&lt;/STRONG&gt; component fires a message, and the filename and path are logged. The full path is put into the message body and passed to a &lt;STRONG&gt;cTalendJob &lt;/STRONG&gt;component.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqBIAAY.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123471iCB10BA3F8DF47D73/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqBIAAY.png" alt="0693p000008uqBIAAY.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;The &lt;STRONG&gt;cTalendJob&lt;/STRONG&gt; component calls the Job, in this case, &lt;STRONG&gt;tdye_route_triggered_job&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uq6iAAA.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/122113i9C0FE1B038AF4126/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uq6iAAA.png" alt="0693p000008uq6iAAA.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;The Job simply deletes the file passed in from the Route and exits. No data is returned to the Route. The new file must be deleted or moved out of the monitored directory. Otherwise, when undeploying and deploying the Route, any file can cause the &lt;STRONG&gt;cFile&lt;/STRONG&gt; component to generate messages for all files in the directory.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqJgAAI.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/124951i54F8DE0EA3A984DE/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqJgAAI.png" alt="0693p000008uqJgAAI.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;In the Job, the Camel message is captured for processing by the &lt;STRONG&gt;tRouteInput&lt;/STRONG&gt; component. The only item of interest is the message body, which contains the path of the file that caused the Route to fire a message.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="0693p000008uqMUAAY.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/123717i92B2DE64B9382FD8/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p000008uqMUAAY.png" alt="0693p000008uqMUAAY.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;The message body is stored in the Talend Global Map and retrieved by a &lt;STRONG&gt;tFileDelete&lt;/STRONG&gt; component. Status from this component is logged to stdout and to the Talend Cloud Manager user log.&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3 id="h_291124359181590073195268" class="lia-message-template-content-zone"&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Related Content&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;P&gt;For more information on triggering Jobs in other cloud services, see the following Knowledge Base (KB) articles:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;A href="https://community.qlik.com/t5/Official-Support-Articles/Automate-S3-file-processing-with-Talend-Cloud-and-AWS-Lambda/ta-p/2150614" target="_blank" rel="noopener"&gt;Automate S3 file processing with Talend Cloud and AWS Lambda&lt;/A&gt;&lt;BR /&gt;&lt;A style="font-family: inherit; background-color: #ffffff;" href="https://community.qlik.com/t5/Official-Support-Articles/Using-Azure-Functions-to-trigger-Talend-Cloud-Jobs/ta-p/2151853" target="_blank" rel="noopener"&gt;Azure Functions to Trigger Talend Cloud Jobs&lt;/A&gt;&lt;BR /&gt;&lt;A style="font-family: inherit; background-color: #ffffff;" href="https://community.qlik.com/t5/Official-Support-Articles/Automate-file-processing-from-Google-Storage-with-Talend-Cloud/ta-p/2150611" target="_blank" rel="noopener"&gt;Automating File Processing from Google Storage with Talend Cloud&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2024 05:57:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Using-file-triggers-in-Talend-Cloud/ta-p/2150401</guid>
      <dc:creator>TalendSolutionExpert</dc:creator>
      <dc:date>2024-08-14T05:57:23Z</dc:date>
    </item>
  </channel>
</rss>

