| Back | Main view

How to check if entity exists using IMiS/Storage Connector JAVA

Product:IMiS/Storage Connector JAVA
Release:10.3.2210
Date:02/07/2023

Case: How to check if entity exists using IMiS/Storage Connector JAVA

Description:

This example demonstrates operations which checks if entity stub exists on IArchive and Storage on the IMiS/ARChive Server.

Below is a description of operation for checking if entity exists.


Check if entity with classification code exists

Operation gets entity stub with classification code "C=3^C=143^D=311/2023" on IMiS/ARC archive, if there is no exception entity exists; otherwise entity does not exists or entity is not visible to the user.

JAVA

IArchive archive = null;
String classificationCode = "C=3^C=143^D=311/2023";

try {
  IEntityStub entityStub = archive.getEntityInfo(EntityIdKind.CLASSIFICATION_CODE, classificationCode);
  System.out.println("Entity with classificationCode:'" + classificationCode + "' exists");
}
catch (Exception e) {
  e.printStackTrace();
  System.out.println(e.getMessage());
  System.out.println("Entity with classificationCode:'" + classificationCode + "' does not exists");
}



Related Documents:



| Back | Main view