The [error] variable does not persist in an [onAfter] script in a transform map.

Steps to Reproduce


1) create a data source into [sys_user] table with the following sample csv file as attachment:
email,first name,last name,user_name,Abel,Tuter1,abel.tuter,Kevin,Owens1,abel.tuter 
Note that the second user has the first user's user_name and this will cause a duplicated key error when inserting. 
2) Create a new transform map:
    a) coalesce on [email] so they are treated as two different records, map the [user_name] to [sys_user].[user_name]
    b) create an new [onAfter] script with the following script:'# - OnAfter: Email: '+ source.u_email + ', error: ' + error)
3) Run the import and transform.
4) Expect a duplicated key error.
Expected Results: error variable is printed as [true] 
Actual Results: error variable is printed as [false], the [error] value does not persist.


This is expected behaviour. The [error] variable is not set to true while running the transformation in case of an error. It is available in a script to be able to stop the transformation.


Transformation script variables

Field map script variables


Related Problem: PRB633362

Seen In

Dublin Patch 8

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2019-05-21 11:34:26