Searching for Deployed Runtime Artifacts

To search for Runtime Artifacts applying to specific criteria, you can use the DeployedRuntimeArtifactQuery on the QueryService.

Creating Queries for Deployed Runtime Artifacts matching specific Attributes

With the Infinity Process Platform DeployedRuntimeArtifactQuery you can create queries to search for DeployedRuntimeArtifacts matching specified attributes.

To restrict the query to currently active artifacts use the findActive factory methods described below.

Finding all Runtime Artifacts

Use method findAll to create a query for finding all runtime artifacts.

public static DeployedRuntimeArtifactQuery findAll()
{
   DeployedRuntimeArtifactQuery query = new DeployedRuntimeArtifactQuery();

   return query;
}

Finding all currently active Runtime Artifacts ordered descending by a given Date

Method findAllActive(Date activeAt) creates a query for finding all currently active runtime artifacts ordered descending by a given date.

public static DeployedRuntimeArtifactQuery findAllActive(Date activeAt)
{
   DeployedRuntimeArtifactQuery query = new DeployedRuntimeArtifactQuery(true);

   query.where(VALID_FROM.lessOrEqual(activeAt.getTime()));

   return query;
}

Finding active Runtime Artifacts of a specified type ordered descending by a given Date

Use method findActive(String artifactType, Date activeAt) to create a query for finding active runtime artifacts of a specified type ordered descending by a given date.

public static DeployedRuntimeArtifactQuery findActive(String artifactType, Date activeAt)
{
   DeployedRuntimeArtifactQuery query = findAllActive(activeAt);

   query.where(ARTIFACT_TYPE_ID.isEqual(artifactType));

   return query;
}

Finding the active Runtime Artifact specified by artifact id and of the specified Type

Method findActive(String artifactId, String artifactType, Date activeAt) creates a query for finding the active runtime artifact specified by artifact id and of the specified type.

public static DeployedRuntimeArtifactQuery findActive(String artifactId, String artifactType, Date activeAt)
{
   DeployedRuntimeArtifactQuery query = findActive(artifactType, activeAt);

   query.where(ARTIFACT_ID.isEqual(artifactId));

   return query;
}

Retrieving all deployed Runtime Artifacts applying to specific Criteria

The queries created with the DeployedRuntimeArtifactQuery can be used on the QueryService to find all deployed runtime artifacts matching a specified criteria.

QueryService method getRuntimeArtifacts retrieves all DeployedRuntimeArtifacts satisfying the criteria specified in the provided query.

   @ExecutionPermission(id=ExecutionPermission.Id.readRuntimeArtifact)
   public DeployedRuntimeArtifacts getRuntimeArtifacts(DeployedRuntimeArtifactQuery query);

It returns the deployed runtime artifacts matching the specified criteria.

Example Usage

   QueryService qs = serviceFactory.getQueryService();

   DeployedRuntimeArtifacts runtimeArtifacts = 
      qs.getRuntimeArtifacts(DeployedRuntimeArtifactQuery.findAll());
   
   DeployedRuntimeArtifacts runtimeArtifacts = 
      qs.getRuntimeArtifacts(DeployedRuntimeArtifactQuery.findAllActive(new Date()));

   DeployedRuntimeArtifacts runtimeArtifacts = 
      qs.getRuntimeArtifacts(DeployedRuntimeArtifactQuery.findActive(BENCHMARK_ARTIFACT_TYPE_ID, new Date()));
      
   DeployedRuntimeArtifacts runtimeArtifacts = 
      qs.getRuntimeArtifacts(DeployedRuntimeArtifactQuery.findActive(BENCHMARK_REF, BenchmarkDefinitionArtifactType.TYPE_ID, new Date()));