org.eclipse.viatra.transformation.evm.api

## Class RuleSpecification<EventAtom>

- java.lang.Object
- - org.eclipse.viatra.transformation.evm.api.RuleSpecification<EventAtom>

-     public class RuleSpecification<EventAtom>
      extends java.lang.Object

  A rule specification specifies how the set of individual rule activations and their states are computed, what jobs (operations) to perform when an activation is executed, and how events affect the state of the activations based on a life-cycle model.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RuleSpecification(EventSourceSpecification<EventAtom> sourceSpecification, ActivationLifeCycle lifeCycle, java.util.Set<Job<EventAtom>> jobs)` Creates a specification with the given life-cycle and job set.
    `RuleSpecification(EventSourceSpecification<EventAtom> sourceSpecification, ActivationLifeCycle lifeCycle, java.util.Set<Job<EventAtom>> jobs, java.lang.String name)` Creates a specification with a certain name based on the given life-cycle and job set.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `EventFilter<EventAtom>` | `createEmptyFilter()`
    `java.util.Set<ActivationState>` | `getEnabledStates()`
    `java.util.Map<ActivationState,java.util.Set<Job<EventAtom>>>` | `getJobs()`
    `java.util.Collection<Job<EventAtom>>` | `getJobs(ActivationState state)` Returns the jobs specified for the given state.
    `ActivationLifeCycle` | `getLifeCycle()`
    `java.lang.String` | `getName()`
    `EventSourceSpecification<EventAtom>` | `getSourceSpecification()`
    `protected RuleInstance<EventAtom>` | `instantiateRule(EventRealm eventRealm, EventFilter<? super EventAtom> filter)` Instantiates the rule on the given EventRealm with the given filter .
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### RuleSpecification

          public RuleSpecification(EventSourceSpecification<EventAtom> sourceSpecification,
                                   ActivationLifeCycle lifeCycle,
                                   java.util.Set<Job<EventAtom>> jobs)

      Creates a specification with the given life-cycle and job set.
      Parameters:
        `lifeCycle` -
        `jobs` -

    - #### RuleSpecification

          public RuleSpecification(EventSourceSpecification<EventAtom> sourceSpecification,
                                   ActivationLifeCycle lifeCycle,
                                   java.util.Set<Job<EventAtom>> jobs,
                                   java.lang.String name)

      Creates a specification with a certain name based on the given life-cycle and job set.
      Parameters:
        `lifeCycle` -
        `jobs` -
        `name` -

  - ### Method Detail

    - #### instantiateRule

          protected RuleInstance<EventAtom> instantiateRule(EventRealm eventRealm,
                                                            EventFilter<? super EventAtom> filter)

      Instantiates the rule on the given EventRealm with the given filter .
      Parameters:
        `eventRealm` -
        `filter` -
      Returns:
        the instantiated rule

    - #### getSourceSpecification

          public EventSourceSpecification<EventAtom> getSourceSpecification()

    - #### createEmptyFilter

          public EventFilter<EventAtom> createEmptyFilter()

    - #### getLifeCycle

          public ActivationLifeCycle getLifeCycle()

    - #### getEnabledStates

          public java.util.Set<ActivationState> getEnabledStates()

    - #### getJobs

          public java.util.Collection<Job<EventAtom>> getJobs(ActivationState state)

      Returns the jobs specified for the given state.
      Parameters:
        `state` -
      Returns:
        the collection of jobs

    - #### getJobs

          public java.util.Map<ActivationState,java.util.Set<Job<EventAtom>>> getJobs()

      Since:
        2.0

    - #### getName

          public java.lang.String getName()

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`