Class SnapshotInstanceStack

java.lang.Object
com.aquima.interactions.rule.InstanceStack
com.aquima.interactions.rule.SnapshotInstanceStack
All Implemented Interfaces:
Serializable

public class SnapshotInstanceStack extends InstanceStack
Class responsible for adding instances in snapshots. Snapshoting should be used only in repeated contexts.
Since:
9.9.2
Author:
MariusO
See Also:
  • Constructor Details

    • SnapshotInstanceStack

      public SnapshotInstanceStack()
  • Method Details

    • duplicate

      public InstanceStack duplicate()
      Description copied from class: InstanceStack
      Creates a duplicate of the instance stack.
      Overrides:
      duplicate in class InstanceStack
      Returns:
      A duplicate of the instance stack.
    • getActiveInstance

      public IEntityInstance getActiveInstance(String entityName, boolean ignoreDeletedInstances)
      Description copied from class: InstanceStack
      LET OP ! wat te doen wanneer er meerdere instanties van hetzelfde type teruggegeven worden? - Indien deze echt van gelijk type zijn (b.v. tweemaal persoon) dan is dit incorrect, aangezien Er geen onderscheid gemaakt kan worden tussen beide. - Indien er een parent-child relatie is tussen de typen (persoon, customer) ook fout
      Overrides:
      getActiveInstance in class InstanceStack
      Parameters:
      entityName - The type for which the active instance is requested.
      ignoreDeletedInstances - Boolean indicating if deleted instances should be skipped.
      Returns:
      The instance that was activated with the specified type.
    • pushActiveInstance

      public void pushActiveInstance(IEntityInstance instance)
      Description copied from class: InstanceStack
      This method adds the given instance to the stack of active instances.
      Overrides:
      pushActiveInstance in class InstanceStack
      Parameters:
      instance - The instance that should be marked active.
    • popActiveInstance

      public IEntityInstance popActiveInstance()
      Description copied from class: InstanceStack
      This method will remove and return the instance that was last activated.
      Overrides:
      popActiveInstance in class InstanceStack
      Returns:
      The instance that was last activated.
    • peekActiveInstance

      public IEntityInstance peekActiveInstance()
      Description copied from class: InstanceStack
      This method will return the instance that was last activated.
      Overrides:
      peekActiveInstance in class InstanceStack
      Returns:
      the instance that was last activated or null if no active instance exists.
    • isEmpty

      public boolean isEmpty()
      Description copied from class: InstanceStack
      This method will return a boolean indicating if the stack is empty.
      Overrides:
      isEmpty in class InstanceStack
      Returns:
      a boolean indicating if the stack is empty.
    • getActiveInstances

      public IEntityInstance[] getActiveInstances(boolean ignoreDeletedInstances)
      Description copied from class: InstanceStack
      This method will return an array containing all the instances that have been activated on the stack.
      Overrides:
      getActiveInstances in class InstanceStack
      Parameters:
      ignoreDeletedInstances - Boolean indicating if deleted instances should be skipped.
      Returns:
      an array containing all the instances that have been activated on the stack.
    • snapshot

      public void snapshot()
      This method creates a new instance stack snapshott
    • toString

      public String toString()
      Overrides:
      toString in class InstanceStack
    • restore

      public void restore()
      This method removes the most recently(last) stackinstance
    • enableSnapshoting

      public void enableSnapshoting()
      This method enables the possibility for stackinstances to be added in the snapshots. Snapshoting should be enabled only for repeated contexts.
    • disableSnapshoting

      public void disableSnapshoting()
      This method disables the posibility for stackinstances to be added in the snapshots. An integer value is used because it is possible to have more repeatedcontexts in the same flow, thus a boolean value would not suffice