Skip to content

Commit

Permalink
Merge pull request #7652 from alexandra-bucur/active-status-display-name
Browse files Browse the repository at this point in the history
Make displayName deprecated for Process type, adjust Asset Catalog to check for active status
  • Loading branch information
Alexandra Bucur authored May 11, 2023
2 parents 870dc74 + 4820517 commit 2592d6e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
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,44 @@ private void update0710DigitalServices()
this.archiveBuilder.addTypeDefPatch(updateDigitalProductClassification());
}

private void update0010BaseModel()
{
this.archiveBuilder.addTypeDefPatch(updateProcess());
}

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

0 comments on commit 2592d6e

Please sign in to comment.