July 30, 2023

tMDMDelete – Docs for ESB 7.x

tMDMDelete

Deletes master data records from specific entities in the MDM Hub.

tMDMDelete Standard properties

These properties are used to configure tMDMDelete running in the Standard Job
framework.

The Standard
tMDMDelete component belongs to the Talend MDM family.

The component in this framework is available in all Talend
products
.

Basic settings

Schema and Edit Schema

A schema is a row description, it defines the
number of fields that will be processed and passed on to the next component.
The schema is either built-in or remote in the Repository.

Click Edit
schema
to make changes to the schema. If the current schema is of the Repository type, three options are available:

  • View schema: choose this
    option to view the schema only.

  • Change to built-in property:
    choose this option to change the schema to Built-in for local changes.

  • Update repository connection:
    choose this option to change the schema stored in the repository and decide whether
    to propagate the changes to all the Jobs upon completion. If you just want to
    propagate the changes to the current Job, you can select No upon completion and choose this schema metadata
    again in the Repository Content
    window.

Click Sync columns to collect the schema from the
previous component.

 

Built-in: You create the
schema and store it locally for this component only. Related topic: see
Talend Studio
User Guide
.

 

Repository: You have
already created the schema and stored it in the Repository. You can reuse it in
various projects and job designs. Related topic: see
Talend Studio
User Guide
.

Use an existing connection Select this check box if you want to use a configured
tMDMConnection
component.

MDM version

By default, Server 6.0 is selected. Although it is
recommended to migrate existing Jobs for this new version, the Server 5.6 option is available
to ease the process of the migration of your Jobs so as to keep them working
without modification with a 6.0 server. To do so, an option on the server must
be enabled to accept and translate requests from such Jobs.

URL

Type in the URL required to access the MDM
server.

Username and Password

Type in the user authentication data for the
MDM server.

To enter the password, click the […] button next to the
password field, and then in the pop-up dialog box enter the password between double quotes
and click OK to save the settings.

Entity

Type in the name of the entity that holds the
data record(s) you want to delete.

Data Container

Type in the name of the data container that
holds the data record(s) you want to delete.

Type

Select Master or Staging to specify the database on which the
action should be performed.

Use multiple conditions

Select this check box to filter the master
data to be deleted, using certain conditions.

  • Xpath: Enter between quotes the path and the XML node to which you want to
    apply the condition.

  • Function: Select an operator to be used from the list. The following
    operators are available:

    • Contains:
      Returns a result which contains the word or words entered. Note that full text search
      does not support special characters, for example, @, #, $.
    • Contains the
      sentence
      : Returns one or more results which contain the sentence
      entered.
    • Joins With:
      This operator is reserved for future use.
    • Starts With:
      Returns a result which begins with the string entered.
    • Equal:
      Returns a result which matches the value entered.
    • Not Equal:
      Returns a result of any value other than the null value and the value entered.
    • is greater
      than
      : Returns a result which is greater than the numerical value entered.
      Applies to number fields only.
    • is greater or
      equal
      : Returns a result which is greater than or equal to the numerical
      value entered. Applies to number fields only.
    • is lower
      than
      : Returns a result which is less than the numerical value entered.
      Applies to number fields only.
    • is lower or
      equal
      : Returns a result which is less than or equal to the numerical value
      entered. Applies to number fields only.
    • whole content
      contains
      : Performs a plain text search using the specified Xpath field in the selected data
      container. If you enter an empty string “” in the Xpath field and select whole content contains from the Function list, searches will be performed in all the
      fields of all entities in the selected data container.
    • is empty or
      null
      : Returns an empty field or a null value.

    Before using the conditions, bear in mind the
    following:

    • Depending on the type of field the Xpath points to, only certain operators
      apply. For example, if the field is a boolean, only the Equal or Not Equal
      operators are appropriate.

    • Searches in the master database support both full
      text search and standard SQL search, while searches in the staging database only
      support standard SQL search. For more information about how to manage database search
      modes, see Talend
      Installation and Upgrade Guide
      .

    • Standard SQL search considers the search content as
      an integrate phrase to be matched, while full text search interprets the search
      content as a phrase which contains multiple words, and the records that match any of
      the words will be returned. For example, if the search content is “test first name”,
      full text search considers it as three independent words “test”, “first”, and “name”,
      while standard SQL search considers it as one phrase “test first name”.

    • The operator Not
      Equal
      does not support multi-occurrence fields or complex type fields.

  • Value: Enter
    between inverted commas the value you want to use.
  • Predicate: Select a predicate from the drop-down list.

    The predicates
    none (default), or, and, and Not are now available for use. The other predicates are
    reserved for future.

    • none
      (default): is interpreted as and by
      default.
    • or: returns a
      record if any of the conditions separated by it is true.
    • and: returns
      a record if all the conditions separated by it are true.
    • Not: returns a record if the
      condition on which it is defined is not true.
    Note: The or predicate is interpreted only if it is defined on all
    conditions, except the last condition. Otherwise the or predicate
    is always interpreted as and. For more information, see the related
    description of behaviors of filters using multiple conditions and predicates in Talend
    MDM on Talend Help Center (https://help.talend.com).

Keys (in sequence
order)

Specify the field(s) (in sequence order)
composing the key when the entity have a multiple key.

Fire Delete event

Note:

The check box is available only if you
select Master from
the Type list.

Select this check box so that a delete event
will be generated and written into the UpdateReport, which provides a complete report
on all create, update or delete actions on the master data.

  • Source Name:
    Define a name between quotes for the source which generates the delete
    event.

  • Invoke before deleting
    process
    : Select this check box to enable the execution of
    a Before Deleting
    Process to verify the delete event.

For further information about the UpdateReport and Process types,
see
Talend Studio
User Guide
.

Logical delete

Select this check box to send the master data
to the Recycle bin and fill in the Recycle bin path. Once in the Recycle bin, the master data can
be permanently deleted or restored. If you leave this check box clear, the
master data will be permanently deleted.

Die on error

Select this check box to skip the row in error
and complete the process for error-free rows. If needed, you can retrieve the
rows in error via a Row
> Rejects
link.

Advanced settings

tStatCatcher Statistics

Select this check box to gather the processing
metadata at the Job level as well as at each component level.

Global Variables

Global Variables

ERROR_MESSAGE: the error message generated by the
component when an error occurs. This is an After variable and it returns a string. This
variable functions only if the Die on error check box is
cleared, if the component has this check box.

NB_LINE: the number of rows processed. This is an After
variable and it returns an integer.

A Flow variable functions during the execution of a component while an After variable
functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl +
Space
to access the variable list and choose the variable to use from it.

For further information about variables, see
Talend Studio

User Guide.

Usage

Usage rule

If the Use multiple conditions check box is selected,
tMDMDelete can work
as a standalone component. Otherwise, it needs an input connection.

You can increase the timeout values for a Job using this component
to help process a large number of data records. For more information, see advanced
execution settings for JVM parameters in the article Timeout values for a Job using
MDM components
on Talend Help Center (https://help.talend.com).

Deleting master data from an MDM Hub

This scenario applies only to Talend MDM Platform and Talend Data Fabric.

This scenario describes a six-component Job that deletes the specified data
record from the MDM Hub. It also makes use of the tMDMCommit and tMDMRollback components so
that changes to the database are only made on successful completion of the Job.

tMDMDelete_1.png

Dropping and linking the components

  1. Drop tMDMConnection, tMDMCommit, tMDMClose, tMDMInput, tMDMDelete, and
    tMDMRollback from the
    Talend MDM
    family from the
    Palette onto the design workspace.
  2. Connect tMDMInput to tMDMDelete using a Row > Main link.
  3. Connect tMDMConnection to tMDMInput using a Trigger > OnSubjobOk link.
  4. Connect tMDMDelete to tMDMCommit, tMDMCommit to tMDMClose and tMDMRollback to
    tMDMClose using Trigger > OnComponentOk links.
  5. Connect tMDMDelete to tMDMRollback using a Trigger > OnComponentError link.

Configuring the MDM server connection

In this scenario, a tMDMConnection component is used to
open an MDM server connection for convenient reuse in the subsequent subJob that performs
the data record deletion task.

  1. Double-click tMDMConnection to display its
    Basic settings view and define the component
    properties.

    tMDMDelete_2.png

  2. In the URL field, enter the MDM server URL, between
    quotation marks: for example,
    “http://localhost:8180/talendmdm/services/soap”.
  3. In the Username and Password fields, enter your user name and password to connect to the MDM
    server.
  4. Double-click tMDMCommit to display its Basic settings view and define the component properties.

    tMDMDelete_3.png

    This component commits the changes made to the database on successful completion of
    the proceeding subJob.
  5. From the Component List list, select the component
    for the server connection you want to close if you have configured more than one MDM
    server connection. In this use case, there is only one MDM server connection open, so
    simply use the default setting.
  6. Deselect the Close Connection check box if it is
    selected. In this example, the tMDMClose component
    closes the connection to the MDM Server.
  7. Double-click tMDMRollback to display its Basic settings view and define the component properties.

    tMDMDelete_4.png

    This component rolls back any changes and returns the database to its previous state
    if the proceeding subJob fails.
  8. From the Component List list, select the component
    for the server connection you want to close if you have configured more than one MDM
    server connection. In this use case, there is only one MDM server connection open, so
    simply use the default setting.
  9. Deslect the Close Connection check box if it is
    selected. In this example, the tMDMClose component
    closes the connection to the MDM Server.
  10. Double-click tMDMClose to display its Basic settings view and define the component properties.

    The tMDMClose component is used to close the
    connection after the successful execution of the Job. You can also close the
    connection by selecting the Close Connection check
    box in the tMDMCommit and tMDMRollback components, but for the purposes of this scenario the
    tMDMClose component is used instead.

    tMDMDelete_5.png

  11. From the Component List list, select the component
    for the server connection you want to close if you have configured more than one MDM
    server connection. In this use case, there is only one MDM server connection open, so
    simply use the default setting.

Configuring data retrieval

  1. Double-click tMDMInput to display its Basic settings view and define the component properties.

    tMDMDelete_6.png

  2. From the Property Type list, select Built-in to complete the fields manually.

    If you have stored the MDM connection information in the repository metadata, select
    Repository from the list and the fields will be
    completed automatically.
  3. From the Schema list, select Built-in and click […] next to
    Edit schema to open a dialog box.

    Here you can define the structure of the master data you want to read in the MDM
    hub.
    tMDMDelete_7.png

  4. The master data is collected in a three-column schema of the type String: Id, Name and
    Price. Click OK to close the
    dialog box and proceed to the next step.
  5. Select the Use an existing connection check box,
    and from the Component List list that appears, select
    the component you have configured to open your MDM server connection.

    In this scenario, only one MDM server connection exists, so simply use the default
    selection.
  6. In the Entity field, enter the name of the business
    entity that holds the data record(s) you want to read, between quotation marks. Here, we
    want to access the Product entity.
  7. In the Data Container field, enter the name of the
    data container that holds the master data you want to read, between quotation marks. In
    this example, we use the Product container.

    Note:

    The Use multiple conditions check box is selected
    by default.

  8. In the Operations table, define the conditions to
    filter the master data you want to delete as follows:

    1. Click the plus button to add a new line.
    2. In the Xpath column, enter the Xpath and the tag
      of the XML node on which you want to apply the filter, between quotation
      marks. This example works with the Product
      entity, so enter “Product/Name”.
    3. In the Function column, select the function you
      want to use. In this scenario, use the Contains function.
    4. In the Value column, enter the
      value of your filter. This example is to filter the master data where
      the Name contains mug.
  9. In the Component view, click Advanced settings to set the advanced parameters.

    tMDMDelete_8.png

  10. In the Loop XPath query field, enter the structure
    and the name of the XML node on which the loop is to be carried out, between quotation
    marks.
  11. In the Mapping table and in the XPath query column, enter the name of the XML tag in which you
    want to collect the master data, next to the corresponding output column name, between
    quotation marks.

Configuring data record deletion

  1. In the design workspace, double-click the tMDMDelete component to display the Basic
    settings
    view and set the component properties.

    tMDMDelete_9.png

  2. From the Schema list, select Built-in and click the three-dot button next to the Edit Schema field to describe the structure of the master data in the MDM
    hub.

    tMDMDelete_10.png

  3. Click the plus button to the right to add one column of the type String. In this example, name this column
    outputXML. Click OK to close the
    dialog box and proceed to the next step.
  4. Select the Use an existing connection check box,
    and from the Component List list that appears, select
    the component you have configured to open your MDM server connection.

    In this scenario, only one MDM server connection exists, so simply use the default
    selection.
  5. In the Entity field, enter the name of the business
    entity that holds the master data you want to delete, the Product
    entity in this example.
  6. In the Data Container, enter the name of the data
    container that holds the data to be deleted, Product in this
    example.
  7. In the Keys table, click the plus button to add a
    new line. In the Keys column, select the column that
    holds the key of the Product entity. Here, the key of the
    Product entity is set on the Id field.

    Note:

    If the entity has multiple keys, add as many line as required for the keys and
    select them in sequential order.

  8. If needed, select the Fire Delete event check box,
    so that the delete event will be generated and written into UpdateReport.
  9. Select the Logical delete check box if you do not
    want to delete the master data permanently. This will send the deleted data to the
    Recycle bin. Once in the Recycle bin, the master data can be restored or permanently
    deleted. If you leave this check box clear, the master data will be permanently
    deleted.

Saving and executing the Job

  1. Press Ctrl+S to save your Job to ensure that all
    the parameters you have configured take effect.
  2. Press F6 to execute your Job.

The master data with the Name containing “mug” have been deleted and sent to MDM Recycle
bin.


Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x