Skip to content

Commit

Permalink
Merge pull request #3750 from atlanhq/mesh-280-validation
Browse files Browse the repository at this point in the history
MESH-280 : Validation for dataProductAssetDSL attribute
  • Loading branch information
PRATHAM2002-DS authored Nov 15, 2024
2 parents 3ab829f + e3b2295 commit 4eefe0b
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 4eefe0b

Please sign in to comment.