Running a task with context parameters using MetaServlet - 6.3

Talend Administration Center User Guide

EnrichVersion
6.3
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend Real-Time Big Data Platform
task
Administration and Monitoring
Deployment
EnrichPlatform
Talend Administration Center

In the following scenario, an established task in Talend Administration Center is executed using metaServlet with context parameters.

Prerequisites:

  • Make sure an existing task is available on the Job Conductor page of Talend Administration Center before you proceed the following steps.

  • The Job below is pre-established in the Studio with context variables: context.firstname and context.lastname.

Deploying a pre-established task on the Job Conductor page

  • Deploy the pre-established Job on an execution server from the Job Conductor page:

    For more information about how to deploy a Job from the Job Conductor page, see Adding a Normal execution task.

Executing a task with context parameters using metaServlet

  1. Open the Windows command line or Linux terminal, and go to the following directory:

    ./org.talend.administrator/WEB-INF/classes

  2. To call the metaServlet on Windows, run the MetaServletCaller.bat file.

    To call the metaServlet on Linux, run the MetaServletCaller.sh file.

  3. Type in the following script to execute task 1 with the context values of your choice :

    MetaServletCaller.bat 
    --tac-url=http://localhost:8080/org.talend.administrator 
    --json-params=
    {
    "actionName":"runTask",
    "authPass":"TAC_Admin_password",
    "authUser":"TAC_Admin_username",
    "taskId":1,
    "mode":"synchronous",
    "context":{"firstname":"Robert","lastname":"Durst"}
    }

    The response from the Talend Administration Center server is displayed in the command lines:

    The execution information is displayed in the Task execution details console of Talend Administration Center:

    "context":{"firstname":"Kimmy","lastname":"Schmidt"} in the script above specifies the values for the context parameters: firstname and lastname, you must follow the syntax below:

    "context":{"varname1":"varvalue"}

    Multiple context parameters should be separated by comma(s). You should replace the parameters used in the command with what they are in real contexts.