Class AggregateTemplate

java.lang.Object
com.aquima.interactions.test.templates.AbstractReportingTemplate
com.aquima.interactions.test.templates.model.AggregateTemplate

public class AggregateTemplate extends AbstractReportingTemplate
This template may be used to initialize an aggregate definition.
Author:
voicu
  • Constructor Details

    • AggregateTemplate

      public AggregateTemplate(com.aquima.interactions.foundation.report.IInitializationReport report, MetaModelTemplate metaModel, String name, String functionalName)
      Creates a new Aggregate template instance.
      Parameters:
      report - The errors/warnings reporting object.
      metaModel - The meta model template.
      name - The name of the aggregate.
      functionalName - The functional name of the aggregate.
  • Method Details

    • getName

      protected String getName()
    • getFunctionalName

      protected String getFunctionalName()
    • addEntityReference

      public AggregateTemplate addEntityReference(String entityName)
      Adds an entity reference to the aggregate. All relations are recursively included. This method is equivalent to addEntityReference(entityName, true).
      Parameters:
      entityName - The name of the entity reference.
      Returns:
      This aggregate template.
    • addEntityReference

      public AggregateTemplate addEntityReference(String entityName, boolean includeAllRelations)
      Adds an entity reference to the aggregate. If the includeAllRelations attribute is true, all relations are recursively included. Otherwise, no relations are included and relations must be added manually using addRelationReference(String, String)

      If includedAllRelations is true, the referenced entity must already exist in the metamodel and all its relations must already exist. Only relations that exist in the metamodel at the time this method is called will be included.

      Parameters:
      entityName - the name of the entity
      includeAllRelations - whether to recursively include all relations
      Returns:
      This aggregate template.
    • addRelationReference

      public AggregateTemplate addRelationReference(String sourceEntityName, String relationName)
      Includes a relation in the aggregate. The entity whose relation is included must already be added to the aggregate using addEntityReference(String). The related entity is added as a non-root entity reference. No relations of the referred entity are included.
      Parameters:
      sourceEntityName - the name of the entity who owns the forward relation
      relationName - the name of the relation
      Returns:
      this aggregate template
    • addMetadata

      public MetadataTemplate addMetadata(String name, com.aquima.interactions.foundation.DataType dataType, boolean multiValued, String expression, String domainName)
      This method may be used to add a matadata definition to aggregate definition.
      Parameters:
      name - The name of the metadata.
      dataType - The dataType of metadata.
      multiValued - The multiValued flag of metadata.
      expression - The expression of metadata.
      Returns:
      The metadata template.
    • toDataSource

      public com.aquima.interactions.metamodel.ds.IAggregateDS toDataSource()
      This method converts the template to a data source that can be used to initialize an aggregate definition.
      Returns:
      a data source that can be used to initialize an aggregate definition.
    • getEntityReferences

      protected Iterator<com.aquima.interactions.test.templates.model.EntityReferenceDS> getEntityReferences()
    • getMetadata

      protected Iterator<MetadataTemplate> getMetadata()
    • addRole

      public void addRole(String role)
    • getRoles

      protected String[] getRoles()