Package com.aquima.interactions.rule
Class SnapshotInstanceStack
java.lang.Object
com.aquima.interactions.rule.InstanceStack
com.aquima.interactions.rule.SnapshotInstanceStack
- All Implemented Interfaces:
Serializable
Class responsible for adding instances in snapshots. Snapshoting should be used only in repeated contexts.
- Since:
- 9.9.2
- Author:
- MariusO
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method disables the posibility for stackinstances to be added in the snapshots.Creates a duplicate of the instance stack.void
This method enables the possibility for stackinstances to be added in the snapshots.getActiveInstance
(String entityName, boolean ignoreDeletedInstances) LET OP ! wat te doen wanneer er meerdere instanties van hetzelfde type teruggegeven worden? - Indien deze echt van gelijk type zijn (b.v.getActiveInstances
(boolean ignoreDeletedInstances) This method will return an array containing all the instances that have been activated on the stack.boolean
isEmpty()
This method will return a boolean indicating if the stack is empty.This method will return the instance that was last activated.This method will remove and return the instance that was last activated.void
pushActiveInstance
(IEntityInstance instance) This method adds the given instance to the stack of active instances.void
restore()
This method removes the most recently(last) stackinstancevoid
snapshot()
This method creates a new instance stack snapshotttoString()
-
Constructor Details
-
SnapshotInstanceStack
public SnapshotInstanceStack()
-
-
Method Details
-
duplicate
Description copied from class:InstanceStack
Creates a duplicate of the instance stack.- Overrides:
duplicate
in classInstanceStack
- Returns:
- A duplicate of the instance stack.
-
getActiveInstance
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 classInstanceStack
- 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
Description copied from class:InstanceStack
This method adds the given instance to the stack of active instances.- Overrides:
pushActiveInstance
in classInstanceStack
- Parameters:
instance
- The instance that should be marked active.
-
popActiveInstance
Description copied from class:InstanceStack
This method will remove and return the instance that was last activated.- Overrides:
popActiveInstance
in classInstanceStack
- Returns:
- The instance that was last activated.
-
peekActiveInstance
Description copied from class:InstanceStack
This method will return the instance that was last activated.- Overrides:
peekActiveInstance
in classInstanceStack
- 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 classInstanceStack
- Returns:
- a boolean indicating if the stack is empty.
-
getActiveInstances
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 classInstanceStack
- 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
- Overrides:
toString
in classInstanceStack
-
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
-