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

Make displayName deprecated for Process type, adjust Asset Catalog to check for active status #7652

Merged
merged 5 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -18,6 +18,7 @@
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDef;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefAttribute;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefAttributeStatus;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefLink;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper;
import org.odpi.openmetadata.repositoryservices.ffdc.exception.TypeErrorException;
Expand Down Expand Up @@ -155,7 +156,8 @@ public boolean hasDisplayName(String userId, String typeDefGUID) throws InvalidP
if (allPropertiesForTypeDef == null) {
return false;
} else {
return allPropertiesForTypeDef.stream().anyMatch(property -> property.getAttributeName().equals(DISPLAY_NAME));
return allPropertiesForTypeDef.stream().anyMatch(property -> property.getAttributeName().equals(DISPLAY_NAME)
&& property.getAttributeStatus().equals(TypeDefAttributeStatus.ACTIVE_ATTRIBUTE));
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.RelationshipEndCardinality;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.RelationshipEndDef;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefAttribute;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefAttributeStatus;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefPatch;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefStatus;
import org.odpi.openmetadata.repositoryservices.ffdc.OMRSErrorCode;
Expand Down Expand Up @@ -172,6 +173,7 @@ public void getOriginalTypes()
update0423SecurityAccessControl();
update504ImplementationSnippets();
update0710DigitalServices();
update0010BaseModel();
}


Expand Down Expand Up @@ -773,6 +775,42 @@ private void update0710DigitalServices()
this.archiveBuilder.addTypeDefPatch(updateDigitalProductClassification());
}

private void update0010BaseModel() {
this.archiveBuilder.addTypeDefPatch(updateProcess());
alexandra-bucur marked this conversation as resolved.
Show resolved Hide resolved
}

private TypeDefPatch updateProcess() {
/*
* Create the Patch
*/
final String typeName = "Process";

TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName);

typeDefPatch.setUpdatedBy(originatorName);
typeDefPatch.setUpdateTime(creationDate);

/*
* Build the attributes
*/
List<TypeDefAttribute> properties = new ArrayList<>();
TypeDefAttribute property;

final String attributeName = "displayName";
final String attributeDescription = "Display name of the process";
final String attributeDescriptionGUID = null;

property = archiveHelper.getStringTypeDefAttribute(attributeName,
attributeDescription,
attributeDescriptionGUID);
property.setAttributeStatus(TypeDefAttributeStatus.DEPRECATED_ATTRIBUTE);
properties.add(property);

typeDefPatch.setPropertyDefinitions(properties);

return typeDefPatch;
}


private TypeDefPatch updateDigitalProductClassification()
{
Expand Down