org.eclipse.viatra.transformation.runtime.emf.rules.batch

## Class BatchTransformationRule<Match extends IPatternMatch,Matcher extends ViatraQueryMatcher<Match>>

- java.lang.Object
- - org.eclipse.viatra.transformation.runtime.emf.rules.batch.BatchTransformationRule<Match,Matcher>

- All Implemented Interfaces:
    ITransformationRule<Match,Matcher>
  Direct Known Subclasses:
    DSETransformationRule

      public class BatchTransformationRule<Match extends IPatternMatch,Matcher extends ViatraQueryMatcher<Match>>
      extends java.lang.Object
      implements ITransformationRule<Match,Matcher>

  Wrapper class for transformation rule definition to hide EVM specific internals. Subclasses can simply override the abstract precondition and model manipulation methods.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.String` | `ruleName`
    `static ActivationLifeCycle` | `STATEFUL_RULE_LIFECYCLE` Lifecycle for a rule that stores the list of fired activations; thus effectively forbids re-firing the same activation.
    `static ActivationLifeCycle` | `STATELESS_RULE_LIFECYCLE` Lifecycle for a rule that does not store the list of fired activations; thus allows re-firing the same activation again.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `BatchTransformationRule()`
    `` | `BatchTransformationRule(BatchTransformationRule<Match,Matcher> rule, EventFilter<Match> filter)`
    `` | `BatchTransformationRule(java.lang.String rulename, IQuerySpecification<Matcher> matcher, ActivationLifeCycle lifecycle, IMatchProcessor<Match> action)`
    `` | `BatchTransformationRule(java.lang.String rulename, IQuerySpecification<Matcher> matcher, ActivationLifeCycle lifecycle, IMatchProcessor<Match> action, EventFilter<Match> filter)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `IMatchProcessor<Match>` | `getAction()` Return an IMatchProcessor representing the model manipulation executed by the rule.
    `EventFilter<? super Match>` | `getFilter()` Returns the event filter set up for this rule; if no specific filter is set up, an dedicated empty filter is returned
    `java.lang.String` | `getName()`
    `IQuerySpecification<Matcher>` | `getPrecondition()` Returns the query specification representing the pattern used as a precondition.
    `RuleSpecification<Match>` | `getRuleSpecification()` Returns a RuleSpecification that can be added to a rule engine.

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

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

- - ### Field Detail

    - #### STATELESS_RULE_LIFECYCLE

          public static final ActivationLifeCycle STATELESS_RULE_LIFECYCLE

      Lifecycle for a rule that does not store the list of fired activations; thus allows re-firing the same activation again.

    - #### STATEFUL_RULE_LIFECYCLE

          public static final ActivationLifeCycle STATEFUL_RULE_LIFECYCLE

      Lifecycle for a rule that stores the list of fired activations; thus effectively forbids re-firing the same activation.

    - #### ruleName

          protected java.lang.String ruleName

  - ### Constructor Detail

    - #### BatchTransformationRule

          protected BatchTransformationRule()

    - #### BatchTransformationRule

          public BatchTransformationRule(java.lang.String rulename,
                                         IQuerySpecification<Matcher> matcher,
                                         ActivationLifeCycle lifecycle,
                                         IMatchProcessor<Match> action)

    - #### BatchTransformationRule

          public BatchTransformationRule(java.lang.String rulename,
                                         IQuerySpecification<Matcher> matcher,
                                         ActivationLifeCycle lifecycle,
                                         IMatchProcessor<Match> action,
                                         EventFilter<Match> filter)

    - #### BatchTransformationRule

          public BatchTransformationRule(BatchTransformationRule<Match,Matcher> rule,
                                         EventFilter<Match> filter)

  - ### Method Detail

    - #### getName

          public java.lang.String getName()

      Specified by:
        `getName` in interface `ITransformationRule<Match extends IPatternMatch,Matcher extends ViatraQueryMatcher<Match>>`

    - #### getRuleSpecification

          public RuleSpecification<Match> getRuleSpecification()

      Returns a RuleSpecification that can be added to a rule engine.
      Specified by:
        `getRuleSpecification` in interface `ITransformationRule<Match extends IPatternMatch,Matcher extends ViatraQueryMatcher<Match>>`

    - #### getPrecondition

          public IQuerySpecification<Matcher> getPrecondition()

      Returns the query specification representing the pattern used as a precondition.
      Specified by:
        `getPrecondition` in interface `ITransformationRule<Match extends IPatternMatch,Matcher extends ViatraQueryMatcher<Match>>`

    - #### getAction

          public IMatchProcessor<Match> getAction()

      Return an IMatchProcessor representing the model manipulation executed by the rule.

    - #### getFilter

          public EventFilter<? super Match> getFilter()

      Description copied from interface: `ITransformationRule`
      Returns the event filter set up for this rule; if no specific filter is set up, an dedicated empty filter is returned
      Specified by:
        `getFilter` in interface `ITransformationRule<Match extends IPatternMatch,Matcher extends ViatraQueryMatcher<Match>>`
      Returns:
        the event filter for this rule, never null