ETL Tasks Add Complex Rules Manually

Prev Next

This topic relates to the following sections:

Overview

ETL Jobs are accessed from all four levels of the Mappings page. Each ETL icon when clicked displays that level of the overall ETL Job with rows of Job Tasks all linked together.

View the following page by navigating to Migrate > Mappings on the Syniti Migrate Homepage.

Mappings

At each level of the Mappings page the ETL icon servers to execute the job and process the list of tasks assigned. New tasks may be added for each level and the process for adding them uses the same pages. The ETL Tasks maybe be assigned to a field in the mapping, but they can also be independent of field mapping. This section provides the details for adding tasks to a Transform grid.

The user ensures that the view is complete - the system auto generates each view as they are added as Tasks, but they all must be completed and accurate for successful use. During execution, either the entire source set of Tasks may be run, or each individual task.

In the case of an Update, Insert, or Delete rule, these may be run against any working database in the current server. The fields Affected Datasource and Affected Table designate the target of the rule and can apply to working databases. The views are stored in the Rule Datasource (working database of the object), however, they pull from a different or Affected Datasource (any other database of same server).

Note

The Breadcrumb path in the header links to higher levels of the ETL Job chain. The user may jump up from Source to Target or to the Dataset level details for ETL Tasks with a click on the task name.

Mappings: Source: ETL Job List: Transform a Source Task list

At this level, the Transform a Source may be run as a Job with each active tasks run in the sequence provided, or the individual task may be run. Click the Execute icon within the header to run all tasks, or click on the Execute icon for the specific task.

Within header of this page there are Quick Use icons:

Icon

Name

Use

ETL Build

Generates build for ETL Tasks at this level. This icon is available only for the DEV environment.

View Mapping

Click to change pages to view the related mappings of this object

Add

This icon adds a new task to the current Task Type

Refresh

Refresh updates the page to the latest data

Search

Allows for a search of the Tasks grid by Column

Execute

The execute icon in header processes the list of tasks in the sequence shown.

The ETL Job grid displays the following Columns:

Heading

Description

Index

Sequence of the Task Types. Value increases by factor of 10 for each new entry.

Active

Toggle to set status of the Task Type. NOTE: Defaults as Active.

Execute

The Execute icon is active for each row of Job Tasks.

Description

The description for this Dataset.

Task Type

The type of task being run. Ex: Insert Rule, Update Rule, Stored Procedure, Refresh Snapshot Table

Action

Action performed against this Task Type.

Action Description

Provides the scripting of the Task Type or rule name.

Target

The Target affected by this Task Type.

Data Element

The field affected by this Task Type.

Affected Object

The table affected by the Task Type.

Comment

Text to provide details for the task.

Record Count

Count of records affected by the last run.

Duration

Duration of the last run.

Status Message

Text to provide additional details for the processing of this task.

Datasource

The Database affected by this Task Type.

Status

Overall status of this Task Type.

ETL Tasks for Mapping Rule

From the Mappings page, click on Mapping icon in the row for the Target Source to view current mappings. Click a mapping where Mapping Action = Rule to view the details for the mapping.

Mappings: Mapping Details

Click the ETL Tasks (x) button to view the ETL Tasks assigned to this field. Due to the assignment of ETL tasks to specific versions, there may be multiple tasks for the same update by version.

Mappings: Mapping Details: ETL Tasks for Mapping Rules

The ETL Tasks for Mapping Rule grid displays the following Columns:

Heading

Description

Active

Toggle to set status of the Task Type. NOTE: Defaults as Active.

Version

Version that this mapping rule applies to.

Description

The description for this task.

Task Type

The type of task being run. Ex: Insert Rule, Update Rule, Stored Procedure, Refresh Snapshot Table

Record Count

Count of records affected by the last run.

Duration

Duration of the last run.

Status Message

Text to provide additional details for the processing of this task.

Tasks may be added within ETL Tasks for Mapping Rule by clicking the icon to build a Complex Rule of various task types.

Mappings: ETL Tasks: SQL Rule Add

Section

Field

Description of Use

Task Details

Task Type

Type of task (Delete Rule, Insert Rule, Update Rule)

Task Details

Rule Datasource*

Database used for this rule. (Construct or working databases)

Task Details

Rule View*

Enter the View name based upon standards.

Task Details

Affected Datasource*

Database that is affected by this rule.

Task Details

Affected Table*

Table Name affected by this rule.

Task Details

Mapping Field

Field within mapping that is affected by this rule. (Ties the task to the mapping field and updates count of ETL Tasks)

Task Details

Timeout in Seconds

Allows for setting a timeout for running the ETL Task.

Task Details

Description*

Description for the task. (Required)

Task Details

Comment

Additional comments for the task.

Task Details

Active

Toggle to mark this row as active.

Task Details

Index

Sequence of the Datasets. Value increases by factor of 10 for each new entry.

Note

When saving a new task, the Description is defaulted to be the same as the Task Rule (the name of the view or procedure) if the value is left blank.

There are unlimited amounts of updates that may be made against each field in the Mappings page for Rules. Once the new Rule is saved, it displays in a grid for ETL Tasks for Mapping Rules page as shown below.

Mappings: Mapping Details: ETL Tasks for Mapping Rules

The ETL Rules grid displays the following Column Headers:

Header

Description

Active

Toggle to mark the ETL Rule as Active/Inactive for use.

Note

Defaults as active.

Version

Indicates the Milestone for ETL Version Selected.

Description

Name of the Stored Procedure used for this Rule.

Task Type

Describes the type of task being run. Ex: Rule, Source Truncate, Source XRef

Execution Method

Describes how the task is executed. Ex: PROCEDURE, REFRESH_POSTLOAD_REPORTS RUN_ETL_BY_ID

Record Count

Provides the count of rows affected by the task.

Duration

Provides the duration of the last execution of this task.

Status Message

Provides details of the status if the task is not executed successfully.

Edit a Complex Rule

A click on the Edit  icon provides a window to make changes to the Description, Comment or any of the fields within section Execution. The Active toggle may be updated from the grid.

Mappings: Data Mapping Details of a Rule: ETL Rules: Edit a Rule

Within the details for ETL Rules, the user may alter the field values as described below.

Section

Field

Definition

Task Details

Task Type

Describes the type of task being run. Ex: Rule, Source Truncate, Source XRef

Task Details

Rule Datasource*

The datasource for this task. (Required)

Task Details

Rule View*

The name of the view used for this task. (Required)

Task Details

Affected Datasource*

Select from the list the Datasource in which this ETL Rule resides. (Required)

Task Details

Affected Table*

The working table where this task is run. (Required)

Task Details

Mapping Field

The mapping field for this task.

Task Details

Timeout in Seconds

Allows for limiting the time that this task runs.

Task Details

Description*

Description of the task. (Required)

Task Details

Comment

Additional text to further describe the ETL Rule.

Task Details

Active

Toggle to mark the ETL Rule as Active/Inactive for use.

Note

Defaults field as active.

Task Details

Index

Sequence of the ETL Rule. Value increases by factor of 10 for each new entry.

Status

Validation Status

System generated status for the ETL Rule.

Status

Executed On

System generated date of the last execution of this ETL Rule.

Status

Record Count

System generated count of the rows processed in this ETL Rule.

Status

Duration

System generated duration of the last execution of this ETL Rule.

Status

Status Message

System generated details of the status if the task is not executed successfully.

Audit

Various

These fields are all display only and are updated by actions.

Click the Rule DDL tab to view the DDL script for the ETL Task. You can run the DDL script to see if it returns correct data as expected. The script may be opened in SQL Editor for use in testing in the database.

Mappings: Data Mapping Details of a Rule: ETL Rules: Edit a Rule: Rule DDL tab

When finished with edits, click the Save  icon to complete.

Add a Complex Rule Manually

While viewing the ETL Tasks for Mapping Rule page, click the Add  icon to create a new Complex Rule. In this example, select Task Type = Update Rule. In this scenario, the rule updates the value based upon only a view that sets up Fieldname and Fieldname_New. The Task for this type of Rule includes scripting to UPDATE value to Fieldname_New as shown below.

Note

Methodology for Naming of these SQL Complex Rules -

View - <WORKING_TABLE>_Upd_<TARGET_FIELD> _SEL

Note

Within the database, the user completes the View for update and the ETL Job Tasks perform the Update as part of the job. There is no need to build a Stored Procedure for any of the Task Types. The scripting for the correct type of task is determined by the Task Type (Insert, Delete, Update as example).

Note

The Datasource filters to appropriate list for these as CONSTRUCT or a working database. For a Refresh Snapshot Table task type, the Datasource filters to only Snapshot Datasources.

Note

When adding a Complex Rule to the ETL Jobs Task List directly, the user MUST update field Mapping Field within the details to tie that field back to the Field Mapping. Otherwise, the rule is not counted or included in the ETL Tasks for which the field is being built.

Examples of Job Task Types

The details page used in adding a new task to the ETL Task List is dynamic and the fields and requirements change based upon the Task Type entered. This image below is of the Edit ETL Task window before task type is assigned. The system defaults in field values that apply based upon the Datasource, working database, and working table name for this window.

Target Source: ETL: Edit ETL Task

Delete Rule

Although the ETL auto generator builds a Delete Rule during the initial access, the user may mark that one as inactive (Do Not Delete the auto generated Delete rule as it builds again) and manually add a new task as Task Type = Delete Rule. This action type runs the view against a Delete stored procedure based upon the Key fields and filtering of records.

The Delete Rule could apply to the Working or Target tables in an effort to remove rows of data that are not needed. First, create a View containing the Primary Key Fields that filter data to the list to delete, and register that view within this rule as a Rule Name*. The associated Mapping Field should be identified to link this delete to a mapping field but is not required. However, the Affected Table needs to reference the working or target table for the deletion and the Affected Datasource must point to the correct database that stores this table. The delete rule may be set against any datasource in the database system.

Note

Refer to section Cross Database or Cross Server ETL Rules for Delete, Insert, or Update below for setting up a rule that runs within one server to update a table in another server.

Note

If the Rule Datasource or Affected Datasource are pointing to a Working database within the Edit ETL Task details, it must be defined within the Version database as well or running the ETL against that version fails.

Target Source: ETL: Edit ETL Task: Delete Rule

Section

Field

Description of Use

Task Details

Task Type

Type of task

Task Details

Rule Datasource*

Datasource where rule is stored. (Required)

Task Details

Rule View*

Database view name for rule. (Required)

Task Details

Affected Datasource*

Database where update is made. (Required)

Task Details

Affected Table*

Table with the Affected Datasource for the Rule. (Required)

Task Details

Mapping Field

Field against which this task is run.

Task Details

Timeout in Seconds

Allows for limiting the time that this task runs.

Task Details

Description*

Description for the task.(Required)

Task Details

Comment

Additional comments for the task.

Task Details

Active

Toggle to mark this row as active.

Task Details

Index

Sequence of the Datasets. Value increases by factor of 10 for each new entry.

Status

Validation Status

Status of the rule post running the ETL.

Status

Executed On

Date of last run for this task.

Status

Record Count

Count of records affected by this task during the last run.

Status

Duration

Time in Minutes for the last run.

Status

Status Message

Error message produced based upon last run.

Audit

Various Fields

These are the system generated values for auditing the work.

Insert Rule

Although the ETL auto generator builds an Insert Rule during the initial access, the user may mark that one as inactive (Do Not Delete the auto generated Insert rule as it builds again) and manually add a new task as Task Type = Insert Rule. Make sure to validate that the Affected Datasource and Affected Table field are pointing to the correct database and table for this insert. This action type runs the view against an Insert stored procedure based upon the Primary Key Fields and filtering of records.

The auto generated Insert Rule inserts all legacy fields from Datasource as well as make updates to mappings as follows:

  • All Default rules insert the default value to the mapped field during the Insert Rule.

  • All Simple Copy rules insert the copied field value in the mapped field during the Insert Rule.

Note

Refer to section Cross Database or Cross Server ETL Rules for Delete, Insert, or Update below for setting up a rule that runs within one server to update a table in another server.

Note

A Simple Copy rule copies the value of a field within the Datasource / Table being mapped. Any other Datasource / Tables would become a Complex Copy rule and would require an auto generated Update Rule build.

Note

If the Rule Datasource or Affected Datasource are pointing to a Working database within the Edit ETL Task details, it must be defined within the Version database as well or running the ETL against that version fails.

Target Source: ETL: Edit ETL Task: Insert Rule

Section

Field

Description of Use

Task Details

Task Type

Type of task.

Task Details

Rule Datasource*

Datasource where rule is stored. (Required)

Task Details

Rule Name*

Database view name for rule. (Required)

Task Details

Affected Datasource*

Database where update is made. (Required)

Task Details

Affected Table*

Table with the Affected Datasource for the Rule. (Required)

Task Details

Mapping Field

Select from the list a field for insert.

Task Details

Timeout in Seconds

Allows for limiting the time that this task runs.

Task Details

Description

Description for the task.

Task Details

Comment

Additional comments for the task.

Task Details

Active

Toggle to mark this row as active.

Task Details

Index

Sequence of the Datasets. Value increases by factor of 10 for each new entry.

Status

Validation Status

Status of the rule post running the ETL.

Status

Executed On

Date of last run for this task.

Status

Record Count

Count of records affected by this task during the last run.

Status

Duration

Time in Minutes for the last run.

Status

Status Message

Error message produced based upon last run.

Audit

Various Fields

These are the system generated values for auditing the work.

After the Insert Rule is saved successfully, the details of the Insert Rule scripting is available in the Rule SQL field.

Note

The database view must be maintained within the database. Migration ETL is for storage and use of these views and procedures.

Refresh Snapshot Table

This can be useful for READ BACKS during post load processing, or if you are loading an object that is dependent on other people loading SAP data. So refreshing some target tables might be necessary during the execution of your own job.

Target Source: ETL: Edit ETL Task: Refresh Snapshot Table

Section

Field

Description of Use

Task Details

Task Type

Type of task.

Task Details

Datasource*

Snapshot datasource. (Required)

Task Details

Snapshot Table*

Snapshot datasource table. (Required)

Task Details

Description

Description for the task.

Task Details

Comment

Additional comments for the task.

Task Details

Active

Toggle to mark this row as active.

Task Details

Index

Sequence of the Datasets. Value increases by factor of 10 for each new entry.

Status

Validation Status

Status of the rule post running the ETL.

Status

Executed On

Date of last run for this task.

Status

Record Count

Count of records affected by this task during the last run.

Status

Duration

Time in Minutes for the last run.

Status

Status Message

Error message produced based upon last run.

Audit

Various Fields

These are the system generated values for auditing the work.

When the task is run, it produces a job queue step as shown below:

Target Source: ETL: Edit ETL Task: Refresh Snapshot Table

Update Rule

Update Rule task type is the most frequently used rule. Any updates to fields that are outside of the basic copy, default, or the auto generated Rule requires an Update Rule task added to the ETL job list. Build an update View within the database including the Primary Key Fields and filtering prior to adding the new task to the ETL Job list. For this rule it is very important that the field Mapping Field contains the value for the field being mapped. This way any new Update Rules added displays in the ETL Tasks list for the field in the Mappings page. The View should be based upon a Field / Field_New for each field updated (SET FIELD = V.FIELD_NEW)

Note

If the Rule Datasource or Affected Datasource are pointing to a Working database within the Edit ETL Task details, it must be defined within the Version database as well or running the ETL against that version fails.

Note

Refer to section Cross Database or Cross Server ETL Rules for Delete, Insert, or Update below for setting up a rule that runs within one server to update a table in another server.

Target Source: ETL: Edit ETL Task: Update Rule

Section

Field

Description of Use

Task Details

Task Type

Type of task.

Task Details

Rule Datasource*

Datasource where rule is stored. (Required)

Task Details

Rule View*

Database view name for rule. (Required)

Task Details

Affected Datasource*

Working database where update is made. (Required)

Task Details

Affected Table*

Working Table for the object. (Required)

Task Details

Mapping Field

Target field in Mapping.

Task Details

Timeout in Seconds

Allows for limiting the time that this task runs.

Task Details

Description

Description for the task.

Task Details

Comment

Additional comments for the task.

Task Details

Active

Toggle to mark this row as active.

Task Details

Index

Sequence of the Datasets. Value increases by factor of 10 for each new entry.

Status

Validation Status

Status of the rule post running the ETL.

Status

Executed On

Date of last run for this task.

Status

Record Count

Count of records affected by this task during the last run.

Status

Duration

Time in Minutes for the last run.

Status

Status Message

Error message produced based upon last run.

Audit

Various Fields

These are the system generated values for auditing the work.

After the Update Rule is saved successfully, the details window may be accessed to view the Rule DDL tab for details of the Update Rule scripting.

Note

The database view must be maintained within the database. Migration ETL is for storage and use of these views and procedures.

Target Source: ETL: Edit ETL Task: Update Rule: Rule DDL scripting

Within header of this page there are Quick Use icons:

Icon

Name

Use

View Mapping

Click to change pages to view the related mappings of this object.

Copy

This icon copies the data into a new Task.

Save

Saves the current updates to system.

Cancel

Cancels the current action without saving.

Stored Procedure

The user clicks on the Add  icon to create a new Complex Rule. In this example, select Task Type = Stored Procedure. In this scenario, the rule updates the value based upon a view and stored procedure. The Task for this type of Rule is the Name of the stored procedure that updates the field. In this case, the Stored Procedure updates the data and not the system.

Note

Methodology for Naming of these Procedure Complex Rules -

        SP -  <WORKING_TABLE>_Upd_<TARGET_FIELD>

        View - <WORKING_TABLE>_Upd_<TARGET_FIELD> _SEL

Note

Within SQL Server database, the user manually build out the View for update and Stored Procedure.

Mappings: ETL Tasks: Stored Procedure: Rule Add

Section

Field

Description of Use

Task Details

Task Type

Type of task  = Stored Procedure

Task Details

Rule Datasource*

Database used for this rule. (CONSTRUCT or working databases) (Required)

Task Details

Rule View*

Enter the View name based upon standards. (Required)

Task Details

Mapping Field

Field within mapping that is affected by this rule. (this ties the Task to the Mapping field and updates count of ETL Tasks)

Task Details

Timeout in Seconds

Allows for limiting the time that this task runs.

Task Details

Description*

Description for the task. (Required)

Task Details

Comment

Additional comments for the task.

Task Details

Active

Toggle to mark this row as active.

Task Details

Index

Sequence of the Datasets. Value increases by factor of 10 for each new entry.

Cross Database or Cross Server ETL Rules for Delete, Insert, or Update

You can create and execute cross-server ETL tasks (for Delete, Insert, or Update) anytime you need to manipulate data from one server to a second or remote server. For example, when you have a SAP HANA or PostgreSQL working database where CONSTRUCT is on a remote database, or when the Migration Working Server (any working database type) is inserting into the SAP HANA LTMC (Migration Cockpit) staging database.

In this situation, use an ETL Task with the following fields, which allow ETL rules to pull data from one server to alter a table in another server:

  • Rule Datasource contains the database where the Rule is run.

  • Affected Data Source stores the database of the table that is affected.

  • Affected Table is the table from the Affected Data Source.

These Datasources are setup within the Datasources to point to the server.

Mappings: ETL Tasks: Insert Rule: Cross Database

The cross database rule displays as XSERVER INSERT type.

Mappings: ETL Tasks: Insert Rule: Cross Database