Upgrading MDM Workflows with TalendTaskExec and TalendTaskCreator Connectors

author
Irshad Burtally
EnrichVersion
6.4
6.3
6.2
6.1
EnrichProdName
Talend Data Fabric
Talend MDM Platform
task
Installation and Upgrade
Data Governance > Managing workflows
EnrichPlatform
Talend MDM Web UI
Talend Studio

Upgrading MDM Workflows with TalendTaskExec and TalendTaskCreator Connectors

This article explains how to upgrade MDM Workflows which use the TalendTaskExec and TalendTaskCreator connectors.

These two connectors are provided in Talend MDM Platform and can be leveraged within an MDM Workflow designer. They were available in Talend 5.x.

In Talend 6.x, these connectors were deprecated and removed. They are no longer available in the MDM Workflow designer.

Upgrade to Talend 6.x

Since these two connectors are not available in Talend 6.x, the workflows drop all configuration of these connectors after an upgrade. They will not appear in your workflow processes at all. They are not replaced by anything else by the internal migration tasks within the workflow designer.

To solve this problem, you need to replace these two connectors with the corresponding API calls to the Talend MetaServlet. The Talend MetaServlet is an API to Talend Administration Center and provides actions/commands to a lot of the functionality of Talend Administration Center. These actions are described here. The rest of this article describes how to call the MetaServlet API as an http request and build your own custom connector to call the Talend MetaServlet API. The example below is a good replacement for the TalendTaskExec connector. You can extend or duplicate the logic and code below to build your own equivalent of the TalendTaskCreator replacement connector.

Scroll to the end for the link to download the example connector described here.

Calling a task using Talend MetaServlet

This section explains how to call a task using the Talend MetaServlet.

The Talend MetaServlet is available with Talend Administration Center. It is generally exposed at the following URL: http://<hostname>:<port>/org.talend.administrator/metaServlet and it takes one parameter, which is a Base64 encoded string.

  1. Create the following JSON snippet.
    {
    "actionName":"runTask",
    "authPass":"admin",
    "authUser":"admin@company.com",
    "mode":"synchronous",
    "taskId":"7"
    }                 
  2. Use the website https://www.base64encode.org/ to encode your JSON snippet as shown below.
  3. Copy this Base64 encoded string and pass it as a parameter to your metaServlet URL.
    The URL becomes http://<hostname>:<port>/org.talend.administrator/metaServlet?ew0KImFjdGlvbk5hbWUiOiJydW5UYXNrIiwNCiJhdXRoUGFzcyI6ImFkbWluIiwNCiJhdXRoVXNlciI6ImFkbWluQGNvbXBhbnkuY29tIiwNCiJtb2RlIjoic3luY2hyb25vdXMiLA0KInRhc2tJZCI6IjciDQp9.

When you enter the URL above in a browser, you get a response similar to the one below, if all parameters for username, password and taskId are correct. However, you will get different responses if there is an error, or if you call a different MetaServlet command. The response is also different if you use asynchronous mode since you need to keep checking the status of completion for the task in asynchronous mode as explained here.

{"errorStatus":"NO_ERROR","execBasicStatus":"OK","execDetailedStatus":"ENDED_OK","execDetailedStatusLabel":"Ok","execRequestId":"1467745866113_Gqwr5","executionTime":{"millis":1894,"seconds":1},"jobExitCode":0,"returnCode":0,"status":"READY_TO_RUN"}

Building a custom connector to call Talend MetaServlet

This section explains how to build your own custom connector in BPM to call the Talend MetaServlet API runTask command as explained above.
  1. Download the required Java third-party libraries.
  2. Open your workflow in the BPM perspective of the studio.
  3. Configure a new definition by going to Development > Connectors > New definition... as shown below.
  4. Name your connector, TalendMetaServlet, for example, then fill out the details as follows. Select the Talend MDM Category.
  5. Click Add... next to Dependencies and in the new dialog box, click Import... and import the two jar files mentioned as dependencies above.
  6. Click Next.
  7. Add two inputs named metaServletUrl and jsonScript as Mandatory inputs, as shown below.

    Both inputs will be of type java.lang.String. You can set a default value as well. For the metaServletUrl, the default value is http://<hostname>:<port>/org.talend.administrator/metaServlet?.

  8. Click Next.
  9. Click Add... to define the connector wizard pages that will appear when developers use your custom connector.

    You have just one custom wizard page asking for the input values of the two inputs you defined in the previous step.

  10. Enter the following values and click Add... to add two input widgets.
  11. Set the type of widget for the metaServletUrl field as Text.
  12. Set the type of widget for the jsonScript field as Text area editor to have a big input for the JSON file.
  13. Click Next once the wizard page definition is complete.
  14. Define three outputs as shown below:
    Name Type
    execBasicStatus java.lang.String
    jobExitCode java.lang.Integer
    returnCode java.lang.Integer
    Here you are defining execBasicStatus and jobExitCode, which are outputs for the runTask MetaServlet API. Other MetaServlet commands will return different results from this one.
  15. Click Next, then click Finish on the next window.

Creating a connector implementation for your custom connector

This section explains how to create a new implementation for the custom connector you created.
  1. Create a new implementation by navigating to Development > Connectors > New implementation.
  2. Select your connector and click Next.