Class TmsProfileView

java.lang.Object
com.aquima.interactions.rule.tms.TmsProfileView

public class TmsProfileView extends Object
This class can generate a full xml view of the profile. Including sourcing-information.

When an entity was part in a calculation (for example: counting all instances of a certain entity type) a dependent-values is added under the entity element.

When an attribute-value was part in a source action for other attributes a dependent-values is added to the attribute tag inside 'profile/entity/instance/attribute

Requesting information from the Tms profile for this class does not modify the state internally which results in a view-only class.

N.B. When the state would be changed with automatically sourcing it could be that during generation of the xml new target-dependencies are added which in turn change the xml which was already generated. This would then result in an inconsistent xml.

Example excerpt of the xml:
 <profile>
   <entity name="Bedrijf">
     <instance name="Everest" id="0">
       <attribute name="werknemer-count" source-type="System">
         <values>
            <value>2</value>
         </values>
         <dependent-values/>
         <dependency rule-name="werknemer-count-rule"/>
       </attribute>
       <attribute name="werknemers" source-type="User">
         <values>
           <value reference-entity-name="Werknemer" reference-instance-name="fvm" reference-instance-id="2"/>
           <value reference-entity-name="Werknemer" reference-instance-name="oke" reference-instance-id="1"/>
         </values>
         <dependent-values>
           <value-reference entity-name="Bedrijf" attribute-name="werknemer-count" instance-id="0" 
              instance-name="Everest"/>
         </dependent-values>
       </attribute>
     </instance>
   </entity>
   <entity name="Item">
     <entity name="Product">
       <dependent-values>
         <value-reference entity-name="Bedrijf" attribute-name="product-count" instance-id="0"/>
       </dependent-values>
     </entity>
   </entity>
   <entity name="Werknemer">
     <instance name="fvm" id="2">
       <attribute name="bedrijf" source-type="System">
         <values>
           <value reference-entity-name="Bedrijf" reference-instance-name="Everest" reference-instance-id="0"/>
         </values>
       </attribute>
     </instance>
     <instance name="oke" id="1">
       <attribute name="bedrijf" source-type="System">
         <values>
           <value reference-entity-name="Bedrijf" reference-instance-name="Everest" reference-instance-id="0"/>
         </values>
       </attribute>
     </instance>
   </entity>
 </profile>
 
 
Since:
5.0
Author:
F. van der Meer, O. Kerpershoek
  • Constructor Details

    • TmsProfileView

      public TmsProfileView(TmsProfile profile, IMetaModel metamodel)
      Constructs a profile deduction view so xml's can be generated with this class.
      Parameters:
      profile - The profile for which the XML should be generated.
      metamodel - The meta model containing additional information of the profile objects.
  • Method Details

    • generateXml

      public void generateXml(OutputStream stream, String encoding) throws IOException
      Generate the profile-xml according to a specific encoding.
      Parameters:
      stream - The output stream the XML should be written to.
      encoding - The encoding that should be used for the XML.
      Throws:
      IOException - when an ioexception occurs on the stream.
      AppException - when an unexpected exception occures during the generation of the xml