Self-Solve Knowledge Search

Minimize Maximize
“No enum constant” error when attempting to use custom masking function
This document has not been formally reviewed for accuracy and is provided as is
Title :
“No enum constant” error when attempting to use custom masking function
Document ID :
KM02294649
Product - Version:
structured data manager ;
OS :
Updated :
Wed May 04 21:30:55 GMT 2016
Summary :
“No enum constant” error when attempting to use custom masking function at Non-Intrusive Environment (Groovy Script).
Problem

"No enum constant” error when attempting to use custom masking function

Error message from log:

 016-04-28 11:13:41,502        : INFO        : Extract data from database to backend directly thread 0        : root        : Failed to execute task due to: No enum constant com.outerbay.foundation.components.datamovers.lw2.datasource.db.JavaColumnMasking.MASKING_FUNCTION.Masking.groovy

2016-04-28 11:13:41,502        : INFO        : Extract data from database to backend directly thread 0        : root        : Executed task [DB_TO_BE_DIRECT] in 3055 ms

2016-04-28 11:13:41,502        : WARN        : Extract data from database to backend directly thread 0        : root        : Exception in Task

com.outerbay.comp.jobengine.TaskException: com.outerbay.foundation.components.datamovers.tasks.DescriptorTaskException: No enum constant com.outerbay.foundation.components.datamovers.lw2.datasource.db.JavaColumnMasking.MASKING_FUNCTION.Masking.groovy

at com.outerbay.comp.jobengine.workflow.TaskWrapper.execute(TaskWrapper.java:83)

at com.outerbay.comp.jobengine.Worker.run(Worker.java:159)

at java.lang.Thread.run(Thread.java:745)

Caused by: com.outerbay.foundation.components.workflowdao.WorkflowTaskException: com.outerbay.foundation.components.datamovers.tasks.DescriptorTaskException: No enum constant com.outerbay.foundation.components.datamovers.lw2.datasource.db.JavaColumnMasking.MASKING_FUNCTION.Masking.groovy

at com.outerbay.foundation.components.datamovers.tasks.DescriptorTask.execute(DescriptorTask.java:129)

at com.outerbay.comp.jobengine.workflow.TaskWrapper.execute(TaskWrapper.java:67)

... 2 more

Caused by: com.outerbay.foundation.components.datamovers.tasks.DescriptorTaskException: No enum constant com.outerbay.foundation.components.datamovers.lw2.datasource.db.JavaColumnMasking.MASKING_FUNCTION.Masking.groovy

at com.outerbay.foundation.components.datamovers.tasks.DescriptorTaskException.wrapException(DescriptorTaskException.java:40)

at com.outerbay.foundation.components.datamovers.tasks.DescriptorTask.executeTask(DescriptorTask.java:280)

at com.outerbay.foundation.components.datamovers.tasks.DescriptorTask.execute(DescriptorTask.java:121)

... 3 more

Caused by: java.lang.IllegalArgumentException: No enum constant com.outerbay.foundation.components.datamovers.lw2.datasource.db.JavaColumnMasking.MASKING_FUNCTION.Masking.groovy

at java.lang.Enum.valueOf(Enum.java:236)

at com.outerbay.foundation.components.datamovers.lw2.datasource.db.JavaColumnMasking$MASKING_FUNCTION.valueOf(JavaColumnMasking.java:24)

at com.outerbay.foundation.components.datamovers.lw2.datasource.db.ColumnMaskBuilder.createMaskingMethod(ColumnMaskBuilder.java:97)

at com.outerbay.foundation.components.datamovers.lw2.datasource.db.ColumnMaskBuilder.prepareMasking(ColumnMaskBuilder.java:62)

at com.outerbay.foundation.components.datamovers.lw2.datasource.db.ColumnMaskBuilder.prepareMaskingForChildTables(ColumnMaskBuilder.java:75)

at com.outerbay.foundation.components.datamovers.lw2.datasource.db.ColumnMaskBuilder.createColumnMaskBuilder(ColumnMaskBuilder.java:37)

at com.outerbay.foundation.components.datamovers.lw2.datasource.db.DatabaseExtractor.prepare(DatabaseExtractor.java:69)

at com.outerbay.foundation.components.datamovers.lw2.datasource.db.RootDatabaseExtractor.prepare(RootDatabaseExtractor.java:81)

at com.outerbay.foundation.components.datamovers.lw2.datasource.db.RootDatabaseExtractor.createDrivingTableUseExtractor(RootDatabaseExtractor.java:54)

at com.outerbay.foundation.components.datamovers.lw2.datasource.db.DatabaseExtractionBuilder.createRootExtractor(DatabaseExtractionBuilder.java:51)

at com.outerbay.foundation.components.datamovers.lw2.ExtractionBuilder.prepareRootExtractor(ExtractionBuilder.java:202)

at com.outerbay.foundation.components.datamovers.lw2.ExtractionBuilder.createExtraction(ExtractionBuilder.java:123)

at com.outerbay.ea.datamovement.tasks.LWTaskExecutor.execute(LWTaskExecutor.java:252)

at com.outerbay.ea.datamovement.tasks.LWArchiveExtractDescriptorTask.execute(LWArchiveExtractDescriptorTask.java:42)

at com.outerbay.foundation.components.datamovers.tasks.DescriptorTask.executeTask(DescriptorTask.java:256)

... 4 more

Cause

The Groovy Script must be placed at:

<install_dir>/obt/extensions/runtime/masking

At Designer, when add the groovy use the filename without extension.

Fix
  1. Create a Groovy script that includes the following signature:
    Object mask(Object param);
  2. Copy the Groovy script into the folder:

    <install_dir>/obt/extensions/runtime/masking

  3. In Designer, click the Data Masking tab in the cartridge and then click Custom Masks.

Custom

4.   Click Add and type the filename (case-sensitive) without any extension (.grovvy) of your Groovy script in the Custom Data Masking dialog, then click OK.

 Add


5. Then add the custom script to the columns: 

ssign


For further information you can access
HP Structured Data Manager Developer’s Guide 60-61