Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MESH-280 : Validation for dataProductAssetDSL attribute #3749

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading