Skip to content

Commit

Permalink
mesh-280: validation for dataProductAssetDSL attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
PRATHAM2002-DS committed Nov 15, 2024
1 parent e928462 commit e3b2295
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public class PreProcessorUtils {
public static final String INPUT_PORT_GUIDS_ATTR = "daapInputPortGuids";
public static final String DAAP_STATUS_ATTR = "daapStatus";
public static final String DAAP_ARCHIVED_STATUS = "Archived";
public static final String DAAP_ASSET_DSL_ATTR = "dataProductAssetsDSL";

//Migration Constants
public static final String MIGRATION_TYPE_PREFIX = "MIGRATION:";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ private void processCreateProduct(AtlasEntity entity,AtlasVertex vertex) throws
entity.removeAttribute(OUTPUT_PORT_GUIDS_ATTR);
entity.removeAttribute(INPUT_PORT_GUIDS_ATTR);

if(!entity.hasAttribute(DAAP_ASSET_DSL_ATTR) && entity.getAttribute(DAAP_ASSET_DSL_ATTR) == null){
throw new AtlasBaseException(AtlasErrorCode.BAD_REQUEST, "DataProductAssetDSL attribute is mandatory for DataProduct creation");
}

if (parentDomainObject == null) {
throw new AtlasBaseException(OPERATION_NOT_SUPPORTED, "Cannot create a Product without a Domain Relationship");
} else {
Expand Down

0 comments on commit e3b2295

Please sign in to comment.