FOR BI PROS LEARN Tableau
Trigger Tableau Schedule from Talend
September 14, 2014
1
, , , , ,

Tableau Schedule is triggered from Talend - see component description

In part one we just made a fantastic java class for triggering Tableau Server schedules from pure java – for profit and fun. The goal is to have a component which can trigger schedule refreshes on the Tableau Server directly after the ETL processes, without any platform dependent code or command line invocation. In this second part, I should move the code under Talend ETL to make my customer happy.

In Talend, there should be a directory dedicated for custom components, all the custom components will be put into this dedicated directory. To set up this location:

  1. Create a directory in any place of file system, for example: D:/custom_component.
  2. Go to configure the path of dedicated component directory in Preferences, launch Talend Studio, open Window,  followed by PreferencesTalendComponents, and then browse the User component folder path, finally, click OK button, Talend Studio will reload all the custom components.

Talend Custom Folder

Now we have to create a directory for our component (let’s call it tTableauTriggerSchedule) inside the component folder and place the following files there:

  1. tTableauTriggerSchedule_icon32.png  – this will be the picture of our component (32×32 pixel)
  2. tTableauTriggerSchedule_java.xml – the metadata description for the component
  3. tTableauTriggerSchedule_messages.properties  – captions (for localization)
  4. tTableauTriggerSchedule_main.javajet – java template for code generation

The image is easy, I suppose all of us are black belt in paint.exe. But what to put into tTableauTriggerSchedule_java.xml?

Explanation for the sections:

  • Line 1-23: Boring stuff, who did what, where to put on the palette, where is the documentation.
  • Line 24-33: By declaring max_input=0 for flow and interate input/put we just state that this component cannot process or produce data sets. This is fine, as we really do not have to such things.
  • Line 34-44: We will ask for four required parameters, all text types (hostname, user, password, schedule name). NUM_ROW sets the display order in Studio.
  • Line 47-57: This is the class (built into jar) from the part I including its dependencies (you should find these jars in one of the subfolders under your home directory). You should copy all these files into the component folder.

We should give names for the component and for the parameters. Lets use this content for the messages file:

Please note that HOST, USERNAME, PASSWORD and SCHEDULE are parameter names. By adding a .NAME suffix we can assign a GUI label for them. Let’s focus on the last piece, the business logic (java template) itself:

As you see, the format is very similar JSP files (those are also java jet files). Compilation time talend will execute the template java code (within <% and %>) and generate the real java file, which will be executed during run time. Since we built our nice WebServiceClient class with one single static function, we just need to get the parameter values from the GUI during compilation time – and it will be executed from Talend during run time with the correct values.

These parameters will be substituted in the generated java code

These parameters will be substituted in the generated java code

Woah! It’s so simple. Where is the complexity?


 

If you are lazy to go thru on this tutorial, then you can find the component ready to install on talendforge: http://www.talendforge.org/exchange/index.php?eid=1357&product=tos&action=view

If you want to know more about Talend component creation I would suggest this link: https://help.talend.com/display/KBSTAGING/How+to+create+a+custom+component

On the other hand you should also check out my other tutorial: How to generate the initial extract with Tableau Server (from Java).

Tamás Földi

Tamás Földi

Director of IT Development at Starschema
Decades of experience with data processing and state of the art programming. From nuclear bomb explosion simulation to distributed file systems. ethical hacking, real time stream processing practically I always had a great fun with those geeky ones and zeros.
Tamás Földi
  • Jibin

    Hi Tamas,

    I get the following error when I utilize the component in Talend:

    Exception in component tTableauTriggerSchedule_1

    javax.xml.parsers.ParserConfigurationException: Auth token not found

    at tableauSrvrWebservice.Auth.WebServiceClient.authenticate(WebServiceClient.java:191)

    at

Related items

/ You may check this items as well

Pasted image at 2018_01_09 04_59 PM

Python Experiments in Tableau 1. – Add live currency conversion to Tableau Dashboards using TabPy

In part one we just made a fantastic java class fo...

Read more
Tableau Docker

HOWTO: Tableau Server Linux in Docker Container

In part one we just made a fantastic java class fo...

Read more
Tableau Consistency Checker

Tableau Filestore Consistency Checker – How Repository Maps to Filestore

In part one we just made a fantastic java class fo...

Read more