Class Activation<EventAtom>
- java.lang.Object
-
- org.eclipse.viatra.transformation.evm.api.Activation<EventAtom>
-
- Type Parameters:
EventAtom
- the type of the pattern match
public class Activation<EventAtom> extends java.lang.Object
AnActivation
is a created for aRuleInstance
when the preconditions (LHS) are fully satisfied with some domain model elements and the instance becomes eligible for execution.An Activation holds a state, a pattern match, the corresponding instance 5nstance. The state of the Activation can be either Inactive, Appeared, Disappeared, Upgraded or Fired, while its actual state will be managed by the life-cycle of its instance.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Activation(RuleInstance<EventAtom> instance, EventAtom atom, ActivationState initState)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
void
fire(Context context)
The activation will be fired; the appropriate job of the instance will be executed based on the activation state.EventAtom
getAtom()
RuleInstance<EventAtom>
getInstance()
ActivationState
getState()
int
hashCode()
boolean
isEnabled()
An activation is enabled, if the there are jobs corresponding to the state of the activation.protected void
setState(ActivationState state)
java.lang.String
toString()
-
-
-
Constructor Detail
-
Activation
protected Activation(RuleInstance<EventAtom> instance, EventAtom atom, ActivationState initState)
-
-
Method Detail
-
getAtom
public EventAtom getAtom()
-
getState
public ActivationState getState()
-
isEnabled
public boolean isEnabled()
An activation is enabled, if the there are jobs corresponding to the state of the activation.- Returns:
- true, if there are jobs for the current state
-
getInstance
public RuleInstance<EventAtom> getInstance()
- Returns:
- the instance
-
setState
protected void setState(ActivationState state)
Should be only set throughRuleInstance.activationStateTransition(org.eclipse.viatra.transformation.evm.api.Activation<EventAtom>, org.eclipse.viatra.transformation.evm.api.event.EventType)
- Parameters:
state
-
-
fire
public void fire(Context context)
The activation will be fired; the appropriate job of the instance will be executed based on the activation state.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-